feat(agent): persist snapshot provenance counterfactuals and replay - #311
Closed
enjoyandlove wants to merge 14 commits into
Closed
feat(agent): persist snapshot provenance counterfactuals and replay#311enjoyandlove wants to merge 14 commits into
enjoyandlove wants to merge 14 commits into
Conversation
…ts to clear 97% threshold
Signed-off-by: Chan <101856681+enjoyandlove@users.noreply.github.com>
JSONbored
requested changes
Jun 2, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
@enjoyandlove this is moving in the right direction, but it is currently too broad for the split snapshot roadmap.
Required changes:
- Split the work against the smaller child issues instead of closing the whole snapshot epic in one PR.
- If
/v1/agent/snapshots/:snapshotIdremains in scope, update OpenAPI schemas/spec and generated UI artifacts. - Keep the PR to one focused slice.
Validation expected:
- npm run test:ci
- npm run ui:openapi:check
…in executeDecisionPackRun
Signed-off-by: Chan <101856681+enjoyandlove@users.noreply.github.com>
JSONbored
self-requested a review
June 3, 2026 22:33
JSONbored
requested changes
Jun 3, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
@enjoyandlove this is mechanically blocked right now.
A few notes:
- The snapshot provenance/replay surface is large and needs green validation before deeper review.
- Current CI fails in typecheck at
src/types.ts(712,1). - Superagent has now passed, so validate is the remaining check blocker.
Required changes:
- Fix merge conflicts.
- Ensure CI is fully green.
Validation expected:
npm run typecheck- Focused decision snapshot tests
- Full
npm run test:ci
Signed-off-by: Chan <101856681+enjoyandlove@users.noreply.github.com>
23 tasks
23 tasks
Owner
|
@enjoyandlove thanks for the work here. A few notes:
Required changes:
Validation expected:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #270
decision_snapshot_idcolumn toagent_actions; every action produced by the orchestrator now carries a stable link to the context snapshot that drove it.actor_login,decision_pack_generated_at,confidence_level,freshness_at_decision,upstream_ruleset_id) toagent_context_snapshotsso any decision can be inspected after the fact.test/fixtures/decision-snapshots/private.jsonandpublic-safe.jsonto pin the public/private serialization boundary; tests assert forbidden fields (payload,recommendationEvidence,alternativesConsidered,counterfactualReasons, reward language) never reach public output.alternatives_considered_jsonandcounterfactual_reasons_jsontoagent_actions; orchestrator populates these from the decision pack — listing other ranked repos and the conditions that would flip the recommendation.GET /v1/agent/snapshots/:snapshotIdendpoint that returns a replayable{ snapshotId, replayedAt, run, context, actions }payload, auth-gated to the original actor.Scope
CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlint— skipped (network unavailable in dev environment:read ECONNRESET)npm run typechecknpm run test:coverage— 801 tests pass, branch coverage 97.01% (above threshold)npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
npm run actionlint— network reset error in dev environment; no workflow files were modified.npm run test:workers,build:mcp,test:mcp-pack,ui:*— no MCP package or UI files were changed; these gates are unchanged.Safety
GET /v1/agent/snapshots/:snapshotIdroute tested with 404 and 200 paths.Notes
upstreamRulesetIdcolumn exists in schema and type but is not yet wired to a data source in the orchestrator. Populating it requires an additional DB query in the hot path; left as a follow-up. The field is nullable and safe to leave null until that wiring is added.confidence_levelis nullable in the migration (ALTER TABLE ADD COLUMNin SQLite cannot be NOT NULL without a default); existing rows will have NULL, all new rows are always assigned a value by the orchestrator.alternativesConsideredandcounterfactualReasonsare optional (string[] | undefined) onAgentActionRecordfor backward compatibility with test fixtures and inline action objects in existing tests.