Skip to content

feat: save outcomes and change dossiers locally (preview) - #688

Merged
aryamthecodebreaker merged 2 commits into
mainfrom
claude/outcomes-dossier-store-af2067
Nov 22, 2026
Merged

aryamthecodebreaker merged 2 commits into
mainfrom
claude/outcomes-dossier-store-af2067

Conversation

@aryamthecodebreaker

Copy link
Copy Markdown
Owner

Implements work package 02 (outcomes and dossier persistence). Preview only. The ledger, CHANGELOG, versions and the website changelog are untouched.

What changed

  • Core packages/core/src/record-store.ts (exported from the node entry only): readStoredOutcomes/readStoredOutcome/saveStoredOutcome/deleteStoredOutcome/pruneStoredOutcomes and the dossier equivalents. One JSON file per record in .fixmap/outcomes/ or .fixmap/dossiers/. Every read and write re-validates with the existing outcomes.ts / dossier.ts validators.
  • CLI (preview): fixmap outcome record|list|show|remove|calibrate|prune and fixmap dossier create|list|show|remove. Help lines are prefixed Preview: .
  • MCP (preview, read-only): fixmap_outcomes (list/show/calibrate) and fixmap_dossier (list/show), with readOnlyHint: true and the Preview (may change before v0.10.0): prefix.
  • Feature catalog entries "Outcome feedback loop" and "Change dossier" with preview: true. Preview-set tests updated in cli-runner.test.ts and mcp.test.ts.
  • Docs: docs/outcomes-and-dossiers.md covers --redact, prune, and lock recovery. README links to it.

Ledger evidence

Outcome feedback loop

Remaining item in the ledger row Evidence
Atomic local persistence Temp file plus rename. .fixmap and .fixmap/outcomes must be real directories (no symlink or junction). Record and lock files must be regular files with nlink === 1. Stored ids cannot hold path separators, : or a trailing dot. A lock held by another writer gets a bounded wait (~1s) and is then refused, never taken over. Tests in packages/core/test/record-store.test.ts: atomic write with no leftover temp file, 12 concurrent writers with no lost or corrupt record, lock refusal with lock bytes unchanged, traversal ids, junction/symlinked .fixmap and store directory, hardlinked record.
CLI capture/removal `outcome record --report --diff
Privacy/retention controls --redact stores sha256:<hex> for the assessment reason and command evidence. Outcome records never store task text. outcome prune --older-than <days> deletes records recorded before the cutoff. Malformed files are listed and never deleted. Both are tested.
Calibration `outcome calibrate [--format markdown
Malformed stored files Invalid JSON, invalid envelopes, files whose name doesn't match their id, and non-.json files are returned as problems (Markdown: "Unreadable stored files"). Valid records still load.
Still open (not in this PR) Longitudinal cohorts and reviewed weight experiments.

Change dossier

Remaining item in the ledger row Evidence
Atomic local persistence Same store and the same tests as outcomes, under .fixmap/dossiers/ with .fixmap/dossiers.lock. A hand-edited dossier fails the fingerprint check and is reported as a problem.
CLI lifecycle commands `dossier create --report --task [--diff
Redaction dossier create --redact stores the task text as sha256:<hex>. The test asserts the raw text never reaches disk.
Cross-interface rendering Markdown and JSON in the CLI, plus the read-only MCP fixmap_dossier list/show.
Still open (not in this PR) External signatures/attestations, and assumptions/reviews/runtime evidence capture from the CLI (the fields exist and are stored empty).

Verification

Following the updated process, I did not run the full npm run ci locally. A full run started before that instruction arrived and was stopped partway. What did run on Windows:

  • npm run typecheck: pass
  • npm run lint: pass, after fixing one any in the new test
  • npm run check:action-bundle: pass. Core changed, but the Action bundle is unchanged because the store isn't imported by the Action, so there was no dist diff to commit.
  • npm test -w packages/core: 75 files, 881 passed, 1 skipped
  • npm test -w packages/cli: one run surfaced the MCP tool-list test needing the two new tools. After that fix, mcp.test.ts, outcome-command.test.ts and cli-runner.test.ts pass (185 tests). The full CLI suite was not rerun afterwards.

The concurrency test also caught a real race: two first writers both creating .fixmap/outcomes. Fixed by tolerating EEXIST; the link check still runs afterwards.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
fixmap Ready Ready Preview Nov 22, 2026 2:48pm UTC

aryamthecodebreaker and others added 2 commits November 22, 2026 20:11
Core: record-store.ts persists outcome records under .fixmap/outcomes/ and
change dossiers under .fixmap/dossiers/, one validated JSON file per record.
Writes use temp file + rename; links, junctions, hardlinks and traversal ids
are refused; a bounded lock is never taken over; malformed files are reported
as problems instead of failing a listing.

CLI (preview): fixmap outcome record|list|show|remove|calibrate|prune and
fixmap dossier create|list|show|remove, with --redact (free text stored as
SHA-256). Calibration stays report-only (automaticWeightChanges: false).

MCP (preview, read-only): fixmap_outcomes and fixmap_dossier.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…alpath

The repository root is resolved with realpath (macOS /var -> /private/var,
Windows 8.3 short names on CI runners), but the report path was only resolved
lexically, so relative() began with ".." and the plan artifact path was
dropped. Compare against the report's realpath, and add a regression that
reaches the repository and report through a symlink/junction alias.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aryamthecodebreaker
aryamthecodebreaker force-pushed the claude/outcomes-dossier-store-af2067 branch from dafdf87 to 237758e Compare November 22, 2026 14:47
@aryamthecodebreaker
aryamthecodebreaker merged commit b5802d7 into main Nov 22, 2026
8 checks passed

This branch was successfully deployed

1 active deployment
Preview — 237758e4 Deployed Nov 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant