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.
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/brainandsrc/core/surfacereturns nothing; the dream pass plans only preference retires (PlanState.retires,src/core/brain/dream-plan.ts:214) and never touches skill files; theskill-usage.tsdocblock's "rank, retain, or retire" is aspiration, not implementation. The machinery to reuse is exactly where the recon says:acceptSkillProposalatsrc/core/brain/skill-proposals.ts:766with the archive/materialize/commit journal phases,SkillAcceptLockedErrorat :975, materialize writesoverwrite: false(:868 for the skills root, which passes novaultForRelativePath), the preregistration discipline insrc/core/decision-model/eval-spec.ts(hash-order-30-70at :41, thepromote | hold | not_enough_evidencethree-arm verdict at :56),parseBenchFixtureatsrc/core/bench/fixture.ts:42,NEEDS_LLM_STEP/buildNeedsLlmStepinsrc/core/brain/llm-step.ts, config keys atsrc/core/config.ts:733/:806/:1887, and the census rows attests/core/architecture/write-site-census.test.ts:744/:1109. Corrections:buildNeedsLlmStepis atllm-step.ts:85(recon said :67); and the accept journal records existence flags only (acceptedExisted,materializedExisted) - no prior-content copy - whileevolveAcceptedProposal(skill-proposals.ts:1393) already overwrites an accepted skill's frontmatter withoverwrite: 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_FILESat :98,HOST_INSTRUCTION_PRECEDENCEat :137,WRITEBACK_CONTRACT_REQUIREMENTSthree clauses,missingWritebackGateClausespure); the managed-block editor exists (src/core/install/managed-block.ts, idempotentinsertManagedBlock,validateMarkersrefusing multiple/unpaired/reversed markers); the install consent ladder is fail-closed (src/cli/install/install.ts:415-462, exit 6 without--yesheadless); 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_STATUSis the closed tripleunconfirmed | confirmed | quarantine(src/core/brain/types.ts:89), promotion is automatic at the dream refresh (thefirstAppliedbranch,dream-refresh.ts:269), and the operator acts only after the fact (reject,pin). The lessons digest is derived (computeLessons,LESSON_TIERatlessons.ts:73, idempotentregenerateLessonsat :470), content-hash pinning exists and is observability-not-enforcement (content-hash.ts), the write-approval lane family is inbound-only (write-gate.ts, lanessignals | notes | ingest), and no rules file is ever written by this tree today. Noo2b brain lessonsverb family exists. Trivial drift:HOST_INSTRUCTION_PRECEDENCEis 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/orREADME.md; the codex adapter (src/core/install/adapters/codex.ts) is subprocess-driven with the$CODEX_HOME/config.tomlTOML-merge fallback,detect()keys the note onBun.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 bytests/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 newInstallTargetId.
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 ino2b installthat 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 (oneneeds-llm-stepper 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/rulesor any out-of-vault rules-file target: it would drag anOUT_OF_VAULT_STATErow 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,
--applyexecutes, headless refuses without--yes, verdict recorded,--forcethe 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 throughacceptSkillProposalwith 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,
RulesBlockErrorkinds, 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.tsis the only code that moves a rules-file block:renderRulesBlock,writeRulesBlock,removeRulesBlock,readRulesBlockandrulesBlockDrift, all parametrised by a closedRULES_BLOCK_IDpair (usage | lessons). The installer and the lessons verbs call it; neither forks the editor. The writer wrapsinsertManagedBlock/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_MARKERand grades it against the three gate clauses; those spellings are contract, not style.validateMarkersrefuses 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 gradesmissing-block. - The canonical usage body is a named constant beside the contract clauses, self-tested.
CANONICAL_WRITEBACK_BLOCK_BODYlives insrc/core/brain/writeback-contract.tsnext toWRITEBACK_CONTRACT_REQUIREMENTS(a constant is contract definition; the module stays write-free), merges the gate clauses with the cross-project-pointer usage content (readBrain/active.mdat session start,brain_feedback,brain_apply_evidence, the do-not-dream rule), and a checker self-test assertsmissingWritebackGateClauses(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)resolvesHOST_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). InrunTarget(src/cli/install/install.ts) the step is appended to the rendered plan afteradapter.planand applied afteradapter.applyunder the SAME consent verdict - the operator consents once to a plan that shows both writes; no second consent vocabulary.INSTALL_STEP_KINDSgains nothing (the existing"managed-block"kind fits),INSTALL_TARGET_IDgains nothing, exit codes are the existingINSTALL_EXITset. - 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 (
approvedbinding); 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'sapplied_atis auser-modified-blockrefusal (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.jsonunder<vault>/.open-second-brain/records schema version, applied_at, the files whose usage block Open Second Brain owns and the begin marker - theprotect.lock.jsonshape, declared as a state surface.ManifestEntry.targetstays typedInstallTargetIdand the host-facts census stays an equality in both directions.o2b uninstall --target <host> --applyremoves 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
InstallEnvsemantics, anOUT_OF_VAULT_STATErow 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 filtercomputeLessonsalready applies),highconfidence,preferredtier in the current digest, scoped to a member of the operator-declaredlessons.promotion.scopesconfig list, and carrying a fresh approval: the approval row pinsapproved_content_hashequal 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 emptylessons.promotion.scopesdisables 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 existinglessons.limitconfig. - Approval is operator-only, recorded once, audited in the one log chain.
o2b brain lessons approve <pref-id>anddenyrun the install consent ladder shape (plan-first,--applyexecutes, non-interactive refuses without--yes, verdict recorded asyes-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, notBrain/, so an agent can neither read its own approval state nor social-engineer around it. Decisions appendlessons-approved/lessons-denied/lessons-promotedlog events throughappendLogEvent, keeping one audit chain. Dream tail, hooks and MCP never write rules files and never approve:regenerateLessonsQuietstaysBrain/-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_contractprobe rows, a per-file lessons-block row (absent | current | drifted | stale-lessons) reports what promotion would and did do, so an operator who never runsrefresh-blockssees 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 bylessons.limit. - Benchmark task sets are structural, content-hashed and vault-side.
Brain/skill-benchmarks/<skill>/tasks.jsonis 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 undertests/fixtures/skill-bench/exist only for shipped-skill tests, mirroringtests/fixtures/decision-model/. A task is{ id, kind, input, expects }over a closed kind vocabulary (invocation_transcriptin 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 theparseBenchFixturestyle; the parsed set is hashed withsha256Hex(canonicalJson(...))so a spec can freeze it. - The preregistration is the decision-model eval spec, generalized.
spec.jsonbeside the task set freezes the tasks hash, a seed, thehash-ordersplit rule over dev/held-out membership (a receipt the runner verifies -verifyRewriteTakerefuses a task set that no longer matches), the selection metrictasks_passed_rate, the required margin and the minimum dev n. The verdict vocabulary is the frozen three-armpromote | hold | not_enough_evidencethe 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-stepenvelope per dev task (step: "skill-rewrite-task") carries the candidate body and the task input; the calling agent (the CLI loop, exactly thepage-candidates/page-draftflow) 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 earnedpromote; a held-out miss downgrades tohold; 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.moderesolvesgated(default, one candidate per round) oriterative(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 ridesrunJsonCommandBridgeunderskill_rewrite_judge_cmd, fail-open and advisory, never moving the metric - thebench_judge_cmdcontract 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_rewritepattern kind carrying the scored contract fields (skill_name/skill_description/skill_triggersreuse plusrewrites_skill,spec_hash,baseline_score,candidate_score,heldout_score); acceptance stays the human step throughacceptSkillProposalunchanged. Because a rewrite OVERWRITES an existing SKILL.md (today's materialize isoverwrite: false, andevolveAcceptedProposal's overwrite merges frontmatter only), the accept journal gainspriorContentPath: 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 existingparseVersion + 1evolve 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_graderecords 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 andCONTINUITY_RECORD_KINDSin the same edit so an operator can audit why a rewrite landed. Gate failures stage nothing:holdandnot_enough_evidencewrite 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
InstallTargetIdfor 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'sdetect()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 andinstall/codex.mdname 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-cmdBrainLessonsdispatchingcandidates | 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_BODYconstant, self-tested; docblock and recovery wording name the installer (lane B).src/cli/install/install.ts- plan augmentation and the post-adapter instruction step inrunTargetunder 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), theBrain/skill-benchmarks/surface (lane A).src/core/brain/lessons.tsconsumers only via the new kernel;src/core/brain/policy/blocks/lessons.ts-lessons.promotion.scopesresolution (lane C).src/core/brain/types.ts-lessons-approved/lessons-denied/lessons-promotedlog 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_rewritepattern kind, scored contract fields, journal prior-content capture and content-restoring rollback (lane A).src/core/brain/skill-accept-journal.ts-priorContentPathfield and parse (lane A).src/core/brain/continuity/types.ts- additiveskill_rewrite_eval_gradekind (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-planandrewrite-scoresubcommands (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.mdsupported-clients row,install/codex.mdsection (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> --applyconverges 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-blocksalias that re-renders both is a follow-up decision to make on operator usage, not on taste.