Skip to content

feat(program): update execution strategy#25

Merged
assagman merged 7 commits intomainfrom
fix/program
Dec 18, 2025
Merged

feat(program): update execution strategy#25
assagman merged 7 commits intomainfrom
fix/program

Conversation

@assagman
Copy link
Owner

  • Adds Program execution tracing via ForwardWithTrace and ProgramResult, including per-step status, timings, inputs, predictions, and aggregated usage (cost/latency).
  • Introduces ExecutionID-based retention (keep last N runs) and step-level helpers to retrieve prior step outputs for debugging/observability.
  • Improves correctness with signature validation (e.g., ValidateSignatures / AddModuleValidated) and deep-copying stored traces to avoid accidental mutation.
  • Fixes completions routing so completions are passed to the next module when it implements the consumer interface (notably MultiChainComparison).
  • Improves cancellation behavior: abort early on ctx cancellation with a clear error before starting program steps.
  • Updates model catalog, including Gemini 3 Flash pricing adjustments.
  • Re-exports tracing types/constants from dsgo, adds a runnable examples/program_tracing, and updates tests to match new semantics/errors.

Breaking Change

  • Program.Forward now returns the last module’s prediction only (no synthetic merged outputs). This may affect callers that relied on merged outputs from earlier steps.

Signed-off-by: assagman <ahmetsercansagman@gmail.com>
Signed-off-by: assagman <ahmetsercansagman@gmail.com>
Add a pre-flight `ctx.Err()` check before running
program steps to return a clear cancellation error
instead of starting execution.

Signed-off-by: assagman <ahmetsercansagman@gmail.com>
Signed-off-by: assagman <ahmetsercansagman@gmail.com>
add program execution tracing, signature validation and completions routing

BREAKING CHANGE: Program.Forward now returns the last module’s prediction (no synthetic merged outputs).
- Track per-step execution status, timings, inputs, predictions, and aggregated usage
- Add signature compatibility checks (ValidateSignatures / AddModuleValidated)
- Route `completions` via a CompletionsConsumer interface (MultiChainComparison opts in)
- Update integration + unit tests to match new error messages and output semantics

Signed-off-by: assagman <ahmetsercansagman@gmail.com>
Signed-off-by: assagman <ahmetsercansagman@gmail.com>
- Add `ForwardWithTrace` + `ProgramResult` to return both final prediction
and full execution trace
- Track executions by unique `ExecutionID`, retain last N runs, and expose
lookup/getters for step outputs
- Validate module outputs against signatures and avoid mutating stored traces
via deep-copy helpers
- Re-export tracing types/constants in `dsgo` and add `examples/program_tracing`
+ coverage tests

Signed-off-by: assagman <ahmetsercansagman@gmail.com>
@assagman assagman self-assigned this Dec 18, 2025
@assagman assagman added bug Something isn't working enhancement New feature or request labels Dec 18, 2025
@assagman assagman merged commit cf6d6fa into main Dec 18, 2025
4 checks passed
@assagman assagman deleted the fix/program branch December 18, 2025 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant