Skip to content

Local-first 🧠 memory for Hermes Agent that lives in your Obsidian vault and remembers project context. Nightly 😴 dream passes turn repeat corrections into confirmed preferences with measurable confidence. Adapters ship for Claude Code, Codex, and OpenClaw, with an MCP server for anything else.

TypeScript
32.2 KB
Raw Blame

Agent presence and self-improvement - install-time rules-file presence, operator-approved lesson promotion, ChatGPT desktop reach and benchmark-gated skill rewrites

Status: draft Audience: implementation

Problem statement

Open Second Brain is invisible to most hosts it serves. The only thing telling a host agent the brain exists is the SessionStart/PostCompact hook injection (hooks/active-inject.ts); on hosts where no hook is wired, the agent never learns the brain exists, and the same-turn atomic-fact write gate that src/core/brain/writeback-contract.ts fully specifies is reported by o2b doctor --readiness as a permanently un-actionable missing-block, because the checker's own docblock states "NO INSTALLER LIVES HERE". A memory server nobody mentions is almost never called. Two more presence gaps compound this: vetted lessons (the brain's own confirmed, high-confidence, preferred-tier rules) reach only agents that load Open Second Brain hooks, because nothing can install them into the rules files hosts actually read - and no approval tier exists at all, so the one automatic promotion in the tree (dream-refresh.ts flips unconfirmed to confirmed on first applied evidence) is the only lifecycle a lesson has. Reach has a third hole: ChatGPT desktop reads the same ~/.codex/config.toml the codex adapter already writes, but no surface in the tree names it, so a ChatGPT-desktop-only operator has no way to discover that o2b install --target codex --apply is their install command. And on the self-improvement side, the skill lifecycle is open only at the ranking end: invocation evidence flows (skill_invoked continuity records, deriveSkillUsage, usage-weighted attach ranking), the dream pass plans preference retires only, and nothing ever edits a working skill's SKILL.md against measured outcomes. Skills are static text that can only be replaced by hand.

Premise verification

Verdicts from targeted reads against this tree at 07125f6d (origin/main, v1.97.0), recorded with the corrections from the recon reports and the inline verification. All four premises held; nothing is dropped and nothing is refused. The corrections below are binding for the plan; the full anchor-by-anchor table lives in variants.md.

  • t_635e3e72 (scored skill rewrites gated by task benchmarks) - premise confirmed, two anchor corrections. The gap is real: grep for rewrite/benchmark/selection-gate mechanisms across src/core/brain and src/core/surface returns nothing; the dream pass plans only preference retires (PlanState.retires, src/core/brain/dream-plan.ts:214) and never touches skill files; the skill-usage.ts docblock's "rank, retain, or retire" is aspiration, not implementation. The machinery to reuse is exactly where the recon says: acceptSkillProposal at src/core/brain/skill-proposals.ts:766 with the archive/materialize/commit journal phases, SkillAcceptLockedError at :975, materialize writes overwrite: false (:868 for the skills root, which passes no vaultForRelativePath), the preregistration discipline in src/core/decision-model/eval-spec.ts (hash-order-30-70 at :41, the promote | hold | not_enough_evidence three-arm verdict at :56), parseBenchFixture at src/core/bench/fixture.ts:42, NEEDS_LLM_STEP/buildNeedsLlmStep in src/core/brain/llm-step.ts, config keys at src/core/config.ts:733/:806/:1887, and the census rows at tests/core/architecture/write-site-census.test.ts:744/:1109. Corrections: buildNeedsLlmStep is at llm-step.ts:85 (recon said :67); and the accept journal records existence flags only (acceptedExisted, materializedExisted) - no prior-content copy - while evolveAcceptedProposal (skill-proposals.ts:1393) already overwrites an accepted skill's frontmatter with overwrite: true, so an overwrite precedent exists but a body-replacing rewrite still has no rollback path for content. The design's journal extension is required, not optional.
  • t_ba41a78a (install writes the brain-usage block into agent rules files) - premise confirmed, one scope correction. The checker exists and is write-only-by-contract (writeback-contract.ts: "NO INSTALLER LIVES HERE" docblock, AGENT_INSTRUCTION_FILES at :98, HOST_INSTRUCTION_PRECEDENCE at :137, WRITEBACK_CONTRACT_REQUIREMENTS three clauses, missingWritebackGateClauses pure); the managed-block editor exists (src/core/install/managed-block.ts, idempotent insertManagedBlock, validateMarkers refusing multiple/unpaired/reversed markers); the install consent ladder is fail-closed (src/cli/install/install.ts:415-462, exit 6 without --yes headless); the readiness probe audits the VAULT root (doctor-readiness.ts, workspace = opts.vault). Correction: the recon's installer table row "claude-code writes CLAUDE.md" is unreachable - INSTALL_TARGET_ID (src/core/runtime/host-facts.ts:61) has ten members and none is claude-code, as the precedence docblock itself states; the installer maps REGISTERED targets through the precedence table (codex, cursor, opencode, aider to AGENTS.md; gemini-cli to GEMINI.md), so the claude-code row stays audit-side until a claude-code target ever exists.
  • t_1e952e43 (operator-approved lessons promoted into rules files) - premise confirmed. No approval-hold tier exists: BRAIN_PREFERENCE_STATUS is the closed triple unconfirmed | confirmed | quarantine (src/core/brain/types.ts:89), promotion is automatic at the dream refresh (the firstApplied branch, dream-refresh.ts:269), and the operator acts only after the fact (reject, pin). The lessons digest is derived (computeLessons, LESSON_TIER at lessons.ts:73, idempotent regenerateLessons at :470), content-hash pinning exists and is observability-not-enforcement (content-hash.ts), the write-approval lane family is inbound-only (write-gate.ts, lanes signals | notes | ingest), and no rules file is ever written by this tree today. No o2b brain lessons verb family exists. Trivial drift: HOST_INSTRUCTION_PRECEDENCE is at :137-145 (recon said :136-143).
  • t_8b793376 (ChatGPT desktop as an install target) - premise confirmed; recon report was absent, verified inline. Zero references to ChatGPT anywhere in src/, docs/ or README.md; the codex adapter (src/core/install/adapters/codex.ts) is subprocess-driven with the $CODEX_HOME/config.toml TOML-merge fallback, detect() keys the note on Bun.which("codex") (:121) and reports the target row regardless of binary presence; the target vocabulary is held equal to the registered adapter population in both directions by tests/core/architecture/host-facts-census.test.ts; the README supported-clients table names Codex at :80. The external premise (ChatGPT desktop reads the shared codex config) is the upstream card's own finding, already accepted at scope review. The remaining decision is pinned below to alias-of-codex: no new InstallTargetId.

Scope

  • Lane B (t_ba41a78a, commits the shared writer FIRST): one shared, block-id-parametrised rules-block writer module (src/core/install/rules-block.ts) over the existing managed-block editor, plus the installer lane that uses it - an instruction step in o2b install that writes the canonical brain-usage block into the preferred agent-instruction file of targets with a precedence entry, idempotently, consent-gated, backed up, with its own lock file and an uninstall reverse step. The canonical body becomes a named constant beside the checker's contract clauses with a self-test.
  • Lane C (t_1e952e43, depends on the pinned writer): an operator approval tier for lessons and the promotion lane that renders qualifying, approved, fresh (content-hash-matching) lessons into a second, sibling managed block in the same rules files through the same writer - operator verbs o2b brain lessons candidates|approve|deny|refresh-blocks, an approval ledger in the derived store, doctor readiness rows, report-only MCP counts. No agent-facing path can approve or write.
  • Lane D (t_8b793376, independent): ChatGPT desktop named as a reader of the codex target - a detect note on the codex adapter when the codex binary is absent, a README supported-clients row and an install/codex.md section. No new install target id; no adapter behavior change.
  • Lane A (t_635e3e72, the L anchor, independent of B/C/D): the benchmark-gated skill rewrite loop - per-skill benchmark task sets (Brain/skill-benchmarks/<skill>/tasks.json, structural predicates only), a preregistered spec with a frozen dev/held-out split receipt, envelope-mediated candidate rollouts (one needs-llm-step per dev task, the calling agent executes), a deterministic selection gate the candidate must win on dev tasks, one held-out check on the promoted candidate, and an apply path that lands through the existing proposal pipeline with the accept journal extended to restore prior skill bytes on rollback.
  • Integrator: reconciliation of shared append-only registries (command manifest, help text, docs), census coherence across lanes, full local gates.

