Skip to content

[WIP] Plan TraceDecay V2 brain rewrite#421

Draft
ScriptedAlchemy wants to merge 23 commits into
masterfrom
codex/tracedecay-total-redesign-plan
Draft

[WIP] Plan TraceDecay V2 brain rewrite#421
ScriptedAlchemy wants to merge 23 commits into
masterfrom
codex/tracedecay-total-redesign-plan

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Jul 10, 2026

Copy link
Copy Markdown
Owner

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

  • Rebuild TraceDecay as one coherent profile-wide brain across projects, repositories, worktrees, branches, threads, turns, agents, workflows, tools, artifacts, code, Git, facts, memories, tasks, plans, delivery, and time.
  • Make an immutable sanitized observation/event stream the write authority; derive versioned projections, graph/read models, search indexes, analytics, hints, and UI views through fenced replayable projectors with checkpoints, dead letters, repair, and provenance.
  • Replace ambiguous project-only identity and split stores with canonical profile/project/repository/worktree/session/message/agent/task/artifact/code identities, explicit source bindings, temporal validity, variant safety, and protected consolidation/quarantine workflows.
  • Define crate ownership, dependency/release DAGs, anti-corruption boundaries, migration/deletion gates, negative-code budgets, and shared kernels so the rewrite converges instead of recreating fragmented subsystems.

Multi-machine shared Brain

  • Adds plan 28 for local-only, remote-authority, cached-client, read-replica, standby, and hybrid-placement operation under one BrainId.
  • Keeps every SQLite/WAL family host-local. Remote nodes exchange sanitized observations, signed snapshots/tails, immutable packs, and typed commands through the authenticated application/API contract; no network-mounted database or database URL is exposed.
  • Correlates equivalent clones across machines through credential-free Git remote evidence plus verified object/commit/tree/ancestry evidence. Paths and worktrees stay node-scoped; forks, shallow/rewritten histories, and contradictions remain explicit candidates.
  • Uses exactly one writable authority per mutable shard, signed/expiring node and cache grants, bounded causal frontiers, authority/placement epochs, offline idempotent capture, visible lag/pending/conflict state, and positive external fencing before standby promotion.
  • Makes Tailscale an optional connectivity profile only. Ordinary authenticated HTTPS/mTLS, LAN/VPN, reverse proxy, or tunnel deployments use the same TraceDecay identity, authorization, privacy, revocation, and fencing rules.
  • Adds wrapped-key disaster recovery after total authority-node/keyring loss, explicit remote schemas/retention, node/store/repository topology UI, Sync Observatory, Brain Settings, CLI/API/SDK bindings, compact default MCP status, operator-only MCP administration, and multi-machine fault/RPO/RTO gates.

Product surfaces and task execution

  • Replace the project-only dashboard with an All / Brain workspace plus scoped lenses; interactive Git, code, thread, turn, agent, task, plan, memory, impact, and timeline graphs; reasoning/code/artifact lineage; synchronized explorers; and accessible table/outline parity.
  • Add hermetic replay/debug labs for search, LCM, facts/memory, hooks, hints, context scouting, redaction, curation, automation, scheduling, configuration, and experiments with current-versus-historical policy comparisons and reproducible receipts.
  • Port and redesign the Hermes Kanban concept as a native TraceDecay task/plan graph—not an adapter—with federated initiatives/boards, DAG dependencies, multi-project work bundles, model/effort routing, executor/provider capabilities, offers/admission, leases, grants, work packets, nearby-agent awareness, and duplicate/conflict prevention.
  • Add validated sharded frontmatter/CommonMark task-graph edit workspaces for large agent edits, authoritative validate/diff/rebase/submit flows, safe temporary cleanup, exact candidate refs, and atomic owner-shard publication.

Search, hints, automation, APIs, CLI, and MCP

  • Redesign hybrid lexical/vector/graph/temporal retrieval, supersession-aware ranking, contextual retrieval IDs, cross-project scope, explainability, qrels/judgments, real-session replay evaluation, and precision/recall promotion gates.
  • Make adaptive hint arbitration and optional incremental model-backed context scouting compact, material, deduplicated, privacy-safe, nearby-work aware, and measurable against useful-silence baselines.
  • Make autonomous memory/skill curation and self-improvement event-driven and frontier-fenced: unchanged/no-activity inputs create no repeated runs or model/tool work.
  • Publish one typed application contract through an official HTTP API, Rust/TypeScript/Python SDKs, CLI, optional MCP, dashboard, hooks, and executors; centralize typed views, Markdown/JSON rendering, errors, pagination, and capability discovery.
  • Split MCP into independently installable context/work/operator trust-boundary registrations backed by one binary/daemon/catalog. Skills plus CLI remain the complete MCP-free baseline; eager clients must pass the same security/context budgets as deferred clients.

Claude Code, Codex, and Cursor bundles

  • Adds plan 27 with primary-source research for official Claude Code, Codex, and Cursor plugin, skill, command, agent/subagent, hook, MCP, configuration, marketplace, permission, and progressive-disclosure behavior.
  • Keeps one canonical HostIntegrationManifestV1; PR 22A owns its catalog/source IR, PR 22I deterministically emits unsigned HostBundlePayloadV1 trees, PR 36R independently rebuilds/scans/conformance-tests/attests/signs HostBundleManifestV1, and application alone binds a signed release to current host capability state.
  • Uses host capability evidence and stock-host conformance instead of assuming cross-host parity. Unsupported/version-gated behavior gets an explicit omission and skill/CLI/API fallback.
  • Ships a small skills-first core plus optional least-privilege MCP companions; commands remain thin compatibility/explicit-user affordances, hooks remain bounded, and specialist roles receive exact task/scope/worktree/retrieval-anchor handoffs.

