[WIP] Plan TraceDecay V2 brain rewrite#421
Conversation
|
e50f8f5 to
4f5ab66
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 986f25cca6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
5862bd6 to
53502de
Compare
Close the unbalanced WHEN predicate and bind receipt source_through to the batch committed endpoint so non-empty multi-batch progress can persist. (cherry picked from commit 0dc4954)
Preserve the in-place dashboard, MCP catalog, memory-store, Hermes migration, session-ingest, test-suite, and temporal integration work before merging the PR8 aggregate.
Integrate the PR8 temporal kernel, refresh lifecycle, compatibility authority, migration, runtime hardening, benchmark harness, and verification fixes into the V2 rewrite branch.
Resolve canonical observation payloads before legacy rows and preserve fail-closed authorization states for cross-root hydration.
Use canonical payload authority in hydration fixtures and remove disallowed query-kernel clippy exceptions while preserving deterministic error handling.
Normalize microsecond source timestamps once at the message persistence boundary so expanded LCM lineage retains the seconds-based compatibility contract.
Treat allowlisted lint paths as attribute syntax so unresolved code paths remain guarded.
Ensure fresh benchmark databases bind a production-generated signed key before temporal snapshots and retain attested Linux run evidence as provisional.
Extend the existing direct-evaluation-record-v1.json with a pr10_semantic_vector_evaluation section (described by feature/surface and date, not by commit hash; all results kept in the one record file). It captures the executed offline test suites for the PR10 semantic/vector path (vector generation, FastEmbed local-artifact runtime, fusion/calibration, and PR9 semantic-abstention fallback): 153 tests across 6 binaries pass, 0 fail, with no network or downloaded model runtime. It also records the default all-profile generate-candidates CLI run through the CompositionKernel::compose production boundary (6 train/validation outputs; semantic lane returns the byte-identical PR9 fallback offline). Same honest style as the PR9 flow: no receipts, gates, or invented thresholds; real-model benchmarks and any accept/reject outcome remain pending on a locked-quality run. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The parity lane added SessionStoreRow/Cursor/Table::SourceCursors. The exhaustive (wildcard-free) shape matches require every new protocol variant to be listed, so add the SourceCursors arms to session_store_row_matches, session_store_row_digest, and session_store_cursor_matches, plus a positive test case. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
install_mcp_server previously assigned config["lsp"]["tracedecay"] via serde_json indexing, which panics when the existing OpenCode config sets `lsp` to a boolean (e.g. `lsp: true`). Merge mcp/lsp entries through as_object_mut with explicit Config errors instead, converting `lsp: true` to an object map that retains built-in servers, and skipping injection when `lsp: false`. Adds a regression test covering the `lsp: true` case. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Daemon operations (notably `tracedecay branch gc`) failed with
"configuration authority unavailable: no pinned resolved snapshot for
project <id>" for registered projects that plainly exist. The fail-closed
`runtime_configuration_for_layout` lookup — correct for hook paths that must
never invent authority — was also on the daemon branch-admin path, so any
project not yet opened in this process (first operation, or the first after a
daemon restart) was rejected even though the daemon owns the durable store.
Add `resolve_runtime_configuration_for_layout`: the daemon authority path
resolves the durable current revision read-only and pins it on demand when the
process-local cache is cold, falling through to the existing read-only loader.
Route branch administration through it. A genuinely uninitialized or unopenable
store still yields a typed error; no legacy config input is consulted and the
store is never mutated.
Also fix the sibling lifecycle gap surfaced by moved, consolidated projects:
open_runtime_configuration_for_layout_read_only hard-errored ("configuration
store has no current revision") when a durable store exists but its
configuration authority was never migrated in (e.g. a consolidated destination
reopened read-only after a repository move). Guard store.current() with the
store's own is_uninitialized() contract and degrade to the registry-default
read-only snapshot in that state, exactly as the never-writable-store branch
already does. A non-empty store with an unreadable current revision is not
uninitialized and still surfaces a typed error, so durable authority is never
silently replaced.
Tests: registered project with a cold cache gets pinned on first daemon
authority access and the fail-closed lookup then reads it; an unresolvable
layout still errors typed; a schema-initialized but unseeded store serves the
registry-default read-only snapshot instead of erroring.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adopt the in-flight source_cursors (Observation family) extension and add the new Fact session-store family: memory_v2_facts, memory_v2_current_facts, memory_v2_assertions, memory_v2_lineage_events, and retrieval_anchors (the highest-usage previously unproven table). Adds table specs, full-column keyset page queries, canonical row decoding, cursor round-trips and validation, seeded fixtures in the unit and subprocess harnesses, exact canonical-digest oracles (source_cursors, retrieval_anchors), and two-page pagination walks for every new table. Keysets mirror each table's primary key; fixtures keep faithful column sets/order and omit CHECK/FK clauses per the harness convention. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add the Diagnostics session-store family: generation_diagnostics and diagnostic_generation_publications, mirroring src/diagnostics_store.rs DDL (faithful column set/order, primary keys, CHECK/index clauses omitted per harness convention). Adds table specs, full-column keyset page queries, canonical row decoding, cursor round-trips and validation, seeded fixtures in both harnesses, two-page pagination walks for both tables, and an exact canonical-digest oracle for diagnostic_generation_publications. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add the Configuration session-store family: configuration_revisions, configuration_entries, configuration_mutation_receipts, and configuration_audit_events, mirroring src/global_db/configuration/schema.rs DDL (faithful column set/order and primary keys; CHECK/FK clauses omitted per harness convention). Adds table specs, full-column keyset page queries, canonical row decoding, cursor round-trips and validation, seeded fixtures in both harnesses, two-page pagination walks for all four tables, and an exact canonical-digest oracle for configuration_revisions covering a NULL parent revision. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Plan 38 §3 final clause: superseded/deleted anchor dispositions release the storage of the append-only observation evidence stores (observations 1.8 GB, retrieval_anchors 1.6 GB, observation_repository_provenance 1.4 GB in one dogfood sessions.db). Mirrors the sibling LCM retention slice: bounded three-pass engine, DryRun/ Apply, before/after reclaim metrics, inert-by-default config (all windows None), typed entry point plus a reported (unwired) GlobalDb daemon seam. The disposition ledger is the governing authority: only anchors whose current (max-sequence) disposition is superseded or deleted are acted on; active and unavailable evidence is never released (plan non-goal encoded in SQL). The compact ledger, its lineage, and every foreign key are preserved intact and their immutability triggers respected; storage is reclaimed by releasing the fat payload columns in place (anchor_json/observation_json/availability_json/ capture_json rewritten to a compact tombstone marker) under generation-scoped, windowed, batched passes. Re-runs are idempotent. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The parity lane added the MemoryV2Facts, MemoryV2CurrentFacts, MemoryV2Assertions, MemoryV2LineageEvents, and RetrievalAnchors protocol variants. Extend the exhaustive (wildcard-free) session store shape matches (row/cursor expected-table derivation and row_digest extraction) plus positive test cases so the crate keeps compiling. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Backfill the session_assertions two-page composite-keyset walk with an exact canonical-digest oracle (closing the count-only gap flagged in review) by seeding a second assertion fixture row, and extract the session-table DDL previously duplicated verbatim between the unit and subprocess fixture builders into one shared crate const (SESSION_STORE_FIXTURE_TABLES_DDL) so the closed-table schemas cannot drift apart. The observations table stays harness-local because its foreign-key clause differs between the two fixtures. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Revert the manual 0.0.67 bump (the release drift guard requires the tree to match crates.io until release-plz recreates the bump) and mark the semver-checks job release-type=major for the intentional V2 break. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
6b032ca to
51a54a8
Compare
Project open must not fail when the root has no git repository; the code index has no identity there by design. Also switch semver-checks release-type to major (its vocabulary for a breaking release; the shipped bump remains the planned 0.x minor). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Final parity-lane sync: add the GenerationDiagnostics, DiagnosticGenerationPublications, ConfigurationRevisions, ConfigurationEntries, ConfigurationMutationReceipts, and ConfigurationAuditEvents variants to the exhaustive (wildcard-free) session store shape matches and row_digest extraction, plus positive test cases. Unblocks the package test binary link for the fleet. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
cccd508 to
d6b7a55
Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Inject a type-erased CodeIndexHookSink into McpServer via the construction context. The daemon builds it in open_project_server (and the portable broker path) closing over its cloneable CodeIndexSchedulerRegistryV1, so crate::mcp never names the daemon-private scheduler type. handle_hook_event_notification delivers the exact touched rel_paths into the mounted worktree's incremental queue as soon as the routing event is observed, independent of host-admission durability and without any standing filesystem watcher. Adds a direct test proving an after-edit hook reaches the sink with the served project root and the exact touched paths. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Cap the per-line read wait so a stalled daemon cannot exceed the probe's total deadline; recompute the remaining budget each iteration. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Forward-only post-update now waits for storage quick-check, authority audit, and session temporal health to converge before running Doctor, so schema migration and compatibility projections cannot race the gate. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Let dogfood forward-only runs opt out of the heal pass and integration reinstall via TRACEDECAY_DOGFOOD_NO_HEAL/NO_REINSTALL. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
tests/distribution/fastembed/acceptance.rs is copied into the packaged crate's examples/ dir by scripts/check-distribution-acceptance.sh and built as --example fastembed_distribution_acceptance. It is not a source-repo target, so cargo-shear's unlinked-file report is a false positive; document it via ignored-paths. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Inject the daemon-owned code-index scheduler registry into the MCP hook boundary via a type-erased CodeIndexHookSink. After-edit hooks now deliver their touched rel paths straight into the mounted worktree's incremental queue (notify_hook_paths), independent of host-admission durability. Also reword two stale InputEdit tree-cache doc comments in the code-index scheduler. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
WIP: plan only
This PR contains only the TraceDecay V2 total-rewrite design: one master plan, one plan-set index, and 28 linked subsystem/crate/product plans (30 documentation files). It deliberately contains no implementation.
Unified product and architecture
Multi-machine shared Brain
BrainId.Product surfaces and task execution
Search, hints, automation, APIs, CLI, and MCP
Claude Code, Codex, and Cursor bundles
HostIntegrationManifestV1; PR 22A owns its catalog/source IR, PR 22I deterministically emits unsignedHostBundlePayloadV1trees, PR 36R independently rebuilds/scans/conformance-tests/attests/signsHostBundleManifestV1, and application alone binds a signed release to current host capability state.Privacy and control plane
Accepted-base reconciliation and evidence
masterat273f50c0372f063b97f4755563a3ded65ef324d5(chore: release v0.0.53 (#437)); branch is not behind./fast/tracedecay-redesign-research(0700; files0600): 34,352 secret-scanned role-user records and a 9,988-record best-effort human subset through2026-07-11T01:04:10.875Z.0c56ebd9c54edfc76cda10b62de05e0a9443004c3ddce960daf300208bbdf340; human942f6662c77f820c4d8a2b7063889c4521cecee68bc0258c7c7c12ddc6309dc2.Validation
git diff --checkclean.FM-001throughFM-137contiguous and unique.Draft/WIP remains intentional until the plan is reviewed as one flowing architecture.