Out of scope

  • A claude-code install target (none exists; the marketplace plugin is the Claude Code lane) and any --workspace-root override for the instruction step: v1 writes at the vault root only, the surface the readiness probe audits. Recorded as follow-ups.
  • A .cursor/rules or any out-of-vault rules-file target: it would drag an OUT_OF_VAULT_STATE row and egress-registry attribution with it; vault-root files cover the motivating Cursor-with-bare-MCP case today.
  • Any change to the writeback-contract audit semantics (it stays read-only, extracts by the settled default markers, grades exactly as today) and no new finding vocabulary there.
  • Dream-tail or hook-triggered rules-file refreshes: blocks are refreshed only by the operator verb. The consent-once-then-derive middle ground is deliberately not taken this wave.
  • Skill version publishing, version chains or a skill release surface (assigned to another card on the board); single prior-content backup only.
  • Held-out task text in any dev envelope, in any grade record, or in any MCP surface - the envelope builder asserts dev membership and the grade record carries ids and scores, never task or transcript text.
  • Per-adapter rewrites of the aider conf block or any adapter's existing managed block: the instruction step is additive beside them.
  • Version bump, CHANGELOG assembly and the release-wide docs pass: that is the pr-prepare phase, not this plan.

Chosen approach

One shared writer, two producers, one kernel lane. The wave's center is a single rules-block writer module that both rules-file features import (the installer lane and the lessons lane), so there is exactly one marker-scoped, atomic, idempotent, consent-riding write class for harness-owned files and every new write site lands in one census story. Each of the other two features is a self-contained kernel beside that spine: the skill rewrite loop is three leaf modules plus extensions to the proposal pipeline that already owns gated skill writes, and the ChatGPT lane is detection-plus-docs on the codex adapter. The lanes own disjoint files; the only shared files are append-only registries (command manifest, help text, docs, state surfaces) governed by the protocol in plan.md.

Kernel invariants honored

  • Apply gates on every new write. The rules-file write class inherits the install consent ladder verbatim (plan first, --apply executes, headless refuses without --yes, verdict recorded, --force the only override for a drifted block, backups before first writes, typed refusals with exit codes that already exist). Skill-file writes pass the existing human accept through acceptSkillProposal with the write-ahead journal, now content-restoring; benchmark directories are written only through the shared atomic writers with the vault-identity write guard at every vault-side entry.
  • No model in the kernel. Every generation and every task execution is envelope-mediated (needs-llm-step); scoring is deterministic structural predicates; external opinion rides the local command bridge, advisory only, never moving the metric.
  • No silent fallbacks. Unknown mode values, malformed task sets, split-receipt mismatches, short dev n, held-out misses, symlinked targets, drifted blocks and hand-edited divergence are all named outcomes (the three-arm verdict, RulesBlockError kinds, typed config refusals); a gate failure stages nothing and says so.
  • No hardcoded natural-language phrases. The scorer matches structure over closed vocabularies, never prose; lesson qualification uses operator-declared scope lists (no default vocabulary); the one fixed English instruction body is a named, self-tested constant beside the contract clauses, and every other user-visible string follows the tree's existing English constants.