Privacy and control plane

  • Add ingest/retrieval/export/presentation secret detection and redaction with policy versions, sensitivity labels, grants, audit receipts, protected quarantine, leak-regression tests, and UI/CLI controls.
  • Put configuration—including redaction, retention, providers/models, hints, hooks, search, automation, executors, task routing, host integrations, shared-Brain placement/sync/cache/failover, and sharing—in one versioned control plane available through UI, CLI, API, and optional MCP.
  • Preserve fully autonomous curation semantics; there is no generic preview/apply/rollback proposal queue.

Accepted-base reconciliation and evidence

  • Current with master at 273f50c0372f063b97f4755563a3ded65ef324d5 (chore: release v0.0.53 (#437)); branch is not behind.
  • Incorporates accepted changes through fix(doctor): isolate registry diff conflicts #440, including fix(storage): add explicit split-store consolidation #425 split-store consolidation and fix(doctor): derive orphan stores from registry reconstruction #439/fix(doctor): isolate registry diff conflicts #440 registry-reconstruction truth/conflict isolation. At publication, this draft [WIP] Plan TraceDecay V2 brain rewrite #421 is the only open PR.
  • Planning used TraceDecay LCM/session/message/fact/code/Git/analytics/diagnostic/automation surfaces, supported CLI/provider-local fallbacks when context tools failed, several independent subagent audits, Hermes source analysis, and primary-source/web/arXiv research.
  • Private chronological exports remain outside Git under /fast/tracedecay-redesign-research (0700; files 0600): 34,352 secret-scanned role-user records and a 9,988-record best-effort human subset through 2026-07-11T01:04:10.875Z.
  • Retained sanitized-content SHA-256: broad 0c56ebd9c54edfc76cda10b62de05e0a9443004c3ddce960daf300208bbdf340; human 942f6662c77f820c4d8a2b7063889c4521cecee68bc0258c7c7c12ddc6309dc2.
  • No transcript, database, generated fixture, or private research artifact is committed or indexed by this PR.

Validation

  • 30/30 intended documentation files and no other changed paths.
  • Internal relative links valid; Markdown fences balanced; git diff --check clean.
  • Failure modes FM-001 through FM-137 contiguous and unique.
  • Cross-plan type owners, signed sync/cache contracts, positive failover fencing, recovery keys, physical schemas, PR sequencing, closed Brain operation bindings, host compiler/signing/runtime boundaries, task-edit ceilings, configuration targets, and integration operations reconciled by independent final audits.
  • Corpus ordering, deduplication, timestamps, content hashes, permissions, and redacted-copy equality validated.
  • Direct plan scan, private-corpus scans, and staged-diff scan pass with gitleaks and zero findings.

Draft/WIP remains intentional until the plan is reviewed as one flowing architecture.

@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bcb6710

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy ScriptedAlchemy added the WIP Work in progress; do not merge label Jul 10, 2026
@ScriptedAlchemy ScriptedAlchemy force-pushed the codex/tracedecay-total-redesign-plan branch from e50f8f5 to 4f5ab66 Compare July 10, 2026 05:54
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +1946 to +1949
- Land accounting event/metric/SLO/savings contracts and generated descriptors (22F), denominator-safe ledgers/rollups/lag/data-quality/cap anchors (22G), then adoption, hint outcomes, SLO monitors, and recorded-baseline savings (22H), as specified by plan 26.
- [ ] Use plan 08's generated `SurfaceKind` everywhere; prove known/capped/partial/unknown denominators round-trip losslessly and replay/lab traffic cannot pollute live metrics.

#### PR 22A: Generated capability and tool catalog

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Schedule the catalog before generated-metadata consumers

When the Phase 3 ladder is followed literally, this schedules PR 22F–22H before PR 22A even though the 22F–22H checklist requires plan 08's generated SurfaceKind everywhere. PR 22A is the step that creates the generated capability/tool catalog and its surface/availability artifacts, so the accounting/adoption work either blocks or has to invent duplicate local surface metadata; move 22A ahead of the first generated-catalog consumer or split the dependent 22H work after it.

Useful? React with 👍 / 👎.

@ScriptedAlchemy ScriptedAlchemy force-pushed the codex/tracedecay-total-redesign-plan branch 3 times, most recently from a543867 to 5862bd6 Compare July 11, 2026 13:15
ScriptedAlchemy and others added 22 commits July 11, 2026 16:51
Update all 21 V2 plan documents with latest revisions (+566/-188).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
docs/superpowers/plans/ blocked the V2 plan files from normal git adds
(everything so far was force-added). Keep other plan scratch ignored but
track tracedecay-v2/ and the master brain-rewrite plan normally.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Integration-verifier pass over the 11-editor reconciliation: bad section
ref in plan 25, two stale tool-count stragglers (12, 14), two lab-heading
stragglers in the master plan, plan 25 crate wiring in 19's tree/DAG/SPI
owner, and plan 25 producer citations in 02/04.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Three-way verification pass after the rebase and external deepening
commits: reconcile remaining stale merge-state claims (#418 released,
#423/#424/#425/#407 merged at base 3567e31; #409 closed-not-merged),
enforce single canonical definitions (DiagnosticEnvelopeV1 -> plan 24,
SanitizationReceiptV1 -> plan 18, CursorPage -> plan 17), fix a stray
non-canonical error code in plan 01, and repair four tables broken by
unescaped pipes in inline code. Lab inventory, budgets, tool counts,
FM-001..103 contiguity, links after the docs/plans move, and PR-letter
namespace all verified clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ScriptedAlchemy ScriptedAlchemy force-pushed the codex/tracedecay-total-redesign-plan branch from 5862bd6 to 53502de Compare July 11, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Work in progress; do not merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant