Skip to content

feat(agent): persist snapshot provenance counterfactuals and replay - #311

Closed
enjoyandlove wants to merge 14 commits into
JSONbored:mainfrom
enjoyandlove:feat/270-agent-replayable-decision-snapshots
Closed

feat(agent): persist snapshot provenance counterfactuals and replay#311
enjoyandlove wants to merge 14 commits into
JSONbored:mainfrom
enjoyandlove:feat/270-agent-replayable-decision-snapshots

Conversation

@enjoyandlove

@enjoyandlove enjoyandlove commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #270

Scope

  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint — skipped (network unavailable in dev environment: read ECONNRESET)
  • npm run typecheck
  • npm run test:coverage — 801 tests pass, branch coverage 97.01% (above threshold)
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If 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

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. — N/A, no auth changes.
  • API/OpenAPI/MCP behavior is updated and tested where needed. — new GET /v1/agent/snapshots/:snapshotId route tested with 404 and 200 paths.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. — N/A, no UI changes.
  • Visible UI changes include screenshots or a short recording. — N/A, no UI changes.
  • Public docs/changelogs are updated where needed. — N/A, internal API only.

Notes

  • upstreamRulesetId column 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_level is nullable in the migration (ALTER TABLE ADD COLUMN in SQLite cannot be NOT NULL without a default); existing rows will have NULL, all new rows are always assigned a value by the orchestrator.
  • alternativesConsidered and counterfactualReasons are optional (string[] | undefined) on AgentActionRecord for backward compatibility with test fixtures and inline action objects in existing tests.

@enjoyandlove enjoyandlove changed the title feat(agent): persist snapshot provenance, counterfactuals, and replay… feat(agent): persist snapshot provenance counterfactuals and replay Jun 2, 2026

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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/:snapshotId remains 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

@JSONbored
JSONbored self-requested a review June 3, 2026 22:33

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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>
@JSONbored

Copy link
Copy Markdown
Owner

@enjoyandlove thanks for the work here.

A few notes:

  • This PR has become too stale and broad to keep carrying forward as the snapshot path evolves.
  • The migration numbering is obsolete, and focused pieces of the work are already split into newer PRs.

Required changes:

  • I would close this PR rather than keep rebasing it.
  • If replay still needs a follow-up, open a fresh PR with only that remaining behavior and current migration numbering.

Validation expected:

  • A replacement should include current migration order, focused replay tests, and the current PR-template evidence.

@JSONbored JSONbored closed this Jun 4, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 4, 2026
@JSONbored JSONbored added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jun 10, 2026
@JSONbored JSONbored added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. and removed feature gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

feat(agent): add replayable decision snapshots

2 participants