Design decisions

  • One writer module, two producers, two block ids. src/core/install/rules-block.ts is the only code that moves a rules-file block: renderRulesBlock, writeRulesBlock, removeRulesBlock, readRulesBlock and rulesBlockDrift, all parametrised by a closed RULES_BLOCK_ID pair (usage | lessons). The installer and the lessons verbs call it; neither forks the editor. The writer wraps insertManagedBlock/removeManagedBlock (operator bytes outside the block are preserved by the editor's guarantee), writes atomically, byte-compares before writing so re-application is a no-op, and takes backups before first writes.
  • The usage block keeps the settled default markers; the lessons block gets its own pair. The writeback-contract audit extracts the managed block by DEFAULT_BEGIN_MARKER/DEFAULT_END_MARKER and grades it against the three gate clauses; those spellings are contract, not style. validateMarkers refuses two pairs of the SAME spelling, so the lessons block carries a distinct HTML-comment pair (<!-- >>> open-second-brain lessons >>> --> / <!-- >>> open-second-brain lessons <<< -->), which renders as nothing in markdown and survives in all three instruction files. The audit is untouched by a sibling block: it sees only the default-marker pair, and tests pin that a file with only a lessons block still grades missing-block.
  • The canonical usage body is a named constant beside the contract clauses, self-tested. CANONICAL_WRITEBACK_BLOCK_BODY lives in src/core/brain/writeback-contract.ts next to WRITEBACK_CONTRACT_REQUIREMENTS (a constant is contract definition; the module stays write-free), merges the gate clauses with the cross-project-pointer usage content (read Brain/active.md at session start, brain_feedback, brain_apply_evidence, the do-not-dream rule), and a checker self-test asserts missingWritebackGateClauses(CANONICAL_WRITEBACK_BLOCK_BODY) is empty so the installer can never ship a non-conforming block. The body is fixed English instruction prose assembled as one constant - the posture the recovery prose already established; the checker matches structure (closed clause vocabularies), never prose, and no phrase list enters any matching path. The docblock's "NO INSTALLER LIVES HERE" becomes a pointer to the installer module and its obligations.
  • The installer step rides the existing consent lane, mapped from the precedence table over registered targets only. instructionBlockTargetFor(target) resolves HOST_INSTRUCTION_PRECEDENCE[target] (codex, cursor, opencode, aider to AGENTS.md; gemini-cli to GEMINI.md; targets without an entry, and the generic print-only target, skip the step by name in the plan). In runTarget (src/cli/install/install.ts) the step is appended to the rendered plan after adapter.plan and applied after adapter.apply under the SAME consent verdict - the operator consents once to a plan that shows both writes; no second consent vocabulary. INSTALL_STEP_KINDS gains nothing (the existing "managed-block" kind fits), INSTALL_TARGET_ID gains nothing, exit codes are the existing INSTALL_EXIT set.
  • Guarded apply is the protect.ts mould: preview binding, backup, hand-edit refusal. The apply re-derives exactly the approved before/after bytes and refuses by name on drift (approved binding); the first write is preceded by an exclusive-create, collision-laddered backup of the current file recorded in the result and the lock; a block whose extracted body diverges from the canonical one on a file newer than the lock's applied_at is a user-modified-block refusal (exit 4) unless --force, and the forced rewrite replacing a non-conforming body is the documented upgrade path for the docs-snippet manual installs (their one existing marker pair is diverged-from-canonical by construction, since the docs snippet predates the gate clauses). Symlinked instruction files are refused by name - the checker's read posture becomes the writer's posture, because a writer that follows a link has left the workspace.
  • Ownership is a lock file, never a manifest pseudo-target. instruction-block.lock.json under <vault>/.open-second-brain/ records schema version, applied_at, the files whose usage block Open Second Brain owns and the begin marker - the protect.lock.json shape, declared as a state surface. ManifestEntry.target stays typed InstallTargetId and the host-facts census stays an equality in both directions. o2b uninstall --target <host> --apply removes the pair the lock records; markers absent at uninstall are a named skip.
  • Vault root, not cwd. Hosts read instruction files at the project root, but the readiness probe audits the vault root and today the vault is the project for every host this tree installs; a cwd-targeting step would need new InstallEnv semantics, an OUT_OF_VAULT_STATE row and sweep attribution for no operator in this wave's motivating cases. The gemini-cli reading of GEMINI.md is name-implied (the precedence docblock carries the open question); the plan postNote says so rather than the code pretending certainty.
  • Lesson promotion is a conjunction, all required, all named. A lesson enters the block only when it is preference-derived (dead-ends never promote), confirmed (the filter computeLessons already applies), high confidence, preferred tier in the current digest, scoped to a member of the operator-declared lessons.promotion.scopes config list, and carrying a fresh approval: the approval row pins approved_content_hash equal to the preference's existing _content_hash, and a mismatch at render time drops the lesson from the block and reports it stale - the operator approved text, not an id. Absent or empty lessons.promotion.scopes disables promotion entirely with a named count in the candidates surface; there is no default scope list, because a default would be a hardcoded natural-language vocabulary deciding what counts as agent behavior. The block body is a deterministic render (ordering tier, then scope, then id - the digest's tie-break; no timestamps inside the block, they would defeat byte-idempotence) bounded by the existing lessons.limit config.
  • Approval is operator-only, recorded once, audited in the one log chain. o2b brain lessons approve <pref-id> and deny run the install consent ladder shape (plan-first, --apply executes, non-interactive refuses without --yes, verdict recorded as yes-flag/interactive-yes); the approve write goes through the shared writer and the ledger row is recorded only after a successful apply. The ledger is <vault>/.open-second-brain/lessons-approvals.json - the derived store, not Brain/, so an agent can neither read its own approval state nor social-engineer around it. Decisions append lessons-approved/lessons-denied/lessons-promoted log events through appendLogEvent, keeping one audit chain. Dream tail, hooks and MCP never write rules files and never approve: regenerateLessonsQuiet stays Brain/-scoped, and the standing-rules guarantee (no tool rewrites the operator's channel) is preserved by construction. MCP exposure is report-only counts through the existing status plumbing - no new mutating tool, so the visibility-surface registry gains no row.
  • The readiness probe grades the lessons block honestly. Beside the existing writeback_contract probe rows, a per-file lessons-block row (absent | current | drifted | stale-lessons) reports what promotion would and did do, so an operator who never runs refresh-blocks sees the staleness as a named finding rather than discovering stale text in the file. The instruction-file ceiling keeps counting both blocks - no exemption, because the ceiling reads the file an agent reads; the canonical usage body stays minimal and the lessons block is bounded by lessons.limit.
  • Benchmark task sets are structural, content-hashed and vault-side. Brain/skill-benchmarks/<skill>/tasks.json is the primary home (operator skills are vault-local and the vault is what syncs; the skills root itself may sit outside the vault); repo fixtures under tests/fixtures/skill-bench/ exist only for shipped-skill tests, mirroring tests/fixtures/decision-model/. A task is { id, kind, input, expects } over a closed kind vocabulary (invocation_transcript in this wave) and a closed check vocabulary (tool_used | artifact_created | step_order | forbidden_step | output_field) - every predicate names its check, a failure reports the check id, and there is no prose matching anywhere in the scorer. Validation is fail-fast with named errors in the parseBenchFixture style; the parsed set is hashed with sha256Hex(canonicalJson(...)) so a spec can freeze it.
  • The preregistration is the decision-model eval spec, generalized. spec.json beside the task set freezes the tasks hash, a seed, the hash-order split rule over dev/held-out membership (a receipt the runner verifies - verifyRewriteTake refuses a task set that no longer matches), the selection metric tasks_passed_rate, the required margin and the minimum dev n. The verdict vocabulary is the frozen three-arm promote | hold | not_enough_evidence the decision model already pinned: a candidate promotes only by strictly beating the baseline on dev by the margin with n met; a tie holds; a short dev n is its own arm, never a pass.
  • Rollouts are envelope-mediated; scoring never trusts the agent's self-assessment. One needs-llm-step envelope per dev task (step: "skill-rewrite-task") carries the candidate body and the task input; the calling agent (the CLI loop, exactly the page-candidates/page-draft flow) executes and submits a structured transcript plus produced artifacts; core validates the returned shape and scores the structural predicates. The agent's own success claim is never a scored input - the same posture that keeps procedural outcomes host-recorded. The held-out gate is a separate one-shot function, the only caller allowed to read held-out ids, run once on the candidate that earned promote; a held-out miss downgrades to hold; the envelope builder asserts every envelope task id is a dev member, so contamination is refused by construction rather than policed by review.
  • The mode flag is explicit and unknown values are errors. skill_rewrite.mode resolves gated (default, one candidate per round) or iterative (a bounded edit loop over dev tasks only, still gated before any write); an absent-key default is the one default the config resolver pattern allows, and an unknown value is a named error, never a silent fallback. The optional external judge rides runJsonCommandBridge under skill_rewrite_judge_cmd, fail-open and advisory, never moving the metric - the bench_judge_cmd contract verbatim.
  • The apply path is the proposal pipeline, extended in exactly one place. A promoted candidate stages as a pending proposal with a new scored_rewrite pattern kind carrying the scored contract fields (skill_name/skill_description/skill_triggers reuse plus rewrites_skill, spec_hash, baseline_score, candidate_score, heldout_score); acceptance stays the human step through acceptSkillProposal unchanged. Because a rewrite OVERWRITES an existing SKILL.md (today's materialize is overwrite: false, and evolveAcceptedProposal's overwrite merges frontmatter only), the accept journal gains priorContentPath: the prior bytes are copied under the journal directory before the overwrite, and rollback restores content, not just existence - the one growth the existing machinery needs, pinned in the accept dead-ends suite. The version bumps by the existing parseVersion + 1 evolve precedent. An operator reject is sticky for the skill name, which also suppresses re-proposing the same rewrite.
  • Evidence lands as an additive continuity kind, kept never-folded. skill_rewrite_eval_grade records per-round ids, scores and per-check verdicts with the spec hash - never task text, never transcript text - appended only after a completed gate run, added to the union and CONTINUITY_RECORD_KINDS in the same edit so an operator can audit why a rewrite landed. Gate failures stage nothing: hold and not_enough_evidence write only the grade record and leave the incumbent SKILL.md untouched.
  • ChatGPT desktop is an alias of the codex target, not a target. A new InstallTargetId for a file the codex adapter already owns would fork detect/plan/apply/verify for one config path and break the host-facts census equality for no behavioral difference. The codex adapter's detect() note names ChatGPT desktop as a reader of the same file when the codex binary is absent (the shared-config case); the README supported-clients table and install/codex.md name ChatGPT desktop with the codex install command. No plan/apply/verify behavior changes: same file, same payload, same drift vocabulary.

File changes

New:

  • src/core/install/rules-block.ts - the shared rules-block writer: RULES_BLOCK_ID (usage | lessons), per-id marker constants, renderRulesBlock, writeRulesBlock, removeRulesBlock, readRulesBlock, rulesBlockDrift, RulesBlockError (lane B).
  • src/core/install/instruction-block.ts - the installer lane: instructionBlockTargetFor, planInstructionBlock, applyInstructionBlock, uninstallInstructionBlock, instruction-block lock I/O (lane B).
  • src/core/brain/lessons-promotion.ts - the promotion kernel: qualification conjunction, deterministic block render, approvals ledger I/O, staleness derivation (lane C).
  • src/cli/brain/verbs/lessons.ts - cmdBrainLessons dispatching candidates | approve | deny | refresh-blocks (lane C).
  • src/core/brain/skill-rewrite-tasks.ts - task-set parse/validate/hash; closed kind and check vocabularies; pure leaf (lane A).
  • src/core/brain/skill-rewrite-spec.ts - preregistration, split receipt, take verification; pure leaf (lane A).
  • src/core/brain/skill-rewrite.ts - envelope builder, transcript validation and scoring, dev selection gate, held-out gate, mode resolution, grade-record assembly (lane A).
  • src/core/brain/doctor/lessons-block-check.ts - readiness rows for the lessons block per candidate file (lane C).
  • tests/fixtures/skill-bench/ - committed example task sets and spec for the suites (lane A).

Modified:

  • src/core/brain/writeback-contract.ts - CANONICAL_WRITEBACK_BLOCK_BODY constant, self-tested; docblock and recovery wording name the installer (lane B).
  • src/cli/install/install.ts - plan augmentation and the post-adapter instruction step in runTarget under the existing consent gate (lane B).
  • src/cli/install/uninstall-target.ts - the reverse step (lane B).
  • src/core/state/surfaces.ts - instruction-block.lock.json (lane B), lessons-approvals.json (lane C), the Brain/skill-benchmarks/ surface (lane A).
  • src/core/brain/lessons.ts consumers only via the new kernel; src/core/brain/policy/blocks/lessons.ts - lessons.promotion.scopes resolution (lane C).
  • src/core/brain/types.ts - lessons-approved/lessons-denied/lessons-promoted log event kinds (lane C).
  • src/core/brain/status.ts - approval counts in the snapshot (lane C).
  • src/core/brain/dream-refresh.ts, src/core/brain/dream.ts, hooks/ - read for guarantees only, untouched; no lane adds rules-file writes to them.
  • src/core/brain/skill-proposals.ts - scored_rewrite pattern kind, scored contract fields, journal prior-content capture and content-restoring rollback (lane A).
  • src/core/brain/skill-accept-journal.ts - priorContentPath field and parse (lane A).
  • src/core/brain/continuity/types.ts - additive skill_rewrite_eval_grade kind (lane A).
  • src/core/brain/paths.ts - benchmark and journal-copy paths (lane A).
  • src/core/config.ts - skill_rewrite.mode, skill_rewrite_judge_cmd (lane A); lessons.promotion.scopes (lane C).
  • src/cli/brain/verbs/skill-proposals.ts - rewrite-plan and rewrite-score subcommands (lane A).
  • src/mcp/brain/procedure-tools.ts - read-only rewrite status (lane A).
  • src/core/install/adapters/codex.ts - detect note naming ChatGPT desktop when the binary is absent (lane D).
  • README.md supported-clients row, install/codex.md section (lane D).
  • docs/cli-reference.md - rows for the new verbs and subcommands (each lane appends its own; the integrator reconciles).

Risks and open questions

  • Two blocks in one file is a new shape for the audit. The checker was specified for one default-marker pair; a sibling HTML-comment pair is inert to it by construction, but the interaction tests (lessons-only file, both-blocks file, forced upgrade of a docs-snippet file) are load-bearing and pin the checker's behavior unchanged. If a future contract change ever needs to see the lessons block, that is a new clause vocabulary, not a marker reuse.
  • Rules files enter the vault's own read surfaces. A created AGENTS.md becomes visible to the removed-tool sweep, the instruction ceiling and the note indexer; all three already read these files, the step is plan-visible and consent-covered, and the plan postNote names it. The ceiling counts the added lines honestly; an operator with a large own-content file sees the existing warning.
  • Partial failure between adapter apply and instruction step. The instruction step is last; a failure exits non-zero with the adapter write committed, and re-running o2b install --target <host> --apply converges because every step is idempotent. Stated in the plan render rather than hidden.
  • Self-reported rollouts can game the metric. Mitigation is structural: only typed predicates over returned artifacts and validated transcripts score; the agent's own success claim never does; per-check outcomes land in the grade record so a rewrite that wins by dropping checks is visible. Residual risk accepted and named: a determined caller can fabricate transcripts, and the gate is honest about defending against regression, not against a hostile optimizer operator - the human accept is the boundary.
  • Held-out contamination in iterative mode. The envelope builder asserts dev membership and the held-out gate is the only held-out reader, but a future contributor could add a second reader; the assertion tests and the grade-record shape (which would show held-out ids in dev envelopes) are the tripwires.
  • The journal prior-content copy is bounded but new. One SKILL.md per accept attempt under the journal directory; cleanup rides the existing journal-clear path. A crash between backup and overwrite leaves a recoverable journal - exactly the case the extension exists for, pinned in the dead-ends suite.
  • Approval freshness couples the ledger to the content hash discipline. The hash is observability-not-enforcement upstream; promotion makes it enforcement for one narrow decision (block membership). The stale lesson is dropped and reported, never silently kept, and re-approval is one verb - but operators must understand that hand-editing a confirmed preference now silently unpromotes it on the next refresh. Docs say so.
  • gemini-cli delivery is name-implied. The precedence table's own docblock carries the open question; both lanes write GEMINI.md per the declared table with the plan postNote, and neither claims more than "file written".
  • Census overhead. The wave touches registries that fail loudly on unregistered newcomers (write-site, destructive-site, state-surface, verdict-vocabulary, visibility-surface, claim-attribution, append-shard, continuity reader census, host-facts, import-cycles, layering); every lane lands its registrations with the code that trips them, never retrofitted.
  • Open: whether install should also offer the lessons block. The two producers share a writer but keep separate lifecycles and separate consent surfaces this wave; an o2b install --refresh-blocks alias that re-renders both is a follow-up decision to make on operator usage, not on taste.