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
28.4 KB
Raw Blame

Trust and responsiveness hardening - write-time marker neutralization, gitignore guardrails, shadowed instruction detection and parallel MCP reads

Status: draft Author: ZCode orchestrator (via feature-release-playbook) Audience: implementation

Problem statement

Open Second Brain defends third-party text at read time (the model-payload neutralizer), at ingest trust (quarantine plus staged review) and by containment fencing in derived sections - but nothing neutralizes structure-bearing markdown at the moment third-party text is written into the vault. A captured or ingested body can plant wikilinks, @osb markers, ```osb blocks or semantic headings that the link graph, the marker scanners and the section parsers then treat as the vault's own structure. Derived runtime state under .open-second-brain/ is treated as ignore-worthy by the vault scope but nothing seeds a git-side guard, so a fresh o2b brain init in a git repository leaves brain.sqlite and friends visible to git status, and no doctor row fails an operator who has already committed that state. The doctor readiness probe audits each agent instruction file in isolation, so a workspace where Claude Code reads a bare CLAUDE.md while the write-back contract lives in AGENTS.md passes every row while the operative host never sees the contract. And the stdio MCP transport serves requests strictly one at a time even though the server dispatch and the HTTP transport are already re-entrant, so one slow read head-of-line blocks every later request.

Premise verification

Verdicts from targeted reads against this tree at 88c118aa, recording the corrections from the four recon reports. The recons were premise-verified against live source; the corrections below are binding for the plan.

  • t_00b617b6 — premise_corrected (anchor). probeWritebackContract is NOT under src/core/brain/ - the card's src/core/brain/doctor-readiness.ts does not exist. It is at src/core/doctor-readiness.ts:1742 (line 1738 falls inside its docblock), registered in DEFAULT_PROBES at :1807. The candidate list anchor is correct: AGENT_INSTRUCTION_FILES at src/core/brain/writeback-contract.ts:72, frozen, AGENTS.md first.
  • t_90409204 — premise_corrected (anchors). src/mcp/stdio.ts:258-262 is inside serveStdioFromString (the synchronous in-memory test-harness loop, stdio.ts:219-268), not the production loop. Production is serveStdio (stdio.ts:82), sequential only because each request is awaited inside the for await body. There is no src/mcp/lifecycle.ts; the intended anchor is src/core/search/store/lifecycle.ts:434-438 (openReadDatabase: no lock, no migration). store.ts:158 is private closed = false, not a mode flag; the live facts are StoreOpenOptions.mode (store.ts:117-122) and lifecycle.ts:434-438.
  • t_c2ac4fc8 — premise_confirmed with two scope facts. No write-time neutralizer exists today (defense is read-time neutralizeUntrustedText at src/core/brain/untrusted-source.ts:85-90, the ingest trust lane, and containment fencing). No GFM tasklist parser exists anywhere in src/core - the card's "task rows" resolve to the log-row grammar and @osb markers; render/activity-line.ts:47-50 is render-only. The design proceeds with task checkboxes OUT of the neutralization set (decision below).
  • t_206562ae — premise_confirmed with a docs correction. bootstrapBrain is at src/core/brain/init.ts:318; the crypto invariant docblock is at src/core/brain/secrets/crypto.ts:62-66 ("Nothing in src ever writes a .gitignore elsewhere"). The docs claiming the bench runs dir is "(gitignored)" are stale - docs/observability.md:18 and docs/cli-reference.md:584 state it but nothing in src seeds it; both are reworded in this wave.
  • Verified live, load-bearing for lane D. The tools/list projection (handleToolsList, src/mcp/server.ts:484-494) picks fields explicitly (name, description, inputSchema, optional outputSchema), so a new metadata field on ToolDefinition structurally cannot reach the wire; a test pins this. tests/core/brain.init.test.ts:64-67 pins created.length at 7 and is updated deliberately. The three instruction-file lists are divergent as reported: writeback-contract.ts:72 (AGENTS.md first), src/core/brain/trust/instruction-file-ceiling.ts:22 (CLAUDE.md first, includes GEMINI.md), src/core/brain/doctor/removed-tool-checks.ts:43 (CLAUDE.md first, no GEMINI.md).
  • Verified live, load-bearing for lanes A and B. SEARCH_TRUST_GATE_MODE (src/core/brain/trust/retrieval-gate.ts:79-97) is the gate-mode precedent including resolveSearchTrustGateMode (:115) with env-over-config and invalid-value refusal naming the key; the gate key is a plain string-keyed config record, not a policy block. privacyMarkerCheck (src/core/brain/doctor/privacy-marker-check.ts:34-61) is the counting-check pattern: pure planner module, one warning, NAMED_PATH_LIMIT = 5, ctx.readable filter, failSoft: true, code classified in DOCTOR_EXIT_EXCLUSIONS (doctor-exits.ts:152). check-ignore exit discipline and the worktree ls-files rule are documented in src/core/brain/vault-dirty.ts (:10-15, :37-42, :77-126).

Scope

  • Lane A (t_c2ac4fc8): a pure write-time neutralizer for structure-bearing markdown on third-party bodies, applied at the capture seam and the ingest review gate; a gate with off|shadow|enforce modes (default off); a read-only doctor audit (planted-structure-rows warning) over already-planted rows, sharing one detection grammar with the neutralizer - the audit population split by family: the marker and osb-fence families scan every readable page under Brain/ (no Brain writer ever emits a live marker line or osb fence, so one anywhere in the derived layer is planted), while the wikilink and heading families scan only the third-party provenance lanes (captures, untrusted-stamped pages, quarantined entities, source summaries), and on both populations the sections the Brain's own writers render (a capture's marker-authorized ## Guidance, a source summary's ## Sources/## Premises/link and derivation sections) are excluded as the vault's own output.
  • Lane B (t_206562ae): a seeded, merge-safe .gitignore managed block at o2b brain init covering <vault>/.open-second-brain/; a doctor row that FAILs when derived runtime state is already tracked by git; the crypto.ts invariant docblock updated; the stale "(gitignored)" doc claims reworded.
  • Lane C (t_00b617b6): host instruction precedence constants beside AGENT_INSTRUCTION_FILES; a pure shadow resolver over the per-candidate audits; the readiness probe gains a fail finding when the file a host reads is not the file carrying the write-back contract, with a read-only recovery clause; a docblock sweep of the three divergent lists.
  • Lane D (t_90409204): a required read | write classification on every tool definition; the stdio production loop dispatches reads concurrently under a small cap while writes stay exclusive behind a dispatch-level gate; EOF and drain always await the in-flight set; tools/list wire output stays byte-identical.
  • Integrator: reconciliation of the shared append-only registries, docs and CHANGELOG; full local gates.

Out of scope

  • Deleting or rewriting already-planted rows: the doctor audit is read-only; remediation is re-capture or a later repair pass.
  • Neutralizing vault-authored structure: renderProvenanceSection / renderLinkSection output, renderer-written ## Guidance headings, Brain/_BRAIN.md, log files the writers themselves emit.
  • Tier B Brain/ derived content (.snapshots, .artifacts, .state, .archives, .payloads, claim-graph.json, rollups): stays un-gitignored. Brain/ is user-visible vault content by design; excluding inside the knowledge tree is an operator choice, recorded here as the boundary.
  • Parent-directory and user-level instruction surfaces (~/.claude/CLAUDE.md, CLAUDE.local.md, ~/.codex/AGENTS.md, context.fileName overrides, parent-dir traversal): the probe stays at join(opts.vault, name); documented limitation, follow-up territory.
  • The instruction-file installer (sibling card t_af5e252f): lane C ships detection and constants only, shaped so the installer can share HOST_INSTRUCTION_PRECEDENCE.
  • Uninstall handling for the seeded gitignore block: deliberate keep (the derived state exists as long as the vault does); not wired into any remove path.
  • HTTP transport changes (already concurrent), core writer-lock semantics (search store writer-lock, sync-lockfile), and serveStdioFromString (stays sequential; comment rewritten only).
  • GFM task-checkbox neutralization (no parser exists), and write-time escaping of markdown links, reference definitions and tags (decision below; the doctor audit observes them).
  • Changes to WRITER_TOOL_NAMES, the MCP tools-advertising set, or any wire-visible schema.

Chosen approach

Per-feature parallel lanes with an append-only shared-registry protocol (Variant 1 in variants.md). The wave splits into four lanes with disjoint file ownership - marker escaping (A), gitignore guardrails (B), shadowed instruction detection (C), stdio read parallelism (D) - plus one integrator. The shared substrate already exists in this tree (the frozen DOCTOR_CHECKS registry, the managed-block merger, RequestDrain's N-in-flight register, the SEARCH_TRUST_GATE_MODE gate pattern), so no lane builds infrastructure first; the only shared surfaces are four append-only files whose edits are textual merges, plus docs and CHANGELOG appended last in each lane's own commit and reconciled by the integrator. Lane decisions per area are in Design decisions; the variant comparison and why substrate-first and integration-heavy lost are in variants.md.

Design decisions

  • Marker-escape set: structure only, four families, never vocabulary. The neutralizer keys on grammar a parser consumes, never on words. Families: (1) wikilinks - [[target]] and [[target|alias]], detected with the wikilink.ts regex family (WIKILINK_TARGET_RE:59 through EXACT:80); (2) @osb inline markers and ```osb fenced blocks, per inline.ts (REQUIRED_FIELDS:69, KNOWN_KINDS:96, discoverMarkers:914); (3) ATX headings, which covers the semantic headings (## Sources, ## Premises, ## Parts, ## Table, ## Guidance) and log headings; (4) log/timeline rows, whose grammar is headed by ## <HH:MM:SS>Z - <event-kind> (log.ts:1-20) - escaping the heading breaks the day-file parse, so the bullet rows ride along without separate treatment. Task checkboxes are excluded: no parser consumes GFM tasklists in this tree (recon §2). Markdown links, reference definitions and tags are excluded from write-time escaping this wave - they are additive index noise, and bracket/# escaping in quoted prose has the worst legibility cost per byte; the doctor audit observes them so the follow-up decision is made on data, not on taste.
  • Escaping choice per family: backslash-escape the sigils, never delete, never invisible characters. One uniform mechanism: for each detector match span, backslash-escape the minimal sigil characters (brackets in wikilinks, @ in inline markers, backticks on fence lines, the leading # run on headings). CommonMark renders a backslash before ASCII punctuation as the literal character, so captured text stays readable verbatim, while every line-grammar detector in src/core stops matching (\@osb no longer anchors, \#\# is not an ATX heading, escaped backticks cannot open a fence, \[[x\]] is not a wikilink). Escaped ```osb fence lines break the block as a unit; interior key: value field lines carry no independent sigils. HTML-entity escapes are rejected: &lt;-style encoding does not neutralize [[...]] for markdown readers (recon risk 7).
  • Fence-awareness and idempotence doctrine. Detection is fence-masked per family, each family answering to the fence model its own readers run, because the grammars disagree about what a fence even is: the marker families fence with inline.ts's exactly-3-backtick walk (a tilde or 4-backtick fence fences nothing for them, and an unterminated fence masks the rest of the text), the heading family reuses the source-links.ts fencedLineMask shape where only a closed fence is a fence, and the wikilink family reuses wikilink.ts codeRegions (fences and inline code inert). Fence lines themselves are boundaries, not masked content. Idempotence by fixpoint, not by construction alone: the detectors are escape-aware (a sigil preceded by an odd backslash run is data, not structure), but escaping a fence line dissolves the fence and can expose interior text, so the neutralizer re-detects its own output in a bounded walk (NEUTRALIZE_FIXPOINT_STEPS) whose exit - the output's own detection coming back empty - is the doctrine's neutralize(neutralize(x)) === neutralize(x); a bound exhausted with live structure still detected throws MarkdownNeutralizeFixpointError instead of returning the bytes it exists to neutralize. Regexes stay single-pass and non-backtracking. The neutralizer never opens new fences and never rewrites on-disk bodies after the fact.
  • One detection grammar, two consumers. The auditor and the neutralizer share the detection layer in neutralize-markdown.ts: the writer escapes the spans, the doctor planner counts them. The finding, its count and what enforce mode would change cannot drift apart - the planPrivacyMarkerRestamp pattern (planner module + one counting check).
  • Gate mode off/shadow/enforce. MARKDOWN_NEUTRALIZE_MODE (off | shadow | enforce), machine-config key markdown_neutralize_mode, env twin OPEN_SECOND_BRAIN_MARKDOWN_NEUTRALIZE_MODE, default off, env wins, invalid values refused by name - the resolveSearchTrustGateMode shape (retrieval-gate.ts:115-141) with no legacy boolean. Off: the helper is not invoked; byte-identity asserted end to end at both seams. Shadow: byte-identical to off at every seam - no seam-side detection runs at all (a shadow call would compute an answer nobody consumes) - and the preview is the doctor's planted-structure-rows finding, whose audit recomputes the would-be rows from the vault's bytes on its own and switches only its wording under the mode. Enforce: the seams write neutralized bytes. Neutralization keys off provenance, not content: it applies in the third-party lanes only (capture, untrusted ingest), never to vault-authored sections appended after caller text.
  • Record escaping when it happened, zero bytes when it did not. When enforce-mode neutralization changed bytes, the page's frontmatter gains a conditional key naming the neutralized kinds - the untrustedSourceFrontmatter conditional-spread precedent (trust/untrusted-provenance.ts:88-90); unchanged bodies gain zero bytes. captureBaseId (capture-note.ts:167-175) hashes the persisted post-neutralize body, so identity follows what is actually on disk; a gate flip legitimately changes identity, and that is documented behavior, not an accident.
  • .gitignore: managed-block merge, never a blind append. gitignore-guard.ts seeds a managed block (install/managed-block.ts markers; insertManagedBlock :105-132 is idempotent and CRLF-safe) whose entry list starts as exactly one vault-root-anchored line, /.open-second-brain/ - one entry covers every Tier A writer (brain.sqlite, hook-audit, secrets, maintenance sqlite and journals, ingest checkpoints, dead-letters, session ledgers, watchdog fallback, self-heal state, locks, bench-runs). Exact-line membership is checked first, so a user who already ignores the path yields a skip, not a duplicate. A vault with no .gitignore gets one created; markers present but malformed surface as a named conflict (validateMarkers posture) with warn-and-continue, and the doctor row reports the unprotected state. The seeder never shells out to git; git is asked only by the doctor probe. The vault-scope asymmetry closes: .open-second-brain is already in DEFAULT_VAULT_IGNORE_PATHS (vault-scope/defaults.ts:75); the git side now matches.
  • crypto.ts invariant update, secrets marker kept. The docblock invariant at crypto.ts:62-66 ("Nothing in src ever writes a .gitignore elsewhere") is reworded to name the three sanctioned writers: the secrets sync-exclusion marker (kept - the secrets dir can pre-date brain init), the vault-level managed block seeded by ensureVaultGitignoreEntries in gitignore-guard.ts, and ensureBackupRootIgnored in trust.ts, which writes its own .gitignore into the .o2b-backups/ root - so the invariant was already false before this wave, and the reworded docblock says so rather than crediting the wave with breaking it. The comment is updated in the same commit that adds the managed-block writer, not after.
  • Tracked-vs-ignored: ls-files for tracking, check-ignore for ignoring, never git status. The doctor probe measures tracking with git ls-files -z -- <path> run vault-bounded (-C, fixed argv, no shell - the vault-dirty.ts :78-126 posture): in a linked worktree git status omits ignored files, so only ls-files answers "is this committed". Ignoring is measured with check-ignore exit discipline (0 = ignored, 1 = not, other = refuse to say). Fail-soft throughout: not a worktree, directory absent, or git unable to answer means silence or an unknown - the doctor never throws. Findings: any tracked path is severity error naming git rm -r --cached <path> per path (named-path cap) plus the exact missing ignore line; present-but-unignored and untracked is severity warning (the only signal a vault whose init ran without git ever gets). The error code registers in DIAGNOSTIC_SIGNALS with nextCommand "o2b brain init" - the seeder is idempotent and merge-safe, so one command remediates the ignore half by seeding the missing /.open-second-brain/ line, while a path git already tracks still needs the operator's git rm -r --cached, which the finding names per path - keeping the exit census green.
  • Host-instruction precedence constants; the three divergent lists are documented, not unified. HOST_INSTRUCTION_PRECEDENCE (host to ordered instruction files: claude-code reads CLAUDE.md; codex, cursor, opencode, aider read AGENTS.md; gemini-cli reads GEMINI.md) is exported beside AGENT_INSTRUCTION_FILES in writeback-contract.ts so the probe and the future t_af5e252f installer share one definition; its docblock cites docs/cross-project-pointer.md:13-17 and marks which entries are repo-cited versus name-implied. The three existing lists keep their shapes: the ceiling's TRACKED_FILES and removed-tool-checks' ROOT_INSTRUCTION_FILES are existence-loop lists, not precedence orders, and unifying them could change behavior (whether ROOT_INSTRUCTION_FILES deliberately omits GEMINI.md is an open question); lane C adds docblocks stating order rationale and cross-references so no fourth divergent list appears. Shadow detection keys on candidate co-existence, not the install manifest - there is no claude-code install target, so "which host" cannot be derived from manifests for the most important case.
  • Shadowing semantics: pure resolver, fail severity, read-only recovery clause. Over the per-candidate audits, a host is shadowed when its preferred existing candidate (first in precedence order that exists) lacks the managed block while another candidate carries it (block present in any state: conforming, malformed-block, missing-clauses). Absent-only workspaces stay skipped ("nothing installed is not a contract violation"); shadow-free multi-file workspaces keep passing. A shadow finding grades fail in probeWritebackContract, its detail naming the host, the file the host reads and the file carrying the contract, with an embedded recovery clause following WRITEBACK_CONTRACT_RECOVERY phrasing (read-only: the probe never writes or offers a command that does; block surgery is content-editing, so no fake o2b command). Symlinked candidates stay refused evidence (symlink to unknown) - reading link targets to admit the common AGENTS.md -> CLAUDE.md dotfiles setup is a deliberate deferral, recorded as a limitation.
  • Read/write classification: required on the definition, write-mode-dominant, settled by an audit. ToolDefinition gains a required readonly kind: "read" | "write" (tool-contract.ts:207; distinct from the host-facts ToolCeilingKind.kind on its own interface). Populated per slice at the aggregation seams, not inferred: nothing canonical exists today (WRITER_TOOL_NAMES is an advertising set that even includes a reader; description prose is not a contract). Rule: a tool that CAN write is write - the dual-mode tools (brain_watchdog remediate, brain_lifecycle apply, brain_dream, brain_receipts fold) are write, while brain_retention and brain_review_candidates ship as read (parity-pinned: their planners are recommendation-only, the dream leg a dry run, and their own descriptions promise no mutation). No args parsing at dispatch, ever. A registry-guard-style walk fails the build when any registered tool lacks the field, and the partition is pinned beside FROZEN_BRAIN_TOOL_NAMES in the parity test. Dispatch treats a missing kind as write (fail-closed) for hand-built definitions. The field is metadata: the tools/list projection picks its fields explicitly (server.ts:484-494), so the wire output stays byte-identical, asserted by a test.
  • Parallel reads behind a bounded cap, exclusive writes at dispatch only. The stdio production loop dispatches read-classified requests without awaiting them, up to a named read-concurrency cap (constant, default 4); when the cap is reached the loop backpressures by awaiting a slot before reading further lines, so in-flight count is bounded by construction. Writes serialize through an in-loop async mutex at dispatch ONLY - never a lock inside core handlers, where re-entrant writers (brain_write_batch composing note kernels) would self-block. Classification is a server helper over findTool (non-tools/call methods are reads). Responses are written inside their own drain begin/finish window, preserving per-request adjacency (all of request K's notifications before response K); frames stay single-write atomic; out-of-order arrival is JSON-RPC-legal; cross-request progress interleaving is surrendered (clients correlate by progress token) and the progress-refusal envelope still holds - documented behavior change. serveStdioFromString stays sequential; its comment (:258-262) is rewritten to say the harness loop is sequential for positional assertions, not because the transport is.
  • EOF must await the in-flight set. With parallel dispatch, loop exit becomes a real requirement rather than a structural accident: EOF, a drain break (:134), and rl.close() (:122-124) all resolve only after every dispatched request settles (drain.drain already waits the whole register). Without this, exit hooks - the search store WAL checkpoint and the sync-lockfile unlink - would run under floating handlers. Reads never take retrying locks: acquireLockSyncWithRetry's Bun.sleepSync can block the thread up to ~5s, which under parallel reads would stall every in-flight request, so the read path adds no locking and the telemetry ELOCKED fail-open loss stays accepted.

File changes

New:

  • src/core/brain/text/neutralize-markdown.ts - the pure neutralizer, its gate constants (MARKDOWN_NEUTRALIZE_MODE, config key, env twin, resolver) and the shared escape-aware detection grammar (lane A).
  • src/core/brain/planted-rows.ts - pure audit planner over the shared detectors (lane A).
  • src/core/brain/doctor/planted-rows-check.ts - the counting check, failSoft, named-path cap (lane A).
  • src/core/brain/gitignore-guard.ts - managed-block seeder/merger for the vault .gitignore (lane B).
  • src/core/brain/doctor/git-tracked-state-check.ts - the ls-files/check-ignore probe (lane B).
  • tests/core/brain/text/neutralize-markdown.test.ts, tests/core/brain/ingest/ingest-marker-neutralize.test.ts, tests/core/brain/doctor/planted-rows-check.test.ts (lane A); tests/core/brain/gitignore-guard.test.ts, tests/core/brain/doctor/git-tracked-state-check.test.ts (lane B); tests/mcp/stdio-parallel.test.ts (lane D).

Modified:

  • src/core/brain/capture/capture-note.ts - neutralize caller text before renderCaptureBody; conditional provenance key; id-hash note (lane A).
  • src/core/brain/ingest/ingest.ts - neutralize input.summary at body assembly (:449-457) per gate mode; same bytes stage and publish (lane A).
  • src/core/brain/init.ts - bootstrapBrain gains the gitignore step, reported via created/skipped (lane B).
  • src/core/brain/secrets/crypto.ts - invariant docblock reworded (lane B).
  • src/core/brain/path-constants.ts, src/cli/brain/verbs/bench.ts - bench runs dir hoisted to a named constant (lane B).
  • src/core/brain/writeback-contract.ts - HOST_INSTRUCTION_PRECEDENCE, the pure shadow resolver, docblock (lane C).
  • src/core/doctor-readiness.ts - probeWritebackContract grades shadow findings (lane C).
  • src/core/brain/trust/instruction-file-ceiling.ts, src/core/brain/doctor/removed-tool-checks.ts - docblock-only sweep (lane C).
  • src/mcp/tool-contract.ts - kind on ToolDefinition; src/mcp/tools.ts and every slice (src/mcp/brain/*-tools.ts, search-tools.ts, schema-tools.ts, skill-tools.ts, wiring-tools.ts, watchdog-tools.ts, hydrate-tool.ts) - per-tool classification (lane D).
  • src/mcp/server.ts - the write-classifier helper over findTool (lane D).
  • src/mcp/stdio.ts - parallel read dispatch, exclusive write gate, in-flight-set EOF, comment rewrites (:13 module docblock, :258-262) (lane D).

Shared, append-only (protocol in plan.md):

  • src/core/brain/doctor.ts - lane A registers plantedRowsCheck after privacyMarkerCheck; lane B registers gitTrackedStateCheck after secretsSyncExposureCheck.
  • src/core/brain/doctor-exits.ts - lane A classifies planted-structure-rows.
  • src/core/brain/diagnostics.ts - lane B classifies the tracked-state code with nextCommand "o2b brain init".
  • tests/core/brain/doctor-exit-census.test.ts, tests/core/brain/doctor.test.ts, tests/core/brain.doctor.test.ts - extended only by the lane that added the code/entry.
  • docs/observability.md, docs/cli-reference.md, docs/mcp.md, CHANGELOG.md - each lane appends its own rows in its final lane commit; the integrator reconciles.

Risks and open questions

  • Mangling legitimate quoted markdown. People quote documents, which is why ## Guidance exists (capture-note.ts:185-191). Mitigations: gate default off; provenance-keyed lanes only; escaping over deletion; shadow mode lets an operator preview exactly what enforce would change before turning it on; the doctor audit reports planted rows vault-wide regardless of mode.
  • Escaped-form tolerance. The doctrine assumes renderers and this repo's own readers treat backslash-escaped sigils as literal text. QA verifies renderPrefLink, the search tokenizer and the wikilink scanners do not match escaped forms; if a reader disagrees, that family's escape character is a per-family decision point, not a doctrine change.
  • Gate flips and capture identity. Because the id hashes the persisted body, toggling enforce between captures of the same third-party text yields different identities (an honest duplicate rather than a silent mutation). Documented; revisit only if operators hit it.
  • Staged-versus-published double reporting. The audit dedupes Brain/pending/ staged copies against publish targets (report the publish target; count staged once), keeping the warning truthful without noise.
  • Windows. Backslash path separators, CRLF preservation in the managed block (managed-block.ts:80-99 handles it), core.ignoreCase affecting check-ignore, and git-on-PATH resolution for the doctor probe. The payload-windows test precedent covers the merge mechanics.
  • Grading impact of the shadow row. A currently-passing multi-file workspace can start failing once shadowing grades fail - deliberate and documented in cli-reference and CHANGELOG; the detail is a flattened row string, so the finding stays concise and names both paths.
  • Lane D residual risks. A future two-write frame refactor would break atomicity - the extended PassThrough test guards it. acquireLockSyncWithRetry blocking stays a core-side hazard: no read path takes retrying locks. Telemetry continuity appends under ELOCKED remain fail-open (accepted loss).
  • Open: GEMINI.md's absence from ROOT_INSTRUCTION_FILES. Possibly deliberate. The docblock sweep asks the question in place; answering it behaviorally is a follow-up decision, not a silent unification.
  • Open: aider's convention file. The repo doc claims Aider follows agents.md (unverified upstream); the precedence entry carries that uncertainty in its docblock.