Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
Merge security hardening for GHSA-jpcg-w5c5-wcv6
AkitaOnRailsccba4f44453f
diff --cc CHANGELOG.mdindex 24c8ca49,ef5648eb..200e304a--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -13,505 -13,45 +13,546 @@@ version in [`docs/changelog/`](docs/cha### Fixed+- Fixed the PowerShell Docker wrapper leaving native managed commands without+ the root bearer stored in a named volume. Native `install-hooks` now refreshes+ a host copy under the user's local app-data directory once, and `run`,+ `show`, `continue`, `resume`,+ `workstreams`, and `rename-workstream` reuse it without starting a container;+ explicit token and bind-mounted data-dir settings still take precedence+ (#1603).+- Fixed Antigravity print-mode managed runs recording no user prompt because+ `agy --prompt` does not append to shared `history.jsonl`. When that history+ yields no prompt, export now reads only explicit `USER_INPUT` records from+ the conversation's bounded, containment-checked brain transcript (#1605).+- Kept Claude Code's combined SessionStart context below its fixed 10,000+ character inline limit. Profile and handoff sections are independently+ bounded, must-see handoff/continuity/inbox notices take priority, and an+ omitted managed ledger leaves a `workstream-search` pointer instead of+ pushing the entire response into an unread file (#1606).++- Corrected the startup error for a gap in SQLite migration history. A+ skipped earlier migration is now reported as missing from the history,+ instead of claiming the store is newer than the binary. The store still+ refuses to open until its migration history can be reviewed (#1612).++- Fixed the POSIX Docker wrapper routing host commands into the helper+ container when `--config` or `--data-dir` preceded the command. Managed+ launches, MCP bridges and lifecycle hooks now retain their native host+ route and complete argument list with either global-option syntax (#1602).++- Fixed native transcript imports dropping a whole session when one JSONL+ record exceeded the 1 MiB per-record cap, as a Claude Code screenshot in a+ tool result does: `ai-memory backfill` imported nothing from the session,+ and an `ai-memory run` recorded its transcript import as failed. The record+ is now skipped as an extraction loss, its tail read in bounded chunks that+ still count toward the 64 MiB source cap, and the rest of the session is+ imported; a record still being written is left for the next read, not+ skipped half-way. The transcript baseline steps over it the same way, so a+ degraded run's recovery cursor and its exact replay agree. An annotation+ marks the gap, and shows in a managed run's ledger as an import note, so the+ capture policy fails closed: a tool result without a call id (Kimi, Grok)+ later in the same turn is treated as an orphan, since the skipped record may+ have been its call under an ignored path. `backfill` and `recover` print how+ many records they skipped on stderr, `backfill` also under `--quiet`+ (#1613).++- The `user grants` and `project grants` tables now measure terminal display+ cells, so accented and double-width CJK workspace, project and user names+ keep the `USERNAME` and `LEVEL` columns aligned.+ ([#1564](https://github.com/akitaonrails/ai-memory/pull/1564))+- The LLM dream pass no longer writes a cross-scope wikilink that does not+ resolve. Every other consolidation write runs its proposed bodies through the+ cross-scope link guard, but the dream pass never did, so a `[[project:path]]`+ carried in from a cluster member's body — or invented by the model — reached+ the merged survivor and minted a dangling cross-project edge that the lint+ pass reported on every later run and nothing could clear.+ ([#1566](https://github.com/akitaonrails/ai-memory/pull/1566))+- The desktop installer no longer hangs on "Starting the setup page" when+ `ai-memory setup --web` logs heavily. It read the child's stdout for the+ whole run and its stderr only afterwards, so once that unread pipe filled+ (64 KiB) the child blocked on its next log line and never printed the page's+ address, leaving the window on the status line with no error. Both streams+ are now read at the same time.+ ([#1567](https://github.com/akitaonrails/ai-memory/pull/1567))+- The importer no longer carries a UTF-8 BOM into an imported text or Markdown+ document. `document --file notes.md` on a file saved with a BOM — what+ Notepad, VS Code's `utf8bom` encoding and Excel's "CSV UTF-8" export all+ write — stored a body beginning `\u{feff}# Overview`, so the first heading+ stopped being a heading. Nothing downstream removed it, since U+FEFF is+ neither whitespace nor a control character, and the transcript extractor in+ the same file already stripped it.+ ([#1568](https://github.com/akitaonrails/ai-memory/pull/1568))+- A workbook that contains a chartsheet now imports its worksheets instead of+ failing outright. OOXML lists chartsheets and dialogsheets as `<sheet>`+ elements alongside worksheets and only the relationship type tells them+ apart, so a chart tab created by Excel's "Move Chart -> New sheet" had no+ worksheet relationship and aborted the whole extraction; a workbook of only+ chartsheets still reports that it contains no worksheets.+ ([#1569](https://github.com/akitaonrails/ai-memory/pull/1569))+- Skip an oversized session-header record instead of failing the read when the size cap's boundary cuts a multi-byte character, so one unreadable transcript no longer aborts discovery or lookup for the other sessions beside it ([#1570](https://github.com/akitaonrails/ai-memory/pull/1570))+- `/api/v1/search` no longer tells the browser it may reuse a search response+ for 30 seconds. The handler takes an owner filter that reaches the hybrid+ ranker, so both the ranking and each hit's observation snippet depend on who+ asked, and a credential switch at the same URL inside that window could be+ answered from the browser cache without the filtering path running. The+ endpoint now sends `private, no-store`, as every other owner-scoped route in+ the same module already does.+ ([#1571](https://github.com/akitaonrails/ai-memory/pull/1571))+- `ai-memory recover` now recovers a GitHub Copilot CLI session. The recovery+ journal records `copilot` for a degraded or finish-failed `ai-memory run+ copilot`, but the reader had no entry for that name, so recovery reported+ `journal names unsupported harness 'copilot'` and retained the entry on every+ rerun, leaving the transcript unrecovered. The same gap keyed the quarantined+ hook events with `copilot` instead of `copilot-cli` and sent an exportable+ Copilot transcript down the spool-only path.+ ([#1572](https://github.com/akitaonrails/ai-memory/pull/1572))+- `ai-memory status` now reports an unreadable recovery journal while the+ server is down. The offline recovery hint read the journal error, used it to+ decide whether to print anything, then printed neither branch's copy of it:+ a truncated `recovery-journal.json` left the human line saying `repair+ unrecorded runs (0 journaled)` and the `--json` line saying+ `{"journal_pending": 0, "spool_pending": 0}`, a machine-readable all-clear+ for a journal that cannot be parsed.+ ([#1573](https://github.com/akitaonrails/ai-memory/pull/1573))+- `purge-project` now keeps `--force` and `--compact` in the re-run command its+ refusal prints. The dry-run preview above it is computed with the operator's+ own flags, but the printed command dropped them, so pasting it after a+ `--force` run came back as a 409 `managed run lease is active` — the exact+ condition `--force` overrides — and a `--compact` run quietly reverted to a+ logical delete ([#1574](https://github.com/akitaonrails/ai-memory/pull/1574))+- `move-project` now keeps `--force` and `--on-conflict` in the re-run command+ its refusal prints. Both flags are honoured in the request the command+ builds, but the printed command dropped them, so pasting it after an+ `--on-conflict overwrite` run fell back to the `block` default and came back+ as a 409 listing the conflicting paths instead of merging them, while a+ dropped `--force` put the active-project guard back in place+ ([#1575](https://github.com/akitaonrails/ai-memory/pull/1575))+- The compaction recap now reaches Claude Code, Codex and Qwen Code while an+ external producer owns capture. A `reload context` prompt is answered+ through the `UserPromptSubmit` context envelope, but that delivery path was+ missing from the set exempt from `AI_MEMORY_CAPTURE_OWNER` suppression, so+ the hook returned an empty response before it could fetch the recap. Every+ enqueue and drain on the path stays gated on the external owner, so the+ exemption delivers context without capturing anything.+ ([#1576](https://github.com/akitaonrails/ai-memory/pull/1576))+- Fixed the SessionEnd consolidation queue retrying a provider failure that a+ later attempt cannot clear. The queue's terminality check hand-enumerated+ only the deterministic structured-response shapes, so a rejected or expired+ credential, an unconfigured provider, a schema failure and a+ malformed-request `4xx` were all retried: one expired API key burned the+ full five-attempt cap — five complete consolidation prompts over 7.5+ minutes — for every ended session, logging "queued for retry" four times.+ The check now defers to `LlmError::is_transient`, the predicate the+ in-process consolidation and bootstrap retry loops already use, so only a+ `429`, a `5xx` or a transport timeout/connect failure keeps the bounded+ backoff and every deterministic failure settles the job terminal with the+ heuristic session page left in place+ ([#1581](https://github.com/akitaonrails/ai-memory/pull/1581))+- Fixed the document importer's subtitle reader dropping WebVTT cues whose+ identifiers begin with `NOTE` and rejecting CR-only WebVTT files as empty.+ It now distinguishes comment tokens from cue identifiers and normalizes+ CR, LF, and CRLF before splitting VTT/SRT cues. (#1601)++- Fixed the profile digest cutting an entry's line at 240 bytes with no+ sign of the cut: a `summary`, `abstract` or first prose line over the limit+ was clipped mid-word, so the agent read part of a rule as the whole rule.+ The line now ends in `…` inside the same 240 bytes, and+ `docs/cross-project-profile.md` states the limit next to `summary`.+ (#1608)+- `install-mcp --client freebuff --apply --auth-token` now stores the key in+ `<data_dir>/auth-token`, where the hooks keep theirs, and writes the FreeBuff+ entry with `--data-dir` and no token, as it already did for the Claude Code+ (`--session-aware`) and Muse bridge entries. FreeBuff's entry is always the+ session-less `mcp-bridge` and already carried that `--data-dir`, but the key+ was written into `~/.agents/mcp.json` as `env.AI_MEMORY_AUTH_TOKEN`, outside+ the data dir's file permissions and outliving a rotation. The key still stays+ in the entry whenever the bridge would not reach it: a configured bearer that+ would win, a different key already stored for the hooks, hooks that sign in+ with OIDC, a failed store, a different endpoint, the Docker helper, or a+ snippet that is only printed.+ ([#1593](https://github.com/akitaonrails/ai-memory/pull/1593))+- `install-mcp --client codex` now prints the same table name `--apply` writes.+ The printed snippet hand-interpolated `[mcp_servers.<name>]`, so `--name+ ai.memory` printed a header a TOML reader resolves as three nested tables+ rather than one server, and `--name "my memory"` printed an invalid header+ that breaks the whole `config.toml` it is pasted into — while `--apply`+ quoted the key correctly all along. The printed table is now built with the+ apply path's own `toml_edit` writer; output for an ordinary name is+ unchanged.+ ([#1594](https://github.com/akitaonrails/ai-memory/pull/1594))+- Every command except `hook` and `mcp-bridge` now warns, naming the variable+ but not its value, when `HTTPS_PROXY`, `HTTP_PROXY` or `ALL_PROXY` (or a+ lower-case spelling) is set to something the HTTP client cannot use: bytes+ that are not UTF-8, such as a Latin-1 password, a URI with an unencoded+ space or non-ASCII character, or an unsupported scheme. The client skips+ such a value and connects directly, so provider and login requests used to+ time out on a network that blocks direct egress, or bypass a required proxy+ where it does not, with nothing pointing at the proxy setting.+ ([#1565](https://github.com/akitaonrails/ai-memory/pull/1565))+- `init`, `auth` and `auth enable` print paths on Windows without the `\?# Changelog++All notable changes to this project will be documented in this file.++The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).++This file holds the current major line. Earlier lines are archived per major+version in [`docs/changelog/`](docs/changelog/):+[2.x](docs/changelog/2.x.md), [1.x](docs/changelog/1.x.md) and [0.x](docs/changelog/0.x.md).++ verbatim prefix of the canonical data dir, in their output and their errors,+ as the hook and service commands already did, and so does the+ `ai-memory starting` line every command logs. A path copied from those+ messages now works in `cmd` and in scripts that look for it.+ ([#1565](https://github.com/akitaonrails/ai-memory/pull/1565))++- Corrected the Docker rollback instructions to retag the prior digest and recreate the service without pulling the newer tag. ([#1585](https://github.com/akitaonrails/ai-memory/pull/1585))++- Corrected Docker backup instructions to use an online server snapshot or stop the container before copying its data. ([#1586](https://github.com/akitaonrails/ai-memory/pull/1586))++- Corrected the multi-user migration command to pass the pepper length with `--bytes`. ([#1587](https://github.com/akitaonrails/ai-memory/pull/1587))++- Corrected the API smoke test to use the running server’s configured bearer instead of a newly generated token. ([#1588](https://github.com/akitaonrails/ai-memory/pull/1588))+- Fixed restoring a page from a checkpoint leaving a pre-OKF file on disk.+ `restore-page` wrote the checkpointed bytes verbatim while the three+ sibling write paths conform theirs, and the row it indexes is conformed at+ the store's write choke point either way — so only the file was left+ behind. Restoring the pre-OKF checkpoint every migrated install carries+ then broke `export-okf` for the whole project with "run the server once to+ migrate", which the one-shot wiki migration never does again, and made+ every `serve` boot re-archive the data dir once the migration archive was+ deleted. The restore now conforms the file like the siblings do;+ conformance is idempotent modulo `generated.at`, which it inherits from the+ file on disk, so an already-conformant page still restores byte-exact.+ ([#1595](https://github.com/akitaonrails/ai-memory/pull/1595))+- Fixed `memory_query` skipping its raw-observation fallback (`raw_hits`)+ whenever an embedder was configured, which the default local embeddings+ are. The vector stream has no similarity floor, so an unrelated page+ kept `hits` non-empty, and an observation from a session with no page+ yet (still open, or ended without SessionEnd) could not be found, while+ the same store with `embedding_provider = "none"` returned it. The+ fallback now runs unless a page matched the query's own terms through+ page FTS, the entity stream or the observation stream; page ranking is+ unchanged (#1600).++- An empty structured answer from a Responses-API model is now reported as+ empty content rather than a JSON parse error. The `opencode`, `openai-oauth`+ and `codex` paths defaulted a missing `output_text` to an empty string and+ handed it to the parser, so the operator saw `serde: EOF while parsing a+ value at line 1 column 0`, naming neither the model nor the cause.+ ([#1529](https://github.com/akitaonrails/ai-memory/pull/1529))+- Detected `core.hooksPath` when a git config set it on the same physical+ line as the `[core]` section header, so `ai-memory-wikisync install-hook`+ no longer writes a `.git/hooks/post-merge` that git would never run.+ ([#1530](https://github.com/akitaonrails/ai-memory/pull/1530))+- Counted a file's final line in `ai-memory-wikisync` diff summaries when it+ does not end in a newline, so the `bytes/lines` figures no longer contradict+ the `first difference at line N` printed beside them.+ ([#1531](https://github.com/akitaonrails/ai-memory/pull/1531))+- `ai-memory run` now refuses an `--env`/`--env-file` entry whose key carries+ whitespace. `--env-file` lines are trimmed as a whole, not per half, so the+ common dotenv spelling `KEY = value` produced a key with a trailing space —+ an entry no shell or harness can read, so the override silently did nothing.+ ([#1532](https://github.com/akitaonrails/ai-memory/pull/1532))+- Discovered a repository page whose `--include` family names a bare top-level+ page (`README.md`), which `ai-memory-wikisync sync` previously left out of the+ repository side entirely, so a newly created one was never imported.+ ([#1533](https://github.com/akitaonrails/ai-memory/pull/1533))+- A Copilot `/responses` answer stopped by `max_output_tokens` is now reported+ as a truncated response naming the model and its output-token count, instead+ of an unexpected response shape reading "no error detail" — `error` is null+ on an incomplete answer, so nothing explained the stop and the class implied+ an unparseable reply rather than a `max_tokens` to raise.+ ([#1534](https://github.com/akitaonrails/ai-memory/pull/1534))+- Omitted TTL-expired pages from the page count in `memory_briefing` and+ `memory_explore`. Every page list in a briefing already hid them, and the+ project cards have since 3.1.x, so a project with an expired page reported+ more latest pages than any list in the same response could show. The+ all-versions total is unchanged, as is `ai-memory status`.+ ([#1535](https://github.com/akitaonrails/ai-memory/pull/1535))++- `memory_read_page` now reads a blank `path` or `query` as omitted, as its+ sibling arguments already do. An empty or whitespace-only `query` searched+ for an empty FTS expression and reported the inevitable miss as an internal+ error (-32603), which a looping client reads as "retry"; an empty `path`+ failed as "invalid path: empty path" and never tried the `query` passed+ beside it. Both now reach the instructive "exactly one of `path` or `query`"+ refusal, and a blank `path` beside a real `query` runs the search.+ ([#1536](https://github.com/akitaonrails/ai-memory/pull/1536))+- Reported a wiki page renamed away with an external tool, which arrives as a+ rename event rather than a removal, so the next auto-commit drops it from the+ tree instead of leaving a checkpoint naming a page that no longer exists.+ ([#1537](https://github.com/akitaonrails/ai-memory/pull/1537))+- Omitted TTL-expired pages from the 7- and 30-day activity counters in+ `memory_briefing`. A page written with a short TTL made a project look+ active while the brief's own recent-page list was empty, which is the+ signal an agent uses to decide how much context to pull. Session and+ observation counters have no TTL and are unchanged.+ ([#1539](https://github.com/akitaonrails/ai-memory/pull/1539))++- Kept literal `<mark>` tags from a page's own text out of search-result+ markup, including balanced pairs that previously looked identical to SQLite+ highlights. FTS now uses internal delimiters that sanitized page content+ cannot forge, and only presentation boundaries turn them into HTML.+ ([#1540](https://github.com/akitaonrails/ai-memory/pull/1540))+- `install.ps1` now refuses a plain-http GitHub release base. The scheme check+ sat inside a condition whose arms already implied https, so it could never+ fire, and an `http://github.com/...` base matched neither arm and skipped it+ entirely — while the archive and its checksum are fetched from that same+ origin, so the checksum proved nothing against an on-path rewrite.+ ([#1541](https://github.com/akitaonrails/ai-memory/pull/1541))+- An unspaced-CJK search carrying `AND`, `NOT` or `NEAR` no longer returns the+ pages the operator excluded. The auxiliary CJK stream discarded every boolean+ operator and `OR`-joined the CJK runs it found, and because that stream is+ unioned into the primary one, `東京 NOT 大阪` fused the 大阪-only pages back in+ and ranked them as if they had been asked for. The stream now declines such a+ query, so unspaced-CJK recall narrows to the pre-feature answer for it instead+ of inverting; `OR` queries are unaffected.+ ([#1542](https://github.com/akitaonrails/ai-memory/pull/1542))+- An `openai-oauth` answer the Codex backend stopped at its output-token+ budget is now a terminal truncation instead of a retryable `502`. The+ streaming parser read `response.incomplete` as a provider fault, so the+ fallback chain advanced to the next candidate and opened a circuit, and the+ SessionEnd consolidation job kept re-sending the same prompt on its backoff+ schedule, each attempt truncating again at the same budget.+ ([#1543](https://github.com/akitaonrails/ai-memory/pull/1543))++- `memory_read_page` now answers a missing read target with `invalid params`+ (-32602) instead of an internal error (-32603). A page absent under the+ resolved scope, and a query that matched nothing, are caller-fixable: the+ store answered, there is simply nothing there, and a client reads -32603 as+ "retry". `memory_status` and `memory_read_session_observations` already+ answer -32602 for an unknown project or session. The messages and the+ auto-resolved-scope hint are unchanged, and a genuine disk or store failure+ on the same path still answers -32603.+ ([#1544](https://github.com/akitaonrails/ai-memory/pull/1544))+- An OpenCode subagent session's end no longer hands the next session a+ sub-task baton. The generated plugin forwarded the session's `parentID` as+ the `agent_id` subagent marker on `session.created` but not on+ `session.deleted`, so the `session-end` request carried no marker, the+ router did not recognize a child session, and it published a summary page+ and an open handoff that the next root session in that checkout consumed.+ ([#1546](https://github.com/akitaonrails/ai-memory/pull/1546))+- `install-mcp --client opencode --flavor <dialect>` now writes the flavored+ URL into the OpenCode entry. Both OpenCode entry builders read the server+ URL directly instead of the flavored one, so the flag was silently dropped+ for a client its own documentation names: a Vertex-routed install got a bare+ URL and 400'd every `tools/list`. OpenCode installs that do not pass+ `--flavor` are unchanged.+ ([#1547](https://github.com/akitaonrails/ai-memory/pull/1547))++- A `title:` or `body:` filter on an unspaced-CJK search now narrows the+ auxiliary CJK stream too. The stream read `:` as a plain run separator and+ dropped the qualifier, so its MATCH searched every indexed column including+ the path, and because that stream is unioned into the primary one,+ `title:支付服务` returned pages holding the term only in their body or path.+ ([#1548](https://github.com/akitaonrails/ai-memory/pull/1548))+- An Anthropic structured answer the model stopped at `max_tokens` is now a+ terminal truncation instead of a successful result. The provider did not read+ `stop_reason`, so a `tool_use` block holding only the JSON produced before the+ budget ran out was returned as a complete answer: a consolidation or bootstrap+ chunk could write a fraction of its pages and report success. On models that+ reject a forced `tool_choice` the same stop reported "no tool_use block"+ instead. Non-structured completions are unchanged — prose cut at the budget is+ still returned.+ ([#1549](https://github.com/akitaonrails/ai-memory/pull/1549))+- Counted a page needing only an L0 abstract embedding in `ai-memory embed+ --dry-run` and `/admin/embed`. A page whose body vector was already current+ appeared in neither the would-embed nor the up-to-date total, so the dry run+ reported no work for a scope where a live run writes abstract embeddings.+ ([#1550](https://github.com/akitaonrails/ai-memory/pull/1550))++- The PowerShell `session-start` hooks for Claude Code, Command Code and Devin+ now wrap the handoff in the same `hookSpecificOutput` envelope their POSIX+ peers emit. On Windows the baton was written as bare text, so the harness+ logged "Hook output does not start with {, treating as plain text" on every+ start and the handoff arrived unstructured instead of as `additionalContext`.+ ([#1551](https://github.com/akitaonrails/ai-memory/pull/1551))+- The Japanese iteration mark 々 (and the other letters of CJK Symbols and+ Punctuation) now stay inside a CJK run. They terminated one, so a word like+ 日々 was indexed as two single characters and searching it emitted a bare+ `"日"` that matched every page containing 日 while 日々 itself was unfindable+ as a unit. Indexing changes with this, so existing rows keep their old terms+ until they are rewritten or the index is rebuilt by a compaction.+ ([#1552](https://github.com/akitaonrails/ai-memory/pull/1552))+- `memory_write_page` now refuses a relation target whose `project:` or+ `workspace/project:` scope holds a character the link reader cannot parse,+ such as a space in `my project:notes/x`. The write boundary used a looser+ character class than the reader, so the colon stayed inside the page path on+ read and the write created an edge to a path no page write can ever produce —+ a `links` row that could never be resolved.+ ([#1553](https://github.com/akitaonrails/ai-memory/pull/1553))++- `memory_handoff_cancel` now answers a well-formed `handoff_id` that resolves+ to nothing in scope with `invalid params` (-32602) instead of an internal+ error (-32603). The lookup succeeded and found no row, so the id is the+ caller's to fix, and a client reads -32603 as "retry". The same function+ already answered a malformed id with -32602, and `memory_handoff_accept`+ reports an unknown id as `{"handoff": null}`. The message is unchanged and+ still identical for an absent id and for another operator's, so cancelling+ reveals no more than before.+ ([#1554](https://github.com/akitaonrails/ai-memory/pull/1554))+- `ai-memory run` no longer loses a native session selector that sits behind a+ non-UTF-8 argument. The scan over the forwarded arguments ended at the first+ argument that was not valid UTF-8 instead of skipping it, so a run pinned with+ an explicit `--session`/`--resume` kept no expected session id and fell back+ to post-exit transcript discovery.+ ([#1555](https://github.com/akitaonrails/ai-memory/pull/1555))+- Dropped the merged-away page's `summary:` and `abstract:` from the merge+ stub left behind by cold-cluster dedup and the dream pass. Retrieval+ prefers a frontmatter summary over the body, so the brief and the+ non-keyword hit lists described the stub as if it still held content that+ had moved to the survivor. The pre-merge frontmatter stays reachable+ through the supersession chain; compaction is unchanged.+ ([#1556](https://github.com/akitaonrails/ai-memory/pull/1556))++- The OKF migration now conforms a page nested under a project bundle whose+ file is named `index.md`. Only the bundle root's own `index.md` is reserved,+ but the skip matched on the basename at any depth, so the database row was+ conformed while its file kept pre-OKF frontmatter — and markdown being the+ source of truth, the next reindex de-conformed the page again.+ ([#1557](https://github.com/akitaonrails/ai-memory/pull/1557))+- A root Grok session no longer loses its handoff because a tool used one of+ the subagent marker key names. The shell `post-tool-use` hook matched+ `agent_id` and its siblings as substrings of the whole raw payload, so a key+ of that name nested in `tool_input` or in a structured tool result, or a+ blank top-level value, suppressed the fetch. The gate now reads top-level+ keys with a non-empty string value, like the native router and the+ PowerShell bundle already did.+ ([#1558](https://github.com/akitaonrails/ai-memory/pull/1558))+- `ai-memory list-projects` now sizes its columns by terminal display width+ rather than bytes. Accented names no longer add phantom padding, and+ double-width CJK project or workspace names no longer shift later columns.+ ([#1559](https://github.com/akitaonrails/ai-memory/pull/1559))++- A byte size just under a unit boundary now carries to the next unit instead+ of printing a magnitude that unit cannot hold. The scaling loop stopped at+ `value < 1024.0` while the result is rendered with one decimal, so a+ database of 1 MiB minus six bytes made `ai-memory status` report+ `1024.0 KiB on disk` rather than `1.0 MiB`; `reclaim-ledger-versions` could+ likewise print `1024.0 KiB -> 1.0 MiB` for a six-byte difference.+ ([#1562](https://github.com/akitaonrails/ai-memory/pull/1562))++- A popped message can no longer pass its own text off as `ai-memory`'s. The+ human rendering of `message pop` printed the sender's subject above the+ security notice and the body between two literal fence lines, neither+ escaped, so a newline in the subject forged lines in the provenance block+ and an `---- end of body ----` line in the body closed the fence early. The+ subject now renders on one line, body fence markers are neutralized, and+ terminal control sequences are stripped; both JSON paths remain structural.+ ([#1563](https://github.com/akitaonrails/ai-memory/pull/1563))++### Security++- A malformed OAuth entry in `auth.json` no longer prints the stored value in+ its error. When a field held a value of the wrong type, such as a token+ written into `expires` by a hand edit or a provisioning script, the parse+ error quoted the token, and from there it reached terminals, CI logs and+ captured hook output. The error now names the type it found with the value+ replaced by `<redacted>`.+ ([#1565](https://github.com/akitaonrails/ai-memory/pull/1565))++## [3.2.1] - 2026-10-22++### Fixed++- Fixed a 3.2.0 regression that serialized local document embedding and+ dropped the vector stream from queries that raced a document embed: the+ local embedder's capacity was hardcoded to two slots (one document, one+ query), and a query finding both busy degraded instantly to lexical+ search. The scheduler is now sized from the CPU (half the available+ parallelism, clamped to between 2 and 6 slots, documents capped at+ capacity minus one so a slot stays query-reserved), and a query waits up+ to 250 ms for a slot before degrading. On the affected LongMemEval-S+ question set this restores query latency (p50/p95 66/87 ms vs 3.2.0's+ 118/295) and ingest throughput; the reported hit@5 delta (0.947 → 0.938)+ traces to rank-boundary questions that flip between identical runs, not+ a deterministic ranking change (#1580).++- Fixed `ai-memory run` (and `show`, `continue`, `resume`, `workstreams`,+ `rename-workstream`) failing on Windows Docker installs with "managed+ claude executable `claude` was not found in the host PATH": the PowerShell+ wrapper sent every subcommand into the Linux helper container, which has no+ host CLIs. It now intercepts the same six commands `bin/ai-memory` does and+ runs them through the native Windows client, resolved from+ `AI_MEMORY_NATIVE_BIN` or the documented+ `%LOCALAPPDATA%\Programs\ai-memory` install location, inheriting+ `AI_MEMORY_SERVER_URL` (an explicit value wins) and exiting with the+ child's code. A missing client fails with the documented installer command+ instead of entering the container; the POSIX wrapper's Git Bash refusal+ points at the same installer; and the missing-harness error's Docker+ advice is now OS-aware: on Windows it names the native-client installer+ rather than `ai-memory upgrade`, which in the `.ps1` wrapper only pulls+ the image. Managed launches keep the hook/MCP wiring rendered through the+ container (the wrapper sets `AI_MEMORY_RUN_AUTOWIRE=false` for the+ intercepted commands unless the operator set it). (#1545)++- Corrected four statements in `SECURITY.md` that no longer matched the+ code, plus two clarifications in the same sections (#1561). The+ `AI_MEMORY_ALLOWED_HOSTS` default is `localhost`, `127.0.0.1`, and `::1`;+ request bodies are capped at 10 MB on `/mcp`, `/hook` and `/workstream/*`,+ 32 MB on `/admin/*`, and 2 MB elsewhere; the auth ladder is anonymous,+ root bearer, proxy-asserted user, and `aim_` database-user tokens (the+ server itself never validates OIDC tokens, and the doc no longer says it+ does); and the "no per-user or per-project ACLs" claim became the current+ truth about per-project access modes and grants, including that+ proxy-asserted identities are not subject to them. The bearer-check note+ now lists the routes that are public by design (`/healthz`, `/auth/login`,+ `/auth/recovery`, `/favicon.ico`, custom `/web` static assets).+- Completed the egress inventory in `DATA_HANDLING.md` and documented the+ default first-start behavior it omitted (#1560). A default install now+ says plainly that the local embedder downloads its three model files+ (~87 MB, sha256-pinned) from `huggingface.co` in the background on first+ start, that nothing stored is sent, and how to avoid it+ (`embedding_provider = "none"` or offline pre-seeding). The export table+ gained the rows it was missing: the `llm_provider` pipeline (including+ the `codex`, `copilot` and `cursor` CLI-backed providers), the `copilot`+ embedding provider, and `[[admission_webhooks]]`, plus notes on+ `ai-memory upgrade`'s GitHub release query, the OAuth/OIDC login flows,+ and remote `server_url` topologies. `docs/airgapped-install.md`'s+ runtime summary was corrected to match.+++### Fixed+++ - Hardened the privacy strip. It now matches credentials across invisible+ formatting characters while storing text that matches nothing byte for+ byte, so emoji sequences and scripts that need joiners are untouched. It+ also redacts PGP private keys and private-key blocks that have no end line,+ as long as a key-body line follows the header, so prose that only names a+ header is kept. Tag characters outside an emoji flag, a byte-order mark+ after the start of the text and the invisible math operators are stripped.+ The allowlist no longer exempts private keys, and blank `[sanitize]+ allowlist` entries are ignored with a warning at startup. The client scrub+ shared by the relay and importer companions follows the same rules.+ Reported by @FabioLeitao.+ ([GHSA-jpcg-w5c5-wcv6](https://github.com/akitaonrails/ai-memory/security/advisories/GHSA-jpcg-w5c5-wcv6))++ - Tightened how client commands decide that a server URL is on this machine+ before using the install's root token. The check now reads the host the+ HTTP client would connect to and refuses any URL that carries user+ information. `ai-memory upgrade` uses the same check for its remote-server+ note. Reported by @FabioLeitao.+ ([GHSA-jpcg-w5c5-wcv6](https://github.com/akitaonrails/ai-memory/security/advisories/GHSA-jpcg-w5c5-wcv6))++ - `ai-memory restore` no longer replaces an existing live `config.toml` with+ the backup's by default, because a config can run commands and redirect+ data. The backup's copy is saved beside it as `config.toml.from-backup`+ (owner-only) with a notice; pass the new `--with-config` flag to restore it+ in place as before. A data dir with no config still gets the backup's. When+ the live config is kept and the restored database holds API keys, its pepper+ must match them, or the restore stops before changing anything and names+ `--with-config`. Reported by @FabioLeitao.+ ([GHSA-jpcg-w5c5-wcv6](https://github.com/akitaonrails/ai-memory/security/advisories/GHSA-jpcg-w5c5-wcv6))++ - `install-mcp --client codex` now makes Codex ask before running ai-memory's+ destructive tools. The read tools still run without a prompt; every tool+ annotated destructive (deleting or restoring a page, the forget sweep,+ accepting or cancelling a handoff, popping or cancelling messages, recall+ feedback) gets a per-tool `approval_mode = "prompt"`, and a re-install keeps+ per-tool settings you already chose. Re-run `install-mcp --client codex+ --apply` to update an existing entry. Reported by @FabioLeitao.+ ([GHSA-jpcg-w5c5-wcv6](https://github.com/akitaonrails/ai-memory/security/advisories/GHSA-jpcg-w5c5-wcv6))+## [3.2.0] - 2026-10-21### Addeddiff --cc crates/ai-memory-cli/src/commands/install_mcp.rsindex 20e2c153,30f59686..a3879956--- a/crates/ai-memory-cli/src/commands/install_mcp.rs+++ b/crates/ai-memory-cli/src/commands/install_mcp.rs@@@ -2340,45 -2365,40 +2385,44 @@@ fn render_codex(args: &InstallMcpArgs)// — NOT a literal `bearer_token = "..."` (that's stdio-only)// and NOT a `[mcp_servers.<name>.headers]` sub-table (the key// is `http_headers`, with the `http_` prefix).- let mut out = format!(- "# Codex CLI — append to $CODEX_HOME/config.toml (default ~/.codex/config.toml)\n\- #\n\- [mcp_servers.{name}]\n\- url = \"{url}\"\n\- # Skip per-call approval prompts on ai-memory's read tools;\n\- # the destructive ones below still ask first.\n\- default_tools_approval_mode = \"approve\"\n",- name = args.name,- url = args.server_url.as_deref().unwrap_or(DEFAULT_MCP_URL),+ let mut doc = toml_edit::DocumentMut::new();+ codex_upsert_mcp_server(&mut doc, args)?;+ let server = doc+ .get_mut("mcp_servers")+ .and_then(toml_edit::Item::as_table_mut)+ .and_then(|servers| servers.get_mut(&args.name))+ .and_then(toml_edit::Item::as_table_mut)+ .context("internal: generated Codex TOML table missing")?;+ if let Some(mut key) = server.key_mut("default_tools_approval_mode") {+ key.leaf_decor_mut().set_prefix(- "# Skip per-call approval prompts on ai-memory's tools.\n\- # ai-memory is read-mostly + writes are auto-capture; the\n\- # approval friction makes it unusable otherwise.\n",++ "# Skip per-call approval prompts on ai-memory's read tools;\n\++ # the destructive ones below still ask first.\n",+ );+ }+ if let Some(headers) = server+ .get_mut("http_headers")+ .and_then(toml_edit::Item::as_table_mut)+ {+ headers.decor_mut().set_prefix("\n");+ }+ let mut out = String::from(+ "# Codex CLI — append to $CODEX_HOME/config.toml (default ~/.codex/config.toml)\n#\n",);+ out.push_str(&doc.to_string());+ // Trailing prose: `toml_edit` 0.22 has no document-trailer setter, and a+ // comment after the last key carries no TOML structure either way.if args.token_env_var {out.push_str(&format!(- "bearer_token_env_var = \"{PRIME_AGENT_TOKEN_ENV}\"\n\- # The token is read from ${PRIME_AGENT_TOKEN_ENV}; export it where you launch codex.\n"+ "# The token is read from ${PRIME_AGENT_TOKEN_ENV}; export it where you launch codex.\n"));- } else if let Some(b) = bearer_header_value(args.auth_token.as_deref()) {- out.push_str(&format!(- "\n[mcp_servers.{name}.http_headers]\n\- Authorization = \"{b}\"\n\- # Alternative (avoids embedding the literal token):\n\+ } else if bearer_header_value(args.auth_token.as_deref()).is_some() {+ out.push_str(+ "# Alternative (avoids embedding the literal token):\n\# bearer_token_env_var = \"AI_MEMORY_AUTH_TOKEN\"\n\# — and export AI_MEMORY_AUTH_TOKEN in your shell init.\n",- name = args.name,- b = b,- ));- }- for tool in ai_memory_mcp::AiMemoryServer::destructive_tool_names() {- out.push_str(&format!(- "\n[mcp_servers.{name}.tools.{tool}]\napproval_mode = \"prompt\"\n",- name = args.name,- ));+ );}- out+ Ok(out)}fn render_grok(args: &InstallMcpArgs) -> Result<String> {diff --cc docs/lifecycle-ops.mdindex 3cd2b739,0ec96e9c..b47859bc--- a/docs/lifecycle-ops.md+++ b/docs/lifecycle-ops.md@@@ -1230,10 -1243,10 +1244,14 @@@ Failure modesa snapshot the current binary cannot open** (for example a backup takenby a newer release) → exits with the error; the existing `wiki/` and`db/` are left as they were.+- **Migration history has a gap** → an earlier migration is unrecorded+ although a later one was applied. The staged store is refused, just as at+ normal startup. Keep the backup and report the history for review;+ `--force` does not bypass this check or repair the missing migration.+ - **The live config's pepper does not match the backup's API keys** (live+ config kept) → rerun with `--with-config` to restore the backup's config, or+ set the live `[auth].token_pepper` to the original. The live data is left as+ it was.- **Legacy backup has API keys but no pepper verifier** → restore the original`[auth].token_pepper` through the current config/environment and rerun with`--accept-legacy-api-key-pepper`. This flag confirms provenance; it cannotdiff --cc docs/security-boundaries.mdindex a33c765b,7831ea89..c94c98df--- a/docs/security-boundaries.md+++ b/docs/security-boundaries.md@@@ -90,8 -89,9 +90,9 @@@ means the boundary is not built yet| 10e | Reconcile-tombstone of a disk-deleted page is opt-in, soft, scope-bound, and false-positive-guarded (invariant #16, #929 delete-half) | `ai-memory-wiki/src/watcher.rs` — off by default (`[maintenance] reconcile_tombstones_deleted_pages`); a page is tombstoned only after its file is observed missing on two consecutive passes (streak resets if the path's `PageId` changed), re-verified against the live filesystem immediately before acting, with reserved/indexed-but-unwalked paths (`bootstrap.md`, `_meta.md`, `_pending/`, `sessions/*.md`) excluded and a circuit breaker that skips a whole scope when `> max(3, 50%)` of its pages look missing or a non-partial walk finds nothing; `ai-memory-store/src/ops.rs` `soft_delete_for_reconcile_if_latest` is a soft tombstone (`is_latest=0` + `superseded_at`, decay's shape) through the single writer actor in one transaction — never a filesystem write — scoped to the page's own `(workspace_id, project_id)` | `watcher.rs` `reconcile_delete_disabled_by_default_never_tombstones_a_missing_page`, `reconcile_delete_cross_project_isolation` (project A's deletion never tombstones project B's same-path page), `reconcile_tombstone_refuses_a_stale_latest_id`, `reconcile_tombstone_refuses_when_the_file_still_exists`, `reconcile_tombstone_never_touches_the_filesystem`; `ops.rs` `reconcile_tombstone_resurrects_instead_of_orphaning_on_recreate` | STRONG || 10f | Session-time repair is scope-bound (no cross-project timestamp rewrite) | `ai-memory-store/src/ops.rs` `repair_session_times` — every candidate is read back and updated with `WHERE id=? AND workspace_id=? AND project_id=?`; a row outside that 3-tuple is reported `NotFound` and untouched, same code path as an id that does not exist at all; `ai-memory-mcp/src/admin.rs` `handle_repair_session_times` passes the caller's `(workspace, project)` straight through, never the candidate's own | `ops.rs` `repair_session_times_does_not_touch_a_session_of_another_project` (control: sibling session in-scope repaired in the same batch); `admin_repair_session_times.rs` `cross_project_session_is_not_found_and_untouched`; both bite-checked by dropping the `project_id` filter | STRONG || 10g | The event-ledger age sweep deletes only closed ledger files of the swept project: opt-in, content-gated, admission-gated, never the writer's months (invariant #16) | `ai-memory-consolidate/src/sweep.rs` `sweep_event_ledgers` + `ledger_is_expired` (off at `[decay] ledger_retention_months = 0`; never the current or previous UTC month, whatever the age; a dry run only lists; a per-file delete failure is counted in `ledgers_undeleted`, kept and retried — the sweep does not abort, exactly as a refused page delete is kept and retried); `ai-memory-wiki/src/wiki.rs` `list_event_ledgers` / `delete_event_ledger` — rotated `log-YYYY-MM.md` name AND `log_ledger` content gate (checked before and after the admission round-trip under the mutation guard), a project-confined path, no symlink, never `log.md`, no store write; then the same blocking admission check a page delete runs (`remove_page_locked`): webhooks subscribed to `delete_event_ledger` are notified BEFORE the unlink, a `reject`-policy webhook refuses and the file stays, and the non-blocking observers are told only after the removal is durable | `consolidate` `tests/suite/ledger_sweep.rs` `an_ordinary_page_named_like_a_ledger_is_never_deleted` (a page, a frontmatter page and `log.md` are kept; the real ledger is the control), `another_projects_ledgers_are_untouched`, `the_current_and_previous_month_survive_even_a_one_month_retention`, `the_default_configuration_deletes_no_ledger`, `a_dry_run_reports_files_and_bytes_and_deletes_nothing`, `a_rejecting_admission_webhook_keeps_the_ledger_and_the_report_says_so` (adversarial: a `reject`-policy webhook on `delete_event_ledger` — the file stays intact, the report counts it in `ledgers_undeleted`, the sweep keeps the rest going), `an_accepting_admission_webhook_is_told_after_the_file_is_gone` (legitimate control: an accepting gate lets the delete through and the non-blocking observer receives the op only after removal); `sweep.rs` `ledger_guard_protects_the_current_and_previous_month_regardless_of_age`; `wiki` `tests/suite/ledger_files.rs` `an_admission_webhook_cannot_swap_a_ledger_for_an_ordinary_page_before_delete` (the webhook overwrites the accepted ledger while deletion awaits its response; the final gate preserves that page, while a no-swap webhook is the legitimate delete control), `a_page_wearing_a_ledger_name_is_not_deleted_even_when_asked_by_name`, `only_a_rotated_ledger_name_is_accepted` (traversal and `log.md` refused), `deleting_in_one_project_leaves_the_neighbours_ledger` | STRONG |+ | 10h | `restore` never adopts a backup's code-bearing `config.toml` over a live one unasked, and never leaves a kept config unable to verify the restored API keys | `ai-memory-cli/src/commands/restore.rs` `stage_then_swap` picks the archived config's placement (`ConfigPlacement`): restored in place only with `--with-config` or when the data dir has none, otherwise saved owner-only as `config.toml.from-backup` by `save_archived_config` after the swap; `swap_into_place(.., install_config)` moves the live config aside only when installing; with the live config kept and API keys in the staged database, the loaded `[auth].token_pepper` must verify against the staged pepper verifier before anything live changes | `restore.rs` `restore_keeps_a_live_config_and_saves_the_archived_one_beside_it` (adversarial: an archive whose config enables an eval command leaves the live config byte-identical and the copy `0600`), `restore_force_with_config_replaces_the_live_data_and_config` and `restore_into_an_empty_data_dir_needs_no_force` (controls: the flag, and a data dir without a config, restore it in place), `keeping_the_live_config_requires_its_pepper_to_match_the_restored_keys` (a mismatched or missing live pepper is refused naming `--with-config` with the live data untouched; controls: `--with-config`, and a matching live pepper) (GHSA-jpcg-w5c5-wcv6) | STRONG || 11a | Hook backpressure (202/429) + bounded fan-out (invariant #5) | `ai-memory-hooks/src/router.rs` semaphore→429, 202 immediately, `MAX_HOOK_BATCH_ITEMS`, bounded LRU limiter; batch acknowledgements retain only processed indices and classify terminal drops without consuming capacity (the `[ingest] drop_events` whole-kind drop, 11k, is one such terminal drop); the resolver's filesystem probes of a caller-supplied cwd run through `CwdProbes` (blocking pool, four permits held until the syscall returns, 2-second deadline), so a blocked `open()` cannot stall the async workers or pin unbounded threads, and a timed-out resolution fails closed without caching | `router.rs` `handle_hook_returns_429_when_ingest_saturated`, `ingest_rate_limiter_is_bounded`; `router.rs` `cwd_probes_keep_a_stuck_open_off_the_async_worker` (adversarial: a probe that never returns on a current-thread runtime; the timer still fires, the caller times out, a second probe never runs; fails when the probe runs inline) and `cwd_resolution_fails_closed_when_its_probe_cannot_run` (fails when the resolver probes inline); `router.rs` `handle_hook_batch_skips_rate_limited_first_item_and_accepts_later_source`, `handle_hook_batch_reports_failed_index_after_rate_limited_skip`, `handle_hook_batch_drops_subagent_events_before_capacity_check` (each asserts result indices and includes an accepted control) and `the_ingest_drop_events_drops_before_any_capacity_is_spent` (a whole-kind drop answers 202 with the semaphore exhausted; a kept kind gets the 429 control) | STRONG |-| 11b | Capture exclusions drop before storage | `ai-memory-hooks` `capture_policy.rs` `extract` reads each adapter's own field names — DSH's Claude Code-shaped `tool_name`/`tool_input` pair included, so a DSH file, search or shell call classifies instead of staying `Unknown` — and `inspect`→`Drop` (before semaphore/spawn), including shell commands whose arguments name an ignored path (`match_command`; argv elements matched whole and tokenized, and every word that holds several words, such as a quoted `sh -c` script or a `"$(…)"` substitution, re-split to four levels by `ShellCommand::split`/`push_nested_words`, a deeper script metadata-only; ANSI-C strings decoded and a backslash before an ordinary letter dropped (`shell_words`, `push_word`); backslash-newline continuations joined (`shell_words`); a parameter default's operand, a value glued to a short flag and a `file:` URL's path read as candidates (`parameter_operands`, `shell_arguments`, `file_url_path`); PowerShell and cmd escape characters read out under the `PowerShell` tool or on a Windows host (`without_windows_escapes`); `~+` resolved to the cwd and a `~-`/`~N`/`~name` prefix metadata-only (`names_unknown_directory`); shell and interpreter options that take a value skipped while looking for a `-c` script or inline code (`takes_shell_value`, `runs_inline_code`, which also lists `lua`/`Rscript`/`osascript -e`, and `su -c`/`script -c` as script runners); paths compared without regard to case on a macOS host (`fold_case`, set by `resolve`; patterns and candidates composed to NFC and lowercased in full by `fold_path`, TS `captureFold`; client-only, the server's sentinel re-inspection never depends on it); a `file:` URL cut at its query or fragment before decoding (`file_url_path`); a parameter default nested past four levels metadata-only and a default read again after backslash removal (`parameter_operands`, `push_word_reading`); a tilde expanded or treated as an unknown directory only when the shell expands it, unquoted and in a script rather than a quoted message or argv element, every tilde under PowerShell (`marked_shell_words`, `literal_tildes`, `expand_tilde`); a file or shell read of a harness's saved tool output, or a glob that could match one, metadata-only under an active policy (`output_spool`: Claude Code `tool-results/` and `tasks/*.output`, OpenCode `tool-output/`, Pi `pi-bash-*.log`; glob segments fit a name they share a match with, `globs_intersect`, TS `captureGlobsIntersect`, and one fitting segment must spell three characters in a row of that name's distinctive text literally, `spells`, TS `captureSpells`, so `*.log` is not read as `pi-bash-*.log`, a trade-off that leaves a glob with no such literal run, `/tmp/p?-b*`, outside the rule; the TS matcher applies it to `read_many_files` entries too); every other marker governing a file-tool target (an `apply_patch`'s header paths, read after leading whitespace, `patch_paths`), a search/list tool's directory, file or path-like glob argument (`search_scope`, Hermes `file_glob` included; a grep `pattern` is not read) or a separator-bearing shell argument also inspects the call, found by the lexical marker walk from each location's nearest existing directory, each directory's answer remembered for every lookup that passes it (`marker.rs` `MarkerMemo`, TS `captureMemoMarker`, seeded with the event's own walk, `remember`, TS `captureMemoRemember`), bounded (4,096 locations, 16 markers, and 16,384 probes sharing the glob walk's 50 ms, `MAX_LOOKUP_PROBES`, TS `CAPTURE_MAX_LOOKUP_PROBES`; locations outside the own checkout are looked up first, a glob's literal root before the walk below it (whose single listing can spend the time budget on a large directory), and past a bound fail closed as under an invalid policy, while running out inside the own checkout, whose locations are looked up shallowest first, ends the lookup, its own policy governing there) and combined strictest-first (`capture_lookup_locations`, `CaptureDecision::stricter`, `hook.rs` `foreign_capture_decision`, also applied by `transcript_capture.rs` `decide_call`; TS `captureForeignConfigs`, `captureDecide`, `captureSearchScope`, `capturePatchPaths`); a location with glob syntax is looked up from its literal root and, when that root lies outside the event's `.git` checkout, every directory the glob could pass through is checked for a marker (`glob_walk`, `hook.rs` `GlobBudget::markers_below`; TS `captureGlobWalk`, `captureMarkersBelow`, `captureOwnCheckout`: a `*`/`?` segment lists the child directories it matches, a class/brace/group every child, a `**` the subtree except the event's checkout's; a glob rooted inside the event's checkout is not walked; a checkout root at or above the home directory, or the filesystem root, is never the own checkout for these rules (`own_checkout`), so a dotfiles `~/.git` does not stop the walk from `~/Projects`; symlinks never followed; 256 directories, counted as a `**` lists, 32,768 entries and 50 ms, `MAX_GLOB_TIME`, TS `CAPTURE_MAX_GLOB_MS`, injectable clock, past which, or for a brace/group spanning a separator, a `..`/`~` alternative or one a bounded brace expansion builds, `brace_alternatives`, TS `captureBraceAlternatives`, a directory alternative bash before 5.2 expands to `..` (`.{*,x}/`), or an expansion too large to list whose pieces could build one of these (`brace_overflow_could_leave`, TS `captureBraceOverflowLeaves`: integer and letter sequences cannot, so `file{1..200}.txt` is walked like any glob), the call fails closed); a `..` after a `**` is read both as the `**` matching no directory and as matching some, by the event's own matcher and the lookup (`normalize_readings`, TS `captureReadings`, at most 16 readings, past which the call fails closed), and so is a directory segment that bash before 5.2 can expand to `..` (`could_name_parent`, `class_glob_matches` with POSIX classes such as `[[:punct:]]` and extglob groups such as `@(.)`, `?(.)`, `*(.)`, `+(.)`, `!(x)`; TS `captureCouldNameParent`, `captureClassGlob`, `captureNamedClass`), read as `..` too; inside double quotes a backslash before `$` or a backquote is dropped, so a quoted script (`bash -c "…"`, `eval "…"`) re-split for its words reads an ANSI-C string as the shell it runs does (`shell_tokens`, TS `captureMarkedWords`); a zsh glob group kept in its word and ANSI-C numeric escapes decoded are fed to the lookup (`shell_tokens` with `expand`, `ShellWords::expanded`, `glob_group`, `ansi_c_numeric_escape`; TS `captureMarkedWords(…, true)`, `captureGlobGroup`, `captureAnsiNumeric`); a file tool whose targets cannot be read or resolved, and a search/list argument that is not a string, fail closed; the path of a git `REV:path` object name tried from the cwd and the marker directory (`git_object_path`); Antigravity `run_command` resolved from its `Cwd`); an invalid marker makes file, search/list and shell calls metadata-only; an active one makes a shell call metadata-only when a word uses unquoted brace expansion, a bracket class (a leading `]` included), a zsh glob group or extglob, or a numeric/control ANSI-C escape (`has_unevaluated_expansion`, also run on scripts given to `sh -c`, `eval` or a substitution), or when it runs inline interpreter code (`runs_inline_code`: `python -c`, `node -e`, `ruby -e`, `perl -e`, `php -r`, `deno eval`), and either makes tools that read back an earlier command's output metadata-only (`reads_earlier_output`: `BashOutput`, `TaskOutput`, `write_stdin`, `process`, `read_bash`/`write_bash` and PowerShell twins); the server admits a metadata-only shell or unknown-family body only under an active or invalid marker, with no paths and an `extracted` state (`router.rs` `metadata_protocol_is_legal`), and its own re-inspection strips an older client's keep for either; a Gemini `read_many_files` literal entry is also read as `entry/**` (`glob_matches_below`), and Copilot CLI's runtime `view`/`create`/`str_replace_editor` are file tools for that agent only (`agent_family`); Factory Droid's Claude-shaped payload is read by `extract`, its `Create` and `ApplyPatch` are file tools for that agent only (`agent_family`), `ApplyPatch` reads its `input` envelope like Codex `apply_patch`, and its `LS` `directory_path`, `Glob` `folder`/`patterns` and `Grep` `glob_pattern` locate the call for the cross-checkout lookup (`search_direct_paths`, `search_scope`) (#1240); Meta Muse Code's Claude-shaped payload is read by `extract` with its `tool_use_id`, its `read_file`/`write_file`/`edit_file` `path` resolves lexically against `cwd`, its `read_memory`/`add_memory`/`edit_memory` are file tools for that agent only whose `project`-scope `path` is placed under `.agents/memory/` and whose personal scopes fail closed to metadata-only (`muse_memory_paths`), `monitor` is a shell for that agent only, and `bash_input` is an output reader for that agent only; CodeBuddy Code's payload carries Claude Code's tool names and fields and is read by the same `extract` arm (#1299); generated OpenCode/OMP/Pi/OpenClaw integrations mirror it in `render_shared.rs` `ts_capture_policy_v1` (`captureMatchCommand`, `captureShellSplit`, `captureUnevaluatedExpansion`, `captureInlineCode`, `captureGitObjectPath`, `captureGlobBelow`, the `reader` flag). Candidate/argument flavor (`Flavor::Posix` vs `Flavor::Windows`, used to pick which `ignore_paths` patterns even apply) is derived from the **host** (the cwd), never from the candidate string alone — a POSIX-host candidate spelled with a leading `//` is collapsed to a single `/` before flavor detection (`normalize_candidate`; TS `captureNormalize`'s `windowsHost` parameter, sourced from `captureHostWindows(cwd)`), fixing GHSA-vh98 (a `//`-prefixed candidate used to self-classify as `Flavor::Windows` regardless of host, matching zero POSIX patterns and being captured instead of dropped); a genuine Windows/UNC host (cwd itself windows-flavored) is unaffected; `hook.rs` `--check-capture` preflight uses the same capture policy before any spool or spawn; transcript imports (`ai-memory backfill`, including the automatic first-boot run, the `ai-memory run` ledger upload, and `ai-memory recover`'s finish-failed re-import and degraded-run replay in `recovery.rs` `recover_finish_failed`/`recover_degraded_run`, each built for the journaled checkout's `cwd`) apply the same decision table through `commands/transcript_capture.rs`: each recorded tool call is rebuilt in its agent's hook shape (`capture_policy.rs` `tool_call_payload`) and inspected by the checkout's policy, and by a reroute destination's policy too; a Drop removes the call and its result (paired by native id, else the strictest call of the turn when the result has no id; a result whose id matches no call, or with no call, follows the orphan rule: dropped under a policy, content-free without one), metadata-only posts the hook's metadata-only body with its protocol (backfill) or a withheld placeholder keeping only the family and a call id that passes the server's `valid_call_id` (ledger), and a shell call whose recorded arguments cannot be parsed drops; both imports also apply the hook's repository admission gate (`hook.rs` `checkout_admits_capture`: persisted capture mode, marker opt-in, readable routing marker — the same helpers the hook's own gate uses), so under allowlist mode an unmarked checkout imports nothing, prompts included: `backfill` stops before contacting the server and the run ledger finishes with no events; a tool the transcript names differently from the hook is rebuilt under the hook's name and fields (`capture_policy.rs` `hook_tool_call`: Codex `exec_command` `{cmd, workdir}` → `Bash` `{command, workdir}`); the Claude Code and Codex JSONL adapters label each event with its record's cwd (`transcript.rs` `stamp_record_cwd`, `RECORD_CWD_KEY`), from which the import resolves arguments, policy and reroutes, falling back to the session cwd, and which is removed before a ledger upload; a rerouted call, and an event whose record cwd lies outside the checkout, must pass that directory's admission gate, resolve to the same server-profile route as the checkout and to the same project scope (`transcript_capture.rs` `admits_elsewhere` → `hook.rs` `checkout_admits_capture` + `delivers_to_same_server`, which compares two `resolve_hook_route` results and never matches a refused selection, + `routes_to_same_project`, which compares the two `hook_scope` hint sets and, when they leave the project to the server, under `repo-root` the repository/marker anchor or the directory itself, under the default `basename` the directory itself or a destination inside the repository whose root is the source), else it drops with its result, since the import files every event under the importing project; compaction, checkpoint and annotation events answer to the same record-cwd checks; Claude Code `!` shell-mode output (a user message opening with a `<bash-stdout>`/`<bash-stderr>`/`<local-command-stdout>` block, whatever it holds) is dropped (`shell_mode_output`); the Claude Code adapter excludes harness-written background-task turns (`transcript.rs` `claude_task_notification`: `origin.kind` `task-notification` in any case, or a first text block opening with a `<task-notification` tag in any case, attributes allowed, after a byte-order mark, zero-width characters or whitespace) and records a compaction summary (`isCompactSummary` true, `"true"` or `1`, `truthy`) as a compaction event, which backfill does not post; a tool the matcher does not recognize (unknown family: MCP tools, Codex `view_image`, …) keeps only its family whatever the policy, as the live server stores for it (`EventCapture::Unrecognized`: backfill posts title `tool unknown` and body `tool_family: unknown`, the ledger a withheld placeholder), and so does a result with no call to inherit from ; in a Windows session every candidate, shell argument and `workdir` is read as the file Windows opens before matching (`windows_spelling`, `windows_segment`, `command_base`; TS `captureWindowsSpelling`/`captureResolve`/`captureBase`): Git Bash/MSYS2/Cygwin `/c/…` and `/cygdrive/c/…`, a drive-less rooted path on the cwd's drive, the `\\?\`/`\\.\`/`\??\` and `UNC` prefixes, the local administrative share (`\\localhost\C$`), and per-segment alternate-data-stream suffixes and trailing dots/spaces, any other device path unusable (metadata-only for a file tool); `/c/…` and `/cygdrive/c/…` are also read from the root of the cwd's drive, as a native tool reads them, and either reading matching drops (`windows_spellings`, `normalize_candidates`, `normalize_readings`; TS `captureWindowsSpellings`/`captureAllReadings`); the cwd, the marker directory, home and an absolute pattern get the same reading so every side shares one spelling (`normalize_root`, `compile`; TS `captureRoot`, the marker directory cut lexically); a Windows session also reads each shell command and argv element with every backslash literal, as PowerShell and cmd do, so a bare or double-quoted `\\server\share\…` or `\\?\C:\…` argument keeps its prefix (`literal_shell_words`, threaded through `push_nested_words`/`push_argv_item`; TS `captureMarkedWords(…, literal)`); the harness-spool check is linear in the path and charged to the match budget, past it fail-closed (`output_spool`, TS `captureOutputSpool`); a shell command over `MAX_SHELL_COMMAND_CHARS` (1 MiB) is metadata-only and its marker lookup unprovable (`ShellCommand::oversized`, TS `captureCommandOversized`); Hermes `execute_code` is metadata-only under an active policy (`INLINE_CODE_TOOL_NAMES`); the TS file/search/non-file/inline-code/output-reader tool lists and the command limit are generated from the native constants (`FILE_TOOL_NAMES` and siblings, spliced by `ts_capture_policy_v1`), and the TS marker reader honours every TOML spelling of the capture table toml_edit does (dotted `capture.ignore_paths`, quoted or spaced `[capture]` headers) and fails closed on the shapes it rejects (inline table, `[[capture]]`, `[capture.x]`, a second definition) (`captureTomlKey` and the `captureConfigAt` section loop), tracks every multi-line array so a line inside one (`["docs"]`) is never a header, and fails closed on a line that is neither header nor key/value, a key line swallowed by an open array, text after a continued array closes, or an inline table left open at a line end (`captureValueScan`); the TS glob walk reads a directory one entry at a time with `opendirSync`, stopping at the entry bound; in a Windows session a shell argument or `workdir` that is drive-relative (`C:docs\x`, a bare `C:`) or a device path naming no drive or share (`\\?\GLOBALROOT\…`, `\\.\HarddiskVolume3\…`) makes the command metadata-only, a POSIX shell's reading of a placeable native path (`C:\repo\x` read as `C:repox`) excused and a device reading never (`windows_unplaceable`, `match_command`, the `workdir` check in `inspect`; TS `captureWindowsUnplaceable`, `captureMatchCommand`, `captureDecide`); a PowerShell `FileSystem::`/`Microsoft.PowerShell.Core\FileSystem::` provider prefix is dropped before a Windows path is read (`strip_powershell_provider` in `candidate_raw`/`command_base`; TS `captureStripProvider` in `captureResolve`/`captureBase`); a POSIX absolute pattern in a Windows marker makes the marker invalid (`compile`; TS `captureConfigAt`) (GHSA-gcpc-88hm-3xqr); server re-inspection compiles an Active never-match sentinel in the cwd's path flavor (`inspection_sentinel`, `capture_inspector`) (#1250); an unknown-family tool event keeps no arguments or output, and stores its MCP server and tool names only when the whole name passes `[A-Za-z0-9_-]` within 64 characters, so no path-bearing text can bypass `ignore_paths` (#1522) | `capture_policy.rs` per-agent `…honors_exclusions` tests, `shell_fixture_vectors` (shared `capture-policy.json` `shell` drop/keep vectors: tool aliases incl. OpenClaw/Devin `exec` and `PowerShell`, `workdir`, glob directories, Windows paths, and a POSIX-host leading-`//` command via `/{root}/docs/adr/x.md`), `shell_tool_shapes_of_every_adapter_honor_exclusions`, `claude_code_powershell_honors_ignored_paths_on_a_windows_host` (#1186: Windows-spelled and `-Param:value` paths drop, public-path and `git status` controls kept, invalid marker metadata-only), `gemini_cli_shell_and_read_many_files_honor_ignored_paths` (Gemini `run_shell_command` incl. `dir_path`/`directory`, and `read_many_files` globs via `match_globs`: excluded literal, mixed public+excluded, `docs/*`, recursive `**` and case-variant entries drop, an `exclude` list cannot rescue them, unsupported glob syntax and malformed lists are metadata-only, public entries kept, POSIX and Windows hosts) and `globstar_reaches_lets_double_star_span_any_depth`, `fixture_vectors` (incl. TS-adapter `bash`/`exec` vectors, and `normalization`'s leading-`//` POSIX vectors alongside the kept Windows-cwd UNC vectors as the no-regression control); `shell_matching_is_off_when_inactive_and_fails_closed_when_invalid_or_over_budget`; `router.rs` `capture_protocol_shell_decisions_survive_server_reinspection`, `capture_protocol_invalid_marker_shell_is_metadata_only` (active metadata-only shell admitted for an unevaluated expansion, inactive refused, older client's invalid-marker keep stripped, commandless control kept), `capture_protocol_unparseable_marker_strips_shell_events` (server fallback for an unparseable marker), `capture_protocol_invalid_shell_metadata_claim_must_be_canonical` (a stripped shell claim with a path count or non-`extracted` state is refused), `capture_protocol_active_keep_on_a_windows_cwd_keeps_provable_bodies` (#1250: a kept Read and Bash on `C:\repo` and a UNC cwd stay Keep; brace-expansion still metadata-only); `capture_policy.rs` `invalid_marker_strips_shell_calls_with_unparseable_commands`, `long_bash_lc_script_in_argv_is_not_dropped_by_the_match_budget`, **`a_leading_double_slash_candidate_does_not_escape_posix_ignore_paths_via_flavor_mismatch`** (GHSA-vh98 adversarial: attempts the `//repo/secret/...` violation on a POSIX host, proves it now drops, with a plain-single-slash control and a Windows-hosted genuine-UNC control both still correct — fails on the pre-fix code); `hook.rs` `shell_command_reading_an_ignored_path_is_dropped_before_spool`, `gemini_cli_shell_and_read_many_files_exclusions_drop_before_spool` (pre- and post-tool events with an excluded path are never spooled; public controls spool with their family); `capture_policy.rs` `read_many_files_directory_entries_cannot_reach_ignored_paths` (shared `read_many_files_directories` vectors: `docs`, `.`, `./`, `docs/`, case and `..` variants drop; `src`, `README.md`, `docs/adrx` kept), `output_reader_tools_are_metadata_only_only_under_a_policy` (active and invalid strip, inactive and an unrelated unknown tool keep), `copilot_cli_runtime_file_tools_are_scoped_to_copilot`, `unevaluated_shell_expansions_respect_quoting` (also leading-`]` classes, zsh groups and extglobs, ANSI-C numeric escapes; subshells, `$((…))`, `<(…)`, array assignments kept), the shell fixture's brace/class vectors (quoted, escaped, `${…}`, `{}`, `[ … ]`, `HEAD@{1}` controls kept); `quoted_scripts_in_string_commands_are_read_like_command_lines` (`sh -c`, `timeout … bash -c`, `"$(…)"`, `NAME="$(…)"`, backquotes, two nested shells and an inline-interpreter literal drop; `bash -c 'cargo test'` and `"$(git rev-parse HEAD)"` kept; four levels read, a fifth metadata-only), `inline_interpreter_code_is_metadata_only_under_an_active_policy` (inline code metadata-only, kept with no policy; modules, script files and `grep -e` unaffected), `git_object_names_are_path_candidates` (`HEAD:`, `:`, `:N:` and `@{n}` names drop, also from a subdirectory; drive letters, URLs, `NAME=a:b` and flags are not object names; a public object name kept), `ansi_c_strings_and_escaped_letters_are_read_like_the_shell`, `antigravity_run_command_resolves_arguments_from_its_cwd` (absolute and relative `Cwd` drop, a public `Cwd` kept, another agent's `Cwd` key ignored), `windows_escape_characters_are_read_on_a_windows_host` (caret and backquote spellings drop on a Windows host, public controls kept, a POSIX host reads both literally), `a_case_folding_host_matches_paths_without_regard_to_case` (file tool and shell drop with folding, keep without, public control kept; folding injected through `resolve_for_host` so it runs on every CI OS), the shell fixture's continuation, PowerShell/cmd escape, option-value, runner, interpreter, glued-flag, `file:` URL, tilde, parameter-default and `fold_case` vectors with their controls, the near-miss controls added to `common_commands_stay_kept_under_an_active_policy` (also quoted tildes, a `file:` URL with a query, a shallow nested default and a scratchpad log), the shell fixture's `file:` query/fragment, deep-default, escaped-default, quoted/argv/script tilde, PowerShell tilde, harness-output and Unicode `fold_case` vectors and the `decisions` harness-output vectors with their controls, `reading_a_harness_output_spool_is_metadata_only_under_a_policy` (active and invalid strip, inactive keeps, same-named files elsewhere kept, an ignored path still drops), `capture_lookup_locations_name_every_path_a_call_spells`, the Unicode rows of `a_case_folding_host_matches_paths_without_regard_to_case`, **`hook.rs` `another_checkouts_exclusions_hold_for_a_call_made_elsewhere`** (relative, absolute, glob and unmarked-Hermes shell calls naming another checkout's excluded file never spool; a broken foreign marker and too many foreign markers spool metadata-only; public, own-file and few-marker controls spool with content), **`hook.rs` `globs_searches_and_unreadable_targets_answer_to_another_checkout`** (sibling and parent-folder `*`, brace, bracket, `**` and separator-spanning-brace shell globs, a Grep path, a Glob pattern, a parent-folder Grep filter, a Gemini `search_file_content` directory, a Codex `apply_patch` header and a target-less Read never spool content; public-glob, own-glob, own-`**`, own-search, own-Glob-`**`, public-search and own-patch controls spool with content), `transcript_capture.rs` `globs_and_searches_reaching_another_checkout_honor_its_policy`, `capture_policy.rs` `glob_walk_follows_every_segment_a_glob_could_pass_through`, `an_invalid_policy_makes_a_search_metadata_only`, `a_brace_that_builds_a_parent_step_cannot_be_walked`, `a_parent_step_after_a_globstar_is_read_both_ways`, `glob_groups_and_ansi_c_escapes_reach_the_marker_lookup`, `a_saved_output_glob_needs_its_distinctive_name_in_literal_text`, `indented_patch_headers_and_hermes_file_globs_reach_the_marker_lookup`, `a_dot_glob_directory_that_can_match_the_parent_is_read_as_it` (POSIX classes and extglob groups included), `an_oversized_brace_expansion_is_walked_unless_its_pieces_could_leave` (each attack with its control), the shell fixture's double-quoted `bash -c`/`eval` ANSI-C vectors and their controls, `marker.rs` `marker_memo_answers_like_find_marker_once_per_directory`, **`hook.rs` `a_globstar_above_the_checkout_skips_the_own_subtree`** (regression: `ls ../**/README.md` from a 300-directory checkout with no policy is not metadata-only; the sibling `cat ../**/secrets.env` drops), **`hook.rs` `marker_lookups_in_a_deep_tree_cost_one_probe_per_directory`** (regression: 300 paths in a 300-level tree cost fewer than five probes per level; out of budget inside the checkout kept, outside it metadata-only, the sibling checkout's location looked up before a long list inside the checkout, and a shallow nested marker before a deep list), **`hook.rs` `a_dotfiles_checkout_at_home_is_not_the_own_checkout`** (with `~/.git`, `cat */secrets.env` from `~/Projects` drops; a harmless glob kept), the shell fixture's dot-glob directory vectors and their controls, the shell fixture's `**`-then-`..` and `*.log` vectors and the `read_many_files_directories` `**`-then-`..` vectors, **`hook.rs` `constructed_parent_steps_answer_to_another_checkout`** (a `..` after a `**` through a shell, a Glob pattern and a Grep filter, four brace expansions that build a parent step, two zsh glob groups, hex and octal ANSI-C escapes, two dot-glob directory segments, a POSIX-class and four extglob dot-glob segments, a brace-built dot-glob, an oversized brace sequence over `.`, ANSI-C strings in a double-quoted `bash -c` and `eval`, an indented `apply_patch` header next to an unindented one and a Hermes `file_glob` never spool content; the same shapes inside the checkout spool with it, and so do four brace expansions too large to list that cannot leave it, which v2.6.3 kept), **`hook.rs` `a_monorepo_glob_inside_the_own_checkout_is_not_walked`** (in a 300-package checkout, with and without a policy of its own, `packages/*` shell globs stay kept and the sibling `../*/secrets.env` and `../a/*.env` attacks still drop), `hook.rs` `a_glob_walk_outside_the_checkout_stops_at_its_bounds` (directory bound counted while a `**` lists, time budget through an injected clock, no walk inside the checkout), the Node evidence test's `monorepo-*`, `walk-*`, `con-*`, `globstar-*`, `deep-*` and `dotfiles-*` checks, and the Node evidence test's `glob-*`, `search-*`, `patch-*` and `unreadable-target` checks with their controls and `transcript_capture.rs` `a_shell_command_naming_another_checkouts_file_honors_its_policy`, both failing with the foreign lookup disabled, and the Node evidence test's `cross-*` and `fold-unicode` checks, which fail with `captureForeignConfigs` disabled, and the shell fixture's quoted-script, git-object, ANSI-C, escaped-letter and inline-interpreter vectors with their controls (`cargo test`, `git status`/`log`, `pytest`, `python3 -m pytest`, `node build.js`, `npm run test`, a quoted commit message with braces); `router.rs` `capture_protocol_active_keep_of_unprovable_output_is_stripped`; `hook.rs` `excluded_content_cannot_reach_the_spool_through_unevaluated_tool_shapes` (directory entries and Copilot `view`/`create` never spool, readers and brace shells spool without content, public controls spool with it); `capture_policy.rs` `droid_tool_calls_honor_capture_exclusions` (`Read`/`Create`/`Edit` naming an ignored path drop and a control path keeps, `ApplyPatch` is metadata-only like Codex `apply_patch` and its headers name the lookup location, `LS`/`Grep`/`Glob` drop and their directory and glob arguments locate the call, `Execute` naming an ignored path drops; every excluded case keeps under `AgentKind::Other`, so it fails with the Droid `extract` arm or the `Create`/`ApplyPatch` mapping removed) and the `droid` `decisions` fixture vectors (#1240); `capture_policy.rs` `muse_tool_calls_honor_capture_exclusions` (`read_file`/`write_file`/`edit_file` naming an ignored path, relative or absolute, and the project-scope memory tools naming an ignored `.agents/memory` path drop while a control path keeps, personal-scope memory calls are metadata-only, `apply_patch` is metadata-only like Codex's, `search` drops, `bash`/`monitor` naming an ignored path from their `workdir` drop, `bash_input` is metadata-only; each excluded case keeps under `AgentKind::Other`, so it fails with the Muse `extract` arm removed), `muse_tool_payload_fields_carry_the_call_id` and the `muse` `decisions` fixture vectors, taken from Muse Code 1.4.7 hook payloads; `capture_policy.rs` `codebuddy_tool_calls_honor_capture_exclusions` (`Read`/`Write`/`Edit`/`Bash` naming an ignored path drop, a control path keeps, and every excluded case keeps under `AgentKind::Other`, so it fails with the CodeBuddy `extract` arm removed) and the `codebuddy` `decisions` fixture vectors; `render_shared.rs` `generated_capture_policy_v1_node_runtime_evidence` (runs the same fixture sections, including the GHSA-vh98 and Gemini `read_many_files`/`run_shell_command` vectors, plus unsupported-glob, empty-list and recursive-`**` checks, against the emitted TypeScript; `#[ignore]` locally, run with `--ignored` under Node 24 by the Linux CI test job); `hook.rs` `check_capture_refuses_partial_scope_and_excluded_content` (ignored-path and partial-scope violations refused, complete public-path control passes), `check_capture_bounds_marker_hints_and_refuses_oversized_scope` (513-byte hints refused, 512-byte control passes; native routing preserved); **`backfill.rs` `backfill_never_posts_tool_content_the_capture_policy_excludes`** (planted Claude transcript: the excluded read's call and output never reach `/hook/batch`, a malformed read posts only the metadata-only body, public read control posted) and **`run.rs` `ledger_upload_drops_tool_content_the_capture_policy_excludes`** (excluded call and output absent from the finish request, public control present, cursor still advances), both failing with the guard removed; **`recovery.rs` `finish_failed_recovery_never_posts_content_the_capture_policy_excludes`** and **`degraded_run_recovery_never_posts_content_the_capture_policy_excludes`** (a full `recover` pass over a journaled Claude transcript with exact digests and cursor, marker `ignore_paths = ["secrets/**"]`: the excluded read's path and `SENTINEL_RECOVERY_MUST_NOT_POST` output never reach `/workstream/runs/{id}/recover` or `/hook/batch`, the public read's output does; each fails when its own call site's capture is built for `/` instead of the entry's `cwd`, on the control since a foreign-scoped capture fails closed, and both fail on the sentinel when `for_checkout` loses the marker's policy); `transcript_capture.rs` `an_excluded_read_drops_its_call_and_result_by_id`, `id_less_results_take_the_strictest_call_of_their_turn`, `unrecoverable_arguments_and_orphan_results_fail_closed_under_a_policy`, `a_call_into_another_checkout_honors_its_policy`, `ledger_events_are_dropped_or_stripped_before_upload`, `without_a_policy_every_event_is_kept` (control); `capture_policy.rs` `tool_call_payload_reaches_the_live_decision_for_every_supported_agent`; **`backfill.rs` `allowlist_mode_backfills_nothing_from_an_unmarked_checkout`** (no request reaches the server; marked-checkout and denylist controls do), **`run.rs` `ledger_upload_under_allowlist_mode_carries_nothing_from_an_unmarked_checkout`** (finish carries no prompt or tool content; marked and denylist controls upload both), `transcript_capture.rs` `allowlist_mode_admits_nothing_from_an_unmarked_checkout`, all failing with the admission gate removed; **`backfill.rs` `backfill_inspects_codex_exec_command_as_the_hook_shell_call`** and **`run.rs` `ledger_upload_inspects_codex_exec_command_as_the_hook_shell_call`** (a planted Codex `exec_command` whose `workdir`-relative argument names an ignored file never posts its call or output; the same command from a public `workdir` does), `capture_policy.rs` `codex_transcript_exec_command_is_inspected_as_the_hook_bash_call` (absolute, relative and absent `workdir` and an argv `cmd` drop, public control kept, the `workdir` locates the call, another agent's `exec_command` stays unknown), all failing with `hook_tool_call` removed; **`backfill.rs` `backfill_resolves_each_call_from_its_record_cwd`** (`cat adr/x.md` recorded from `docs/` never posts; the same command from the root does) and `transcript.rs` `jsonl_events_carry_their_record_cwd` (Claude per line, Codex per turn context, a relative cwd ignored), failing with the record cwd ignored or unstamped; **`backfill.rs` `backfill_drops_reroutes_the_live_hook_would_not_deliver_here`** (under allowlist mode, reads rerouted to an unmarked git repository, to a marker selecting an unregistered profile, and to a marker selecting a registered profile while the source uses the install default are never posted; a read in a marked checkout with no server selection is the posted control), failing with either the admission check or the route comparison removed (each refused case checked on its own); `transcript_capture.rs` `a_record_cwd_answers_to_the_hook_admission_gate_there` (prompt, call and result recorded in an unmarked repository drop under allowlist; a subdirectory of the opted-in checkout is kept and its record cwd never reaches the ledger) and `claude_shell_mode_output_is_not_imported` (stdout, stderr, local-command and size-capped blocks drop; `<bash-input>`, a prompt quoting a tag, and another agent's message kept); **`backfill.rs` `backfill_posts_no_content_for_unrecognized_tools`** (a planted Codex MCP call's arguments and output never post, the call and output post as `tool unknown`; a recognized shell output is the posted control) and `transcript_capture.rs` `unrecognized_tools_keep_no_content_with_or_without_a_policy` (no policy and an active one; ledger content withheld; public read kept; a call-less result content-free), failing with the unknown-family rule removed, the backfill one also with its content-free body removed; **`backfill.rs` `backfill_keeps_reroutes_to_the_same_server_profile_only`** (a reroute into a checkout selecting the source's registered profile and project is posted; one selecting a different registered profile is not, nor one of another project on the same profile, nor a prompt recorded there), failing with the profile comparison forced either way and with the project comparison removed; `transcript_capture.rs` `a_record_cwd_in_another_project_is_dropped` and `a_reroute_into_another_project_is_dropped` (prompt, call and result recorded in, or a read reaching into, a checkout declaring another project drop; one declaring the same project is kept), failing with `routes_to_same_project` removed; `hook.rs` `subdirectories_of_one_repository_are_one_project_only_under_repo_root` (two subdirectories of an unmarked repository, and a subdirectory importing its root, are two projects; the same directory, the root importing a subdirectory and a `repo-root` marker agree), failing with the basename rule removed; **`backfill.rs` `backfill_posts_no_task_notification_or_compact_summary_as_a_prompt`** and `transcript.rs` `claude_adapter_keeps_task_notifications_and_compact_summaries_out_of_prompts` (a monitored command's notification, a background agent's report and an origin-tagged notice are excluded, also behind a byte-order mark and zero-width characters, in another case, with attributes, after a non-text block, or with an origin kind in another case; a compact summary, also flagged `"true"` or `1`, becomes a compaction event; the typed prompt, also one quoting the tag, and a look-alike tag are the controls), failing with either adapter rule removed or with the spelling rules reverted; `transcript_capture.rs` `boundary_events_answer_to_the_record_cwd_admission_gate` (compaction and annotation recorded in a refused directory drop; in the checkout kept), `a_result_whose_id_matches_no_call_is_an_orphan` (an unmatched id cannot borrow a public read's keep; the read's own result kept), `claude_shell_mode_output_is_not_imported` (a block holding a literal closing tag drops) and `unrecognized_tools_keep_no_content_with_or_without_a_policy` (ledger keeps no tool name and no invalid call id), each failing with its rule reverted; `windows_spelling_fixture_vectors` (shared `capture-policy.json` `windows` drop vectors for every spelling above, file tool and shell, with other-drive, other-share, longer-name and pipe controls, and `windows_posix_controls` proving a POSIX session keeps `/c/…`, trailing-dot and colon names; `windows_scopes` drop vectors for a `\\?\C:\`, `\\?\UNC\…`, `\\localhost\C$\…` or UNC cwd and marker directory with relative patterns, a `\\?\C:\…` absolute pattern from `C:\repo`, bare and double-quoted `\\server\share\…`/`\\?\…`/`\\.\…`/`\\localhost\c$\…` PowerShell, cmd, `run_shell_command` and argv commands, and both readings of `/a/x` from `D:\a\…`, each with public-path, other-drive and other-share keep controls; the Node runtime evidence runs the same vectors with the marker spelled in the Windows cwd), `tool_family_fixture_vectors` (shared `tool_families`, every native name per family), new `decisions` vectors (`execute_code` metadata-only, `read_file`/`patch`/`fs_read` operations drop, `write_to_file`/`browser_navigate` keep), `output_spool_work_is_linear_and_budgeted` (a 2,040-wildcard-segment path stays under a linear work bound; 32 such paths fail closed; one long or 32 short paths keep), `an_oversized_shell_command_is_unprovable` (one character over the limit is metadata-only and unlooked-up, at the limit keeps, argv summed, inactive untouched), `inline_code_tools_are_unprovable_under_a_policy`, `hook_capture::capture_section_spellings_match_toml_semantics` (shared `marker_spellings`, including a nested-array line `["docs"]` before a dotted `capture.ignore_paths` that must still drop, and a key line inside an open array, text after a closed array and a multi-line inline table that must fail closed), and the Node evidence test running all of these vectors against the generated TypeScript plus its entry-bound read count for the directory walk; each fails with its rule reverted (Windows reading off, spool memo dropped or budget failing open, length check off, inline-code rule off, a name dropped from the list, TS dotted key or inline-table rule reverted, TS walk back on `readdirSync`, Windows reading of the cwd/marker directory or of an absolute pattern off, literal-backslash reading off, the cwd-drive reading of `/a/x` off, TS array tracking or any `captureValueScan` refusal off, Rust and TS alike); new `windows_scopes` vectors (drive-relative, device-namespace and Git Bash doubled-backslash shell words and a `C:docs` `workdir` metadata-only, `FileSystem::` file paths, shell words and `workdir` dropping, a POSIX absolute pattern in a Windows marker failing closed, with `type README.md`, `dir /s /q`, `git status`, a URL, `type C:\repo\README.md` and `Get-Content -Path C:\repo\README.md` kept) and `windows_marker_rejects_posix_absolute_patterns` (the same pattern stays active in a POSIX marker) fail natively and in the Node evidence test with the unplaceable check, its device branch, the `workdir` check, the provider strip or the marker rejection removed; `inspection_sentinel_matches_cwd_flavor` (#1250: POSIX sentinel Invalid on a Windows cwd, Windows-flavored sentinel Active there and on UNC, POSIX sentinel Active on `/repo` and Git Bash `/c/repo`) is native only, since `inspection_sentinel` is server re-inspection with no TypeScript counterpart, and fails with the cwd-flavored sentinel or the marker rejection removed; removing the POSIX-reading excusal makes `type C:\repo\README.md` metadata-only, and excusing a device reading keeps the doubled-backslash device path; `capture_policy.rs` `windows_lookup_locations_keep_glob_segments_whole` (a Windows session trims trailing dots from plain segments only, so `{.,}.` still reaches `..` and the sibling checkout's marker; bites with the glob-segment exemption removed) `names_outside_the_mcp_shape_keep_no_tool_identity` (#1522). | STRONG with listed residuals. Matching is lexical by design, so these stay open: shell variables (`$VAR`, `FILE=… sh -c 'cat $FILE'`) and the output of a command substitution, a `cd` inside the command, a script read from a file or a heredoc fed to an interpreter (read only for the words it spells out), git's repository root approximated by the marker directory, symlinks (paths are never resolved on disk), a recursive search of a parent directory (`grep -r x docs`, `rg x`) through a shell, a search tool rooted at a literal directory above another checkout (it is not walked) and a glob whose literal root lies inside the event's own checkout reaching a checkout nested there (it is not walked), a marker nested inside the own checkout below what the lookup budget reaches, a `.git` the same command creates (`touch .git; cat */x`: the hook reads the tree after the command ran, so that directory counts as the own checkout; a `.git` at or above the home directory never does), a parameter expansion next to glob syntax (`${X}/*/x`, not walked), a glob through a symlinked directory, a tool's own directory option (`git -C`), script runners and interpreters the matcher does not list (their words are still read, but expansion or inline code in them is not recognized), a value glued after the first letter of a short-flag cluster, non-ASCII percent-escapes in a `file:` URL, a bare word naming another checkout's directory (only separator-bearing arguments are looked up for another marker), harness output files outside the listed default locations, and tools the matcher does not list, which keep their current unknown-tool behavior. Transcript imports add: assistant prose quoting an excluded file is kept (as live prompt/assistant capture keeps it), harnesses whose hook schema the matcher does not read (Crush, Kimi Code) keep their tool events as live capture would, adapters that record no per-record cwd (Pi, OMP, OpenCode, Crush, Kimi Code, Command Code, Kiro, Grok) judge every event from the session cwd, a Codex ledger upload resumed from a mid-file cursor judges the events before the next turn context from the session cwd, and id-less adapters over-drop a whole turn's results when one call is excluded, and when the routing hints leave the project to the server, events from inside one repository count as the importing project even where the server has a separate project registered for a subdirectory (anywhere under `repo-root`; under `basename` only when the import runs from the repository root); a metadata-only import keeps an `event_id` (ledger) and `ingest_key` (backfill) derived from a SHA-256 of the original content plus session and record ids, left in place because those ids are the retry-dedupe keys and a content-free id would merge distinct events — it only confirms a guess of low-entropy content. Under allowlist mode a refused checkout's `ai-memory run` still records repository checkpoint metadata (HEAD, branch, a status hash and changed-path names, never file content), which the run also sends at launch. Re-splitting quoted words over-drops a quoted message naming an ignored path, and inline interpreter code is metadata-only under an active policy. Mitigation: allowlist capture mode (`install-hooks --capture-mode allowlist`) for sensitive projects. Bite checks: removing the nested re-split, the git object path or its marker-root base, Antigravity's `Cwd` key, the leading-`]` rule, either zsh-group rule, ANSI-C decoding or its numeric-escape rule, the `\o` reading, the inline-code rule, the nesting-depth rule, the nested-script scan, the line-continuation join, the Windows escape reading, the shell-option and interpreter-option value skips, the added runners and interpreters, the glued-flag value, the `file:` URL path, the `~+` resolution, the unknown-tilde rule, the parameter-default reading or case folding each fails the Rust tests, and each TypeScript counterpart fails the Node evidence test; so does reverting the `file:` URL cut, the deep-default rule, the escaped-default reading, the quoted-tilde rule, the harness-output rule or Unicode folding (the new fixture vectors fail against the previous matchers in both languages), and disabling the foreign-marker lookup fails the native, import and Node cross-checkout tests; reading every glob location as literal, skipping search/list locations, or skipping a file tool whose targets cannot be read each fails the native, import and Node glob/search/unreadable tests, removing `apply_patch` header reading fails the own-patch control, and reverting the saved-output glob rule fails the new fixture vectors in both languages; walking globs rooted inside the event's checkout fails the monorepo tests, accepting any literal text for a saved-output glob fails the `*.log` vectors, removing the time budget or counting a `**`'s directories only after it lists fails the bounds tests, and removing the `**`-then-`..` readings, the brace-expansion check, the expanded lookup words, the patch-header trim, the `file_glob` key or the dot-glob parent reading each fails the Rust tests and the Node evidence test; treating every oversized brace expansion as leaving, dropping the brace-built dot-glob check, listing the own checkout's subtree under a `**`, looking up locations in their given order (outside before inside, then shallowest first), dropping the per-directory memo, counting a checkout at home as the own one, keeping the backslash before `$` in double quotes, or dropping the POSIX-class or extglob reading each fails its Rust test and the Node evidence test; in a Windows session a shell `workdir` spelled `/c/x` is read only as Git Bash reads it, so arguments resolved from it miss a native tool's `D:\c\x` reading, the TS marker reader rejects structural errors anywhere in the marker but does not validate other values' TOML (`x = nope` invalidates the policy only natively), an administrative share reached through a loopback or host alias other than `localhost`/`127.0.0.1` (`\\127.0.0.2\c$`, `\\127.1\c$`, `\\<hostname>\c$`) or a `\\wsl$\…` path is matched as the UNC path it spells, Windows matching folds ASCII case only, and a drive-relative word counts as placed when a placeable argument's POSIX reading spells it; a `**/` matches one or more directories, never zero (documented in `marker-file.md`) |+| 11b | Capture exclusions drop before storage | `ai-memory-hooks` `capture_policy.rs` `extract` reads each adapter's own field names — DSH's Claude Code-shaped `tool_name`/`tool_input` pair included, so a DSH file, search or shell call classifies instead of staying `Unknown` — and `inspect`→`Drop` (before semaphore/spawn), including shell commands whose arguments name an ignored path (`match_command`; argv elements matched whole and tokenized, and every word that holds several words, such as a quoted `sh -c` script or a `"$(…)"` substitution, re-split to four levels by `ShellCommand::split`/`push_nested_words`, a deeper script metadata-only; ANSI-C strings decoded and a backslash before an ordinary letter dropped (`shell_words`, `push_word`); backslash-newline continuations joined (`shell_words`); a parameter default's operand, a value glued to a short flag and a `file:` URL's path read as candidates (`parameter_operands`, `shell_arguments`, `file_url_path`); PowerShell and cmd escape characters read out under the `PowerShell` tool or on a Windows host (`without_windows_escapes`); `~+` resolved to the cwd and a `~-`/`~N`/`~name` prefix metadata-only (`names_unknown_directory`); shell and interpreter options that take a value skipped while looking for a `-c` script or inline code (`takes_shell_value`, `runs_inline_code`, which also lists `lua`/`Rscript`/`osascript -e`, and `su -c`/`script -c` as script runners); paths compared without regard to case on a macOS host (`fold_case`, set by `resolve`; patterns and candidates composed to NFC and lowercased in full by `fold_path`, TS `captureFold`; client-only, the server's sentinel re-inspection never depends on it); a `file:` URL cut at its query or fragment before decoding (`file_url_path`); a parameter default nested past four levels metadata-only and a default read again after backslash removal (`parameter_operands`, `push_word_reading`); a tilde expanded or treated as an unknown directory only when the shell expands it, unquoted and in a script rather than a quoted message or argv element, every tilde under PowerShell (`marked_shell_words`, `literal_tildes`, `expand_tilde`); a file or shell read of a harness's saved tool output, or a glob that could match one, metadata-only under an active policy (`output_spool`: Claude Code `tool-results/` and `tasks/*.output`, OpenCode `tool-output/`, Pi `pi-bash-*.log`; glob segments fit a name they share a match with, `globs_intersect`, TS `captureGlobsIntersect`, and one fitting segment must spell three characters in a row of that name's distinctive text literally, `spells`, TS `captureSpells`, so `*.log` is not read as `pi-bash-*.log`, a trade-off that leaves a glob with no such literal run, `/tmp/p?-b*`, outside the rule; the TS matcher applies it to `read_many_files` entries too); every other marker governing a file-tool target (an `apply_patch`'s header paths, read after leading whitespace, `patch_paths`), a search/list tool's directory, file or path-like glob argument (`search_scope`, Hermes `file_glob` included; a grep `pattern` is not read) or a separator-bearing shell argument also inspects the call, found by the lexical marker walk from each location's nearest existing directory, each directory's answer remembered for every lookup that passes it (`marker.rs` `MarkerMemo`, TS `captureMemoMarker`, seeded with the event's own walk, `remember`, TS `captureMemoRemember`), bounded (4,096 locations, 16 markers, and 16,384 probes sharing the glob walk's 50 ms, `MAX_LOOKUP_PROBES`, TS `CAPTURE_MAX_LOOKUP_PROBES`; locations outside the own checkout are looked up first, a glob's literal root before the walk below it (whose single listing can spend the time budget on a large directory), and past a bound fail closed as under an invalid policy, while running out inside the own checkout, whose locations are looked up shallowest first, ends the lookup, its own policy governing there) and combined strictest-first (`capture_lookup_locations`, `CaptureDecision::stricter`, `hook.rs` `foreign_capture_decision`, also applied by `transcript_capture.rs` `decide_call`; TS `captureForeignConfigs`, `captureDecide`, `captureSearchScope`, `capturePatchPaths`); a location with glob syntax is looked up from its literal root and, when that root lies outside the event's `.git` checkout, every directory the glob could pass through is checked for a marker (`glob_walk`, `hook.rs` `GlobBudget::markers_below`; TS `captureGlobWalk`, `captureMarkersBelow`, `captureOwnCheckout`: a `*`/`?` segment lists the child directories it matches, a class/brace/group every child, a `**` the subtree except the event's checkout's; a glob rooted inside the event's checkout is not walked; a checkout root at or above the home directory, or the filesystem root, is never the own checkout for these rules (`own_checkout`), so a dotfiles `~/.git` does not stop the walk from `~/Projects`; symlinks never followed; 256 directories, counted as a `**` lists, 32,768 entries and 50 ms, `MAX_GLOB_TIME`, TS `CAPTURE_MAX_GLOB_MS`, injectable clock, past which, or for a brace/group spanning a separator, a `..`/`~` alternative or one a bounded brace expansion builds, `brace_alternatives`, TS `captureBraceAlternatives`, a directory alternative bash before 5.2 expands to `..` (`.{*,x}/`), or an expansion too large to list whose pieces could build one of these (`brace_overflow_could_leave`, TS `captureBraceOverflowLeaves`: integer and letter sequences cannot, so `file{1..200}.txt` is walked like any glob), the call fails closed); a `..` after a `**` is read both as the `**` matching no directory and as matching some, by the event's own matcher and the lookup (`normalize_readings`, TS `captureReadings`, at most 16 readings, past which the call fails closed), and so is a directory segment that bash before 5.2 can expand to `..` (`could_name_parent`, `class_glob_matches` with POSIX classes such as `[[:punct:]]` and extglob groups such as `@(.)`, `?(.)`, `*(.)`, `+(.)`, `!(x)`; TS `captureCouldNameParent`, `captureClassGlob`, `captureNamedClass`), read as `..` too; inside double quotes a backslash before `$` or a backquote is dropped, so a quoted script (`bash -c "…"`, `eval "…"`) re-split for its words reads an ANSI-C string as the shell it runs does (`shell_tokens`, TS `captureMarkedWords`); a zsh glob group kept in its word and ANSI-C numeric escapes decoded are fed to the lookup (`shell_tokens` with `expand`, `ShellWords::expanded`, `glob_group`, `ansi_c_numeric_escape`; TS `captureMarkedWords(…, true)`, `captureGlobGroup`, `captureAnsiNumeric`); a file tool whose targets cannot be read or resolved, and a search/list argument that is not a string, fail closed; the path of a git `REV:path` object name tried from the cwd and the marker directory (`git_object_path`); Antigravity `run_command` resolved from its `Cwd`); an invalid marker makes file, search/list and shell calls metadata-only; an active one makes a shell call metadata-only when a word uses unquoted brace expansion, a bracket class (a leading `]` included), a zsh glob group or extglob, or a numeric/control ANSI-C escape (`has_unevaluated_expansion`, also run on scripts given to `sh -c`, `eval` or a substitution), or when it runs inline interpreter code (`runs_inline_code`: `python -c`, `node -e`, `ruby -e`, `perl -e`, `php -r`, `deno eval`), and either makes tools that read back an earlier command's output metadata-only (`reads_earlier_output`: `BashOutput`, `TaskOutput`, `write_stdin`, `process`, `read_bash`/`write_bash` and PowerShell twins); the server admits a metadata-only shell or unknown-family body only under an active or invalid marker, with no paths and an `extracted` state (`router.rs` `metadata_protocol_is_legal`), and its own re-inspection strips an older client's keep for either; a Gemini `read_many_files` literal entry is also read as `entry/**` (`glob_matches_below`), and Copilot CLI's runtime `view`/`create`/`str_replace_editor` are file tools for that agent only (`agent_family`); Factory Droid's Claude-shaped payload is read by `extract`, its `Create` and `ApplyPatch` are file tools for that agent only (`agent_family`), `ApplyPatch` reads its `input` envelope like Codex `apply_patch`, and its `LS` `directory_path`, `Glob` `folder`/`patterns` and `Grep` `glob_pattern` locate the call for the cross-checkout lookup (`search_direct_paths`, `search_scope`) (#1240); Meta Muse Code's Claude-shaped payload is read by `extract` with its `tool_use_id`, its `read_file`/`write_file`/`edit_file` `path` resolves lexically against `cwd`, its `read_memory`/`add_memory`/`edit_memory` are file tools for that agent only whose `project`-scope `path` is placed under `.agents/memory/` and whose personal scopes fail closed to metadata-only (`muse_memory_paths`), `monitor` is a shell for that agent only, and `bash_input` is an output reader for that agent only; CodeBuddy Code's payload carries Claude Code's tool names and fields and is read by the same `extract` arm (#1299); generated OpenCode/OMP/Pi/OpenClaw integrations mirror it in `render_shared.rs` `ts_capture_policy_v1` (`captureMatchCommand`, `captureShellSplit`, `captureUnevaluatedExpansion`, `captureInlineCode`, `captureGitObjectPath`, `captureGlobBelow`, the `reader` flag). Candidate/argument flavor (`Flavor::Posix` vs `Flavor::Windows`, used to pick which `ignore_paths` patterns even apply) is derived from the **host** (the cwd), never from the candidate string alone — a POSIX-host candidate spelled with a leading `//` is collapsed to a single `/` before flavor detection (`normalize_candidate`; TS `captureNormalize`'s `windowsHost` parameter, sourced from `captureHostWindows(cwd)`), fixing GHSA-vh98 (a `//`-prefixed candidate used to self-classify as `Flavor::Windows` regardless of host, matching zero POSIX patterns and being captured instead of dropped); a genuine Windows/UNC host (cwd itself windows-flavored) is unaffected; `hook.rs` `--check-capture` preflight uses the same capture policy before any spool or spawn; transcript imports (`ai-memory backfill`, including the automatic first-boot run, the `ai-memory run` ledger upload, and `ai-memory recover`'s finish-failed re-import and degraded-run replay in `recovery.rs` `recover_finish_failed`/`recover_degraded_run`, each built for the journaled checkout's `cwd`) apply the same decision table through `commands/transcript_capture.rs`: each recorded tool call is rebuilt in its agent's hook shape (`capture_policy.rs` `tool_call_payload`) and inspected by the checkout's policy, and by a reroute destination's policy too; a Drop removes the call and its result (paired by native id, else the strictest call of the turn when the result has no id; a result whose id matches no call, or with no call, follows the orphan rule: dropped under a policy, content-free without one; a record the exporter skipped for exceeding the 1 MiB per-record cap leaves a `skipped_record` annotation that counts as an orphan call of its turn, so an id-less result there fails closed, #1613), metadata-only posts the hook's metadata-only body with its protocol (backfill) or a withheld placeholder keeping only the family and a call id that passes the server's `valid_call_id` (ledger), and a shell call whose recorded arguments cannot be parsed drops; both imports also apply the hook's repository admission gate (`hook.rs` `checkout_admits_capture`: persisted capture mode, marker opt-in, readable routing marker — the same helpers the hook's own gate uses), so under allowlist mode an unmarked checkout imports nothing, prompts included: `backfill` stops before contacting the server and the run ledger finishes with no events; a tool the transcript names differently from the hook is rebuilt under the hook's name and fields (`capture_policy.rs` `hook_tool_call`: Codex `exec_command` `{cmd, workdir}` → `Bash` `{command, workdir}`); the Claude Code and Codex JSONL adapters label each event with its record's cwd (`transcript.rs` `stamp_record_cwd`, `RECORD_CWD_KEY`), from which the import resolves arguments, policy and reroutes, falling back to the session cwd, and which is removed before a ledger upload; a rerouted call, and an event whose record cwd lies outside the checkout, must pass that directory's admission gate, resolve to the same server-profile route as the checkout and to the same project scope (`transcript_capture.rs` `admits_elsewhere` → `hook.rs` `checkout_admits_capture` + `delivers_to_same_server`, which compares two `resolve_hook_route` results and never matches a refused selection, + `routes_to_same_project`, which compares the two `hook_scope` hint sets and, when they leave the project to the server, under `repo-root` the repository/marker anchor or the directory itself, under the default `basename` the directory itself or a destination inside the repository whose root is the source), else it drops with its result, since the import files every event under the importing project; compaction, checkpoint and annotation events answer to the same record-cwd checks; Claude Code `!` shell-mode output (a user message opening with a `<bash-stdout>`/`<bash-stderr>`/`<local-command-stdout>` block, whatever it holds) is dropped (`shell_mode_output`); the Claude Code adapter excludes harness-written background-task turns (`transcript.rs` `claude_task_notification`: `origin.kind` `task-notification` in any case, or a first text block opening with a `<task-notification` tag in any case, attributes allowed, after a byte-order mark, zero-width characters or whitespace) and records a compaction summary (`isCompactSummary` true, `"true"` or `1`, `truthy`) as a compaction event, which backfill does not post; a tool the matcher does not recognize (unknown family: MCP tools, Codex `view_image`, …) keeps only its family whatever the policy, as the live server stores for it (`EventCapture::Unrecognized`: backfill posts title `tool unknown` and body `tool_family: unknown`, the ledger a withheld placeholder), and so does a result with no call to inherit from ; in a Windows session every candidate, shell argument and `workdir` is read as the file Windows opens before matching (`windows_spelling`, `windows_segment`, `command_base`; TS `captureWindowsSpelling`/`captureResolve`/`captureBase`): Git Bash/MSYS2/Cygwin `/c/…` and `/cygdrive/c/…`, a drive-less rooted path on the cwd's drive, the `\\?\`/`\\.\`/`\??\` and `UNC` prefixes, the local administrative share (`\\localhost\C$`), and per-segment alternate-data-stream suffixes and trailing dots/spaces, any other device path unusable (metadata-only for a file tool); `/c/…` and `/cygdrive/c/…` are also read from the root of the cwd's drive, as a native tool reads them, and either reading matching drops (`windows_spellings`, `normalize_candidates`, `normalize_readings`; TS `captureWindowsSpellings`/`captureAllReadings`); the cwd, the marker directory, home and an absolute pattern get the same reading so every side shares one spelling (`normalize_root`, `compile`; TS `captureRoot`, the marker directory cut lexically); a Windows session also reads each shell command and argv element with every backslash literal, as PowerShell and cmd do, so a bare or double-quoted `\\server\share\…` or `\\?\C:\…` argument keeps its prefix (`literal_shell_words`, threaded through `push_nested_words`/`push_argv_item`; TS `captureMarkedWords(…, literal)`); the harness-spool check is linear in the path and charged to the match budget, past it fail-closed (`output_spool`, TS `captureOutputSpool`); a shell command over `MAX_SHELL_COMMAND_CHARS` (1 MiB) is metadata-only and its marker lookup unprovable (`ShellCommand::oversized`, TS `captureCommandOversized`); Hermes `execute_code` is metadata-only under an active policy (`INLINE_CODE_TOOL_NAMES`); the TS file/search/non-file/inline-code/output-reader tool lists and the command limit are generated from the native constants (`FILE_TOOL_NAMES` and siblings, spliced by `ts_capture_policy_v1`), and the TS marker reader honours every TOML spelling of the capture table toml_edit does (dotted `capture.ignore_paths`, quoted or spaced `[capture]` headers) and fails closed on the shapes it rejects (inline table, `[[capture]]`, `[capture.x]`, a second definition) (`captureTomlKey` and the `captureConfigAt` section loop), tracks every multi-line array so a line inside one (`["docs"]`) is never a header, and fails closed on a line that is neither header nor key/value, a key line swallowed by an open array, text after a continued array closes, or an inline table left open at a line end (`captureValueScan`); the TS glob walk reads a directory one entry at a time with `opendirSync`, stopping at the entry bound; in a Windows session a shell argument or `workdir` that is drive-relative (`C:docs\x`, a bare `C:`) or a device path naming no drive or share (`\\?\GLOBALROOT\…`, `\\.\HarddiskVolume3\…`) makes the command metadata-only, a POSIX shell's reading of a placeable native path (`C:\repo\x` read as `C:repox`) excused and a device reading never (`windows_unplaceable`, `match_command`, the `workdir` check in `inspect`; TS `captureWindowsUnplaceable`, `captureMatchCommand`, `captureDecide`); a PowerShell `FileSystem::`/`Microsoft.PowerShell.Core\FileSystem::` provider prefix is dropped before a Windows path is read (`strip_powershell_provider` in `candidate_raw`/`command_base`; TS `captureStripProvider` in `captureResolve`/`captureBase`); a POSIX absolute pattern in a Windows marker makes the marker invalid (`compile`; TS `captureConfigAt`) (GHSA-gcpc-88hm-3xqr); server re-inspection compiles an Active never-match sentinel in the cwd's path flavor (`inspection_sentinel`, `capture_inspector`) (#1250); an unknown-family tool event keeps no arguments or output, and stores its MCP server and tool names only when the whole name passes `[A-Za-z0-9_-]` within 64 characters, so no path-bearing text can bypass `ignore_paths` (#1522) | `capture_policy.rs` per-agent `…honors_exclusions` tests, `shell_fixture_vectors` (shared `capture-policy.json` `shell` drop/keep vectors: tool aliases incl. OpenClaw/Devin `exec` and `PowerShell`, `workdir`, glob directories, Windows paths, and a POSIX-host leading-`//` command via `/{root}/docs/adr/x.md`), `shell_tool_shapes_of_every_adapter_honor_exclusions`, `claude_code_powershell_honors_ignored_paths_on_a_windows_host` (#1186: Windows-spelled and `-Param:value` paths drop, public-path and `git status` controls kept, invalid marker metadata-only), `gemini_cli_shell_and_read_many_files_honor_ignored_paths` (Gemini `run_shell_command` incl. `dir_path`/`directory`, and `read_many_files` globs via `match_globs`: excluded literal, mixed public+excluded, `docs/*`, recursive `**` and case-variant entries drop, an `exclude` list cannot rescue them, unsupported glob syntax and malformed lists are metadata-only, public entries kept, POSIX and Windows hosts) and `globstar_reaches_lets_double_star_span_any_depth`, `fixture_vectors` (incl. TS-adapter `bash`/`exec` vectors, and `normalization`'s leading-`//` POSIX vectors alongside the kept Windows-cwd UNC vectors as the no-regression control); `shell_matching_is_off_when_inactive_and_fails_closed_when_invalid_or_over_budget`; `router.rs` `capture_protocol_shell_decisions_survive_server_reinspection`, `capture_protocol_invalid_marker_shell_is_metadata_only` (active metadata-only shell admitted for an unevaluated expansion, inactive refused, older client's invalid-marker keep stripped, commandless control kept), `capture_protocol_unparseable_marker_strips_shell_events` (server fallback for an unparseable marker), `capture_protocol_invalid_shell_metadata_claim_must_be_canonical` (a stripped shell claim with a path count or non-`extracted` state is refused), `capture_protocol_active_keep_on_a_windows_cwd_keeps_provable_bodies` (#1250: a kept Read and Bash on `C:\repo` and a UNC cwd stay Keep; brace-expansion still metadata-only); `capture_policy.rs` `invalid_marker_strips_shell_calls_with_unparseable_commands`, `long_bash_lc_script_in_argv_is_not_dropped_by_the_match_budget`, **`a_leading_double_slash_candidate_does_not_escape_posix_ignore_paths_via_flavor_mismatch`** (GHSA-vh98 adversarial: attempts the `//repo/secret/...` violation on a POSIX host, proves it now drops, with a plain-single-slash control and a Windows-hosted genuine-UNC control both still correct — fails on the pre-fix code); `hook.rs` `shell_command_reading_an_ignored_path_is_dropped_before_spool`, `gemini_cli_shell_and_read_many_files_exclusions_drop_before_spool` (pre- and post-tool events with an excluded path are never spooled; public controls spool with their family); `capture_policy.rs` `read_many_files_directory_entries_cannot_reach_ignored_paths` (shared `read_many_files_directories` vectors: `docs`, `.`, `./`, `docs/`, case and `..` variants drop; `src`, `README.md`, `docs/adrx` kept), `output_reader_tools_are_metadata_only_only_under_a_policy` (active and invalid strip, inactive and an unrelated unknown tool keep), `copilot_cli_runtime_file_tools_are_scoped_to_copilot`, `unevaluated_shell_expansions_respect_quoting` (also leading-`]` classes, zsh groups and extglobs, ANSI-C numeric escapes; subshells, `$((…))`, `<(…)`, array assignments kept), the shell fixture's brace/class vectors (quoted, escaped, `${…}`, `{}`, `[ … ]`, `HEAD@{1}` controls kept); `quoted_scripts_in_string_commands_are_read_like_command_lines` (`sh -c`, `timeout … bash -c`, `"$(…)"`, `NAME="$(…)"`, backquotes, two nested shells and an inline-interpreter literal drop; `bash -c 'cargo test'` and `"$(git rev-parse HEAD)"` kept; four levels read, a fifth metadata-only), `inline_interpreter_code_is_metadata_only_under_an_active_policy` (inline code metadata-only, kept with no policy; modules, script files and `grep -e` unaffected), `git_object_names_are_path_candidates` (`HEAD:`, `:`, `:N:` and `@{n}` names drop, also from a subdirectory; drive letters, URLs, `NAME=a:b` and flags are not object names; a public object name kept), `ansi_c_strings_and_escaped_letters_are_read_like_the_shell`, `antigravity_run_command_resolves_arguments_from_its_cwd` (absolute and relative `Cwd` drop, a public `Cwd` kept, another agent's `Cwd` key ignored), `windows_escape_characters_are_read_on_a_windows_host` (caret and backquote spellings drop on a Windows host, public controls kept, a POSIX host reads both literally), `a_case_folding_host_matches_paths_without_regard_to_case` (file tool and shell drop with folding, keep without, public control kept; folding injected through `resolve_for_host` so it runs on every CI OS), the shell fixture's continuation, PowerShell/cmd escape, option-value, runner, interpreter, glued-flag, `file:` URL, tilde, parameter-default and `fold_case` vectors with their controls, the near-miss controls added to `common_commands_stay_kept_under_an_active_policy` (also quoted tildes, a `file:` URL with a query, a shallow nested default and a scratchpad log), the shell fixture's `file:` query/fragment, deep-default, escaped-default, quoted/argv/script tilde, PowerShell tilde, harness-output and Unicode `fold_case` vectors and the `decisions` harness-output vectors with their controls, `reading_a_harness_output_spool_is_metadata_only_under_a_policy` (active and invalid strip, inactive keeps, same-named files elsewhere kept, an ignored path still drops), `capture_lookup_locations_name_every_path_a_call_spells`, the Unicode rows of `a_case_folding_host_matches_paths_without_regard_to_case`, **`hook.rs` `another_checkouts_exclusions_hold_for_a_call_made_elsewhere`** (relative, absolute, glob and unmarked-Hermes shell calls naming another checkout's excluded file never spool; a broken foreign marker and too many foreign markers spool metadata-only; public, own-file and few-marker controls spool with content), **`hook.rs` `globs_searches_and_unreadable_targets_answer_to_another_checkout`** (sibling and parent-folder `*`, brace, bracket, `**` and separator-spanning-brace shell globs, a Grep path, a Glob pattern, a parent-folder Grep filter, a Gemini `search_file_content` directory, a Codex `apply_patch` header and a target-less Read never spool content; public-glob, own-glob, own-`**`, own-search, own-Glob-`**`, public-search and own-patch controls spool with content), `transcript_capture.rs` `globs_and_searches_reaching_another_checkout_honor_its_policy`, `capture_policy.rs` `glob_walk_follows_every_segment_a_glob_could_pass_through`, `an_invalid_policy_makes_a_search_metadata_only`, `a_brace_that_builds_a_parent_step_cannot_be_walked`, `a_parent_step_after_a_globstar_is_read_both_ways`, `glob_groups_and_ansi_c_escapes_reach_the_marker_lookup`, `a_saved_output_glob_needs_its_distinctive_name_in_literal_text`, `indented_patch_headers_and_hermes_file_globs_reach_the_marker_lookup`, `a_dot_glob_directory_that_can_match_the_parent_is_read_as_it` (POSIX classes and extglob groups included), `an_oversized_brace_expansion_is_walked_unless_its_pieces_could_leave` (each attack with its control), the shell fixture's double-quoted `bash -c`/`eval` ANSI-C vectors and their controls, `marker.rs` `marker_memo_answers_like_find_marker_once_per_directory`, **`hook.rs` `a_globstar_above_the_checkout_skips_the_own_subtree`** (regression: `ls ../**/README.md` from a 300-directory checkout with no policy is not metadata-only; the sibling `cat ../**/secrets.env` drops), **`hook.rs` `marker_lookups_in_a_deep_tree_cost_one_probe_per_directory`** (regression: 300 paths in a 300-level tree cost fewer than five probes per level; out of budget inside the checkout kept, outside it metadata-only, the sibling checkout's location looked up before a long list inside the checkout, and a shallow nested marker before a deep list), **`hook.rs` `a_dotfiles_checkout_at_home_is_not_the_own_checkout`** (with `~/.git`, `cat */secrets.env` from `~/Projects` drops; a harmless glob kept), the shell fixture's dot-glob directory vectors and their controls, the shell fixture's `**`-then-`..` and `*.log` vectors and the `read_many_files_directories` `**`-then-`..` vectors, **`hook.rs` `constructed_parent_steps_answer_to_another_checkout`** (a `..` after a `**` through a shell, a Glob pattern and a Grep filter, four brace expansions that build a parent step, two zsh glob groups, hex and octal ANSI-C escapes, two dot-glob directory segments, a POSIX-class and four extglob dot-glob segments, a brace-built dot-glob, an oversized brace sequence over `.`, ANSI-C strings in a double-quoted `bash -c` and `eval`, an indented `apply_patch` header next to an unindented one and a Hermes `file_glob` never spool content; the same shapes inside the checkout spool with it, and so do four brace expansions too large to list that cannot leave it, which v2.6.3 kept), **`hook.rs` `a_monorepo_glob_inside_the_own_checkout_is_not_walked`** (in a 300-package checkout, with and without a policy of its own, `packages/*` shell globs stay kept and the sibling `../*/secrets.env` and `../a/*.env` attacks still drop), `hook.rs` `a_glob_walk_outside_the_checkout_stops_at_its_bounds` (directory bound counted while a `**` lists, time budget through an injected clock, no walk inside the checkout), the Node evidence test's `monorepo-*`, `walk-*`, `con-*`, `globstar-*`, `deep-*` and `dotfiles-*` checks, and the Node evidence test's `glob-*`, `search-*`, `patch-*` and `unreadable-target` checks with their controls and `transcript_capture.rs` `a_shell_command_naming_another_checkouts_file_honors_its_policy`, both failing with the foreign lookup disabled, and the Node evidence test's `cross-*` and `fold-unicode` checks, which fail with `captureForeignConfigs` disabled, and the shell fixture's quoted-script, git-object, ANSI-C, escaped-letter and inline-interpreter vectors with their controls (`cargo test`, `git status`/`log`, `pytest`, `python3 -m pytest`, `node build.js`, `npm run test`, a quoted commit message with braces); `router.rs` `capture_protocol_active_keep_of_unprovable_output_is_stripped`; `hook.rs` `excluded_content_cannot_reach_the_spool_through_unevaluated_tool_shapes` (directory entries and Copilot `view`/`create` never spool, readers and brace shells spool without content, public controls spool with it); `capture_policy.rs` `droid_tool_calls_honor_capture_exclusions` (`Read`/`Create`/`Edit` naming an ignored path drop and a control path keeps, `ApplyPatch` is metadata-only like Codex `apply_patch` and its headers name the lookup location, `LS`/`Grep`/`Glob` drop and their directory and glob arguments locate the call, `Execute` naming an ignored path drops; every excluded case keeps under `AgentKind::Other`, so it fails with the Droid `extract` arm or the `Create`/`ApplyPatch` mapping removed) and the `droid` `decisions` fixture vectors (#1240); `capture_policy.rs` `muse_tool_calls_honor_capture_exclusions` (`read_file`/`write_file`/`edit_file` naming an ignored path, relative or absolute, and the project-scope memory tools naming an ignored `.agents/memory` path drop while a control path keeps, personal-scope memory calls are metadata-only, `apply_patch` is metadata-only like Codex's, `search` drops, `bash`/`monitor` naming an ignored path from their `workdir` drop, `bash_input` is metadata-only; each excluded case keeps under `AgentKind::Other`, so it fails with the Muse `extract` arm removed), `muse_tool_payload_fields_carry_the_call_id` and the `muse` `decisions` fixture vectors, taken from Muse Code 1.4.7 hook payloads; `capture_policy.rs` `codebuddy_tool_calls_honor_capture_exclusions` (`Read`/`Write`/`Edit`/`Bash` naming an ignored path drop, a control path keeps, and every excluded case keeps under `AgentKind::Other`, so it fails with the CodeBuddy `extract` arm removed) and the `codebuddy` `decisions` fixture vectors; `render_shared.rs` `generated_capture_policy_v1_node_runtime_evidence` (runs the same fixture sections, including the GHSA-vh98 and Gemini `read_many_files`/`run_shell_command` vectors, plus unsupported-glob, empty-list and recursive-`**` checks, against the emitted TypeScript; `#[ignore]` locally, run with `--ignored` under Node 24 by the Linux CI test job); `hook.rs` `check_capture_refuses_partial_scope_and_excluded_content` (ignored-path and partial-scope violations refused, complete public-path control passes), `check_capture_bounds_marker_hints_and_refuses_oversized_scope` (513-byte hints refused, 512-byte control passes; native routing preserved); **`backfill.rs` `backfill_never_posts_tool_content_the_capture_policy_excludes`** (planted Claude transcript: the excluded read's call and output never reach `/hook/batch`, a malformed read posts only the metadata-only body, public read control posted) and **`run.rs` `ledger_upload_drops_tool_content_the_capture_policy_excludes`** (excluded call and output absent from the finish request, public control present, cursor still advances), both failing with the guard removed; **`recovery.rs` `finish_failed_recovery_never_posts_content_the_capture_policy_excludes`** and **`degraded_run_recovery_never_posts_content_the_capture_policy_excludes`** (a full `recover` pass over a journaled Claude transcript with exact digests and cursor, marker `ignore_paths = ["secrets/**"]`: the excluded read's path and `SENTINEL_RECOVERY_MUST_NOT_POST` output never reach `/workstream/runs/{id}/recover` or `/hook/batch`, the public read's output does; each fails when its own call site's capture is built for `/` instead of the entry's `cwd`, on the control since a foreign-scoped capture fails closed, and both fail on the sentinel when `for_checkout` loses the marker's policy); `transcript_capture.rs` `an_excluded_read_drops_its_call_and_result_by_id`, `id_less_results_take_the_strictest_call_of_their_turn`, `a_skipped_record_makes_the_id_less_results_of_its_turn_orphans` (an id-less result after a skipped record is dropped under a policy and content-free without one; control: the same turn without the gap keeps it), `unrecoverable_arguments_and_orphan_results_fail_closed_under_a_policy`, `a_call_into_another_checkout_honors_its_policy`, `ledger_events_are_dropped_or_stripped_before_upload`, `without_a_policy_every_event_is_kept` (control); `capture_policy.rs` `tool_call_payload_reaches_the_live_decision_for_every_supported_agent`; **`backfill.rs` `allowlist_mode_backfills_nothing_from_an_unmarked_checkout`** (no request reaches the server; marked-checkout and denylist controls do), **`run.rs` `ledger_upload_under_allowlist_mode_carries_nothing_from_an_unmarked_checkout`** (finish carries no prompt or tool content; marked and denylist controls upload both), `transcript_capture.rs` `allowlist_mode_admits_nothing_from_an_unmarked_checkout`, all failing with the admission gate removed; **`backfill.rs` `backfill_inspects_codex_exec_command_as_the_hook_shell_call`** and **`run.rs` `ledger_upload_inspects_codex_exec_command_as_the_hook_shell_call`** (a planted Codex `exec_command` whose `workdir`-relative argument names an ignored file never posts its call or output; the same command from a public `workdir` does), `capture_policy.rs` `codex_transcript_exec_command_is_inspected_as_the_hook_bash_call` (absolute, relative and absent `workdir` and an argv `cmd` drop, public control kept, the `workdir` locates the call, another agent's `exec_command` stays unknown), all failing with `hook_tool_call` removed; **`backfill.rs` `backfill_resolves_each_call_from_its_record_cwd`** (`cat adr/x.md` recorded from `docs/` never posts; the same command from the root does) and `transcript.rs` `jsonl_events_carry_their_record_cwd` (Claude per line, Codex per turn context, a relative cwd ignored), failing with the record cwd ignored or unstamped; **`backfill.rs` `backfill_drops_reroutes_the_live_hook_would_not_deliver_here`** (under allowlist mode, reads rerouted to an unmarked git repository, to a marker selecting an unregistered profile, and to a marker selecting a registered profile while the source uses the install default are never posted; a read in a marked checkout with no server selection is the posted control), failing with either the admission check or the route comparison removed (each refused case checked on its own); `transcript_capture.rs` `a_record_cwd_answers_to_the_hook_admission_gate_there` (prompt, call and result recorded in an unmarked repository drop under allowlist; a subdirectory of the opted-in checkout is kept and its record cwd never reaches the ledger) and `claude_shell_mode_output_is_not_imported` (stdout, stderr, local-command and size-capped blocks drop; `<bash-input>`, a prompt quoting a tag, and another agent's message kept); **`backfill.rs` `backfill_posts_no_content_for_unrecognized_tools`** (a planted Codex MCP call's arguments and output never post, the call and output post as `tool unknown`; a recognized shell output is the posted control) and `transcript_capture.rs` `unrecognized_tools_keep_no_content_with_or_without_a_policy` (no policy and an active one; ledger content withheld; public read kept; a call-less result content-free), failing with the unknown-family rule removed, the backfill one also with its content-free body removed; **`backfill.rs` `backfill_keeps_reroutes_to_the_same_server_profile_only`** (a reroute into a checkout selecting the source's registered profile and project is posted; one selecting a different registered profile is not, nor one of another project on the same profile, nor a prompt recorded there), failing with the profile comparison forced either way and with the project comparison removed; `transcript_capture.rs` `a_record_cwd_in_another_project_is_dropped` and `a_reroute_into_another_project_is_dropped` (prompt, call and result recorded in, or a read reaching into, a checkout declaring another project drop; one declaring the same project is kept), failing with `routes_to_same_project` removed; `hook.rs` `subdirectories_of_one_repository_are_one_project_only_under_repo_root` (two subdirectories of an unmarked repository, and a subdirectory importing its root, are two projects; the same directory, the root importing a subdirectory and a `repo-root` marker agree), failing with the basename rule removed; **`backfill.rs` `backfill_posts_no_task_notification_or_compact_summary_as_a_prompt`** and `transcript.rs` `claude_adapter_keeps_task_notifications_and_compact_summaries_out_of_prompts` (a monitored command's notification, a background agent's report and an origin-tagged notice are excluded, also behind a byte-order mark and zero-width characters, in another case, with attributes, after a non-text block, or with an origin kind in another case; a compact summary, also flagged `"true"` or `1`, becomes a compaction event; the typed prompt, also one quoting the tag, and a look-alike tag are the controls), failing with either adapter rule removed or with the spelling rules reverted; `transcript_capture.rs` `boundary_events_answer_to_the_record_cwd_admission_gate` (compaction and annotation recorded in a refused directory drop; in the checkout kept), `a_result_whose_id_matches_no_call_is_an_orphan` (an unmatched id cannot borrow a public read's keep; the read's own result kept), `claude_shell_mode_output_is_not_imported` (a block holding a literal closing tag drops) and `unrecognized_tools_keep_no_content_with_or_without_a_policy` (ledger keeps no tool name and no invalid call id), each failing with its rule reverted; `windows_spelling_fixture_vectors` (shared `capture-policy.json` `windows` drop vectors for every spelling above, file tool and shell, with other-drive, other-share, longer-name and pipe controls, and `windows_posix_controls` proving a POSIX session keeps `/c/…`, trailing-dot and colon names; `windows_scopes` drop vectors for a `\\?\C:\`, `\\?\UNC\…`, `\\localhost\C$\…` or UNC cwd and marker directory with relative patterns, a `\\?\C:\…` absolute pattern from `C:\repo`, bare and double-quoted `\\server\share\…`/`\\?\…`/`\\.\…`/`\\localhost\c$\…` PowerShell, cmd, `run_shell_command` and argv commands, and both readings of `/a/x` from `D:\a\…`, each with public-path, other-drive and other-share keep controls; the Node runtime evidence runs the same vectors with the marker spelled in the Windows cwd), `tool_family_fixture_vectors` (shared `tool_families`, every native name per family), new `decisions` vectors (`execute_code` metadata-only, `read_file`/`patch`/`fs_read` operations drop, `write_to_file`/`browser_navigate` keep), `output_spool_work_is_linear_and_budgeted` (a 2,040-wildcard-segment path stays under a linear work bound; 32 such paths fail closed; one long or 32 short paths keep), `an_oversized_shell_command_is_unprovable` (one character over the limit is metadata-only and unlooked-up, at the limit keeps, argv summed, inactive untouched), `inline_code_tools_are_unprovable_under_a_policy`, `hook_capture::capture_section_spellings_match_toml_semantics` (shared `marker_spellings`, including a nested-array line `["docs"]` before a dotted `capture.ignore_paths` that must still drop, and a key line inside an open array, text after a closed array and a multi-line inline table that must fail closed), and the Node evidence test running all of these vectors against the generated TypeScript plus its entry-bound read count for the directory walk; each fails with its rule reverted (Windows reading off, spool memo dropped or budget failing open, length check off, inline-code rule off, a name dropped from the list, TS dotted key or inline-table rule reverted, TS walk back on `readdirSync`, Windows reading of the cwd/marker directory or of an absolute pattern off, literal-backslash reading off, the cwd-drive reading of `/a/x` off, TS array tracking or any `captureValueScan` refusal off, Rust and TS alike); new `windows_scopes` vectors (drive-relative, device-namespace and Git Bash doubled-backslash shell words and a `C:docs` `workdir` metadata-only, `FileSystem::` file paths, shell words and `workdir` dropping, a POSIX absolute pattern in a Windows marker failing closed, with `type README.md`, `dir /s /q`, `git status`, a URL, `type C:\repo\README.md` and `Get-Content -Path C:\repo\README.md` kept) and `windows_marker_rejects_posix_absolute_patterns` (the same pattern stays active in a POSIX marker) fail natively and in the Node evidence test with the unplaceable check, its device branch, the `workdir` check, the provider strip or the marker rejection removed; `inspection_sentinel_matches_cwd_flavor` (#1250: POSIX sentinel Invalid on a Windows cwd, Windows-flavored sentinel Active there and on UNC, POSIX sentinel Active on `/repo` and Git Bash `/c/repo`) is native only, since `inspection_sentinel` is server re-inspection with no TypeScript counterpart, and fails with the cwd-flavored sentinel or the marker rejection removed; removing the POSIX-reading excusal makes `type C:\repo\README.md` metadata-only, and excusing a device reading keeps the doubled-backslash device path; `capture_policy.rs` `windows_lookup_locations_keep_glob_segments_whole` (a Windows session trims trailing dots from plain segments only, so `{.,}.` still reaches `..` and the sibling checkout's marker; bites with the glob-segment exemption removed) `names_outside_the_mcp_shape_keep_no_tool_identity` (#1522). | STRONG with listed residuals. Matching is lexical by design, so these stay open: shell variables (`$VAR`, `FILE=… sh -c 'cat $FILE'`) and the output of a command substitution, a `cd` inside the command, a script read from a file or a heredoc fed to an interpreter (read only for the words it spells out), git's repository root approximated by the marker directory, symlinks (paths are never resolved on disk), a recursive search of a parent directory (`grep -r x docs`, `rg x`) through a shell, a search tool rooted at a literal directory above another checkout (it is not walked) and a glob whose literal root lies inside the event's own checkout reaching a checkout nested there (it is not walked), a marker nested inside the own checkout below what the lookup budget reaches, a `.git` the same command creates (`touch .git; cat */x`: the hook reads the tree after the command ran, so that directory counts as the own checkout; a `.git` at or above the home directory never does), a parameter expansion next to glob syntax (`${X}/*/x`, not walked), a glob through a symlinked directory, a tool's own directory option (`git -C`), script runners and interpreters the matcher does not list (their words are still read, but expansion or inline code in them is not recognized), a value glued after the first letter of a short-flag cluster, non-ASCII percent-escapes in a `file:` URL, a bare word naming another checkout's directory (only separator-bearing arguments are looked up for another marker), harness output files outside the listed default locations, and tools the matcher does not list, which keep their current unknown-tool behavior. Transcript imports add: assistant prose quoting an excluded file is kept (as live prompt/assistant capture keeps it), harnesses whose hook schema the matcher does not read (Crush, Kimi Code) keep their tool events as live capture would, adapters that record no per-record cwd (Pi, OMP, OpenCode, Crush, Kimi Code, Command Code, Kiro, Grok) judge every event from the session cwd, a Codex ledger upload resumed from a mid-file cursor judges the events before the next turn context from the session cwd, and id-less adapters over-drop a whole turn's results when one call is excluded, and when the routing hints leave the project to the server, events from inside one repository count as the importing project even where the server has a separate project registered for a subdirectory (anywhere under `repo-root`; under `basename` only when the import runs from the repository root); a metadata-only import keeps an `event_id` (ledger) and `ingest_key` (backfill) derived from a SHA-256 of the original content plus session and record ids, left in place because those ids are the retry-dedupe keys and a content-free id would merge distinct events — it only confirms a guess of low-entropy content. Under allowlist mode a refused checkout's `ai-memory run` still records repository checkpoint metadata (HEAD, branch, a status hash and changed-path names, never file content), which the run also sends at launch. Re-splitting quoted words over-drops a quoted message naming an ignored path, and inline interpreter code is metadata-only under an active policy. Mitigation: allowlist capture mode (`install-hooks --capture-mode allowlist`) for sensitive projects. Bite checks: removing the nested re-split, the git object path or its marker-root base, Antigravity's `Cwd` key, the leading-`]` rule, either zsh-group rule, ANSI-C decoding or its numeric-escape rule, the `\o` reading, the inline-code rule, the nesting-depth rule, the nested-script scan, the line-continuation join, the Windows escape reading, the shell-option and interpreter-option value skips, the added runners and interpreters, the glued-flag value, the `file:` URL path, the `~+` resolution, the unknown-tilde rule, the parameter-default reading or case folding each fails the Rust tests, and each TypeScript counterpart fails the Node evidence test; so does reverting the `file:` URL cut, the deep-default rule, the escaped-default reading, the quoted-tilde rule, the harness-output rule or Unicode folding (the new fixture vectors fail against the previous matchers in both languages), and disabling the foreign-marker lookup fails the native, import and Node cross-checkout tests; reading every glob location as literal, skipping search/list locations, or skipping a file tool whose targets cannot be read each fails the native, import and Node glob/search/unreadable tests, removing `apply_patch` header reading fails the own-patch control, and reverting the saved-output glob rule fails the new fixture vectors in both languages; walking globs rooted inside the event's checkout fails the monorepo tests, accepting any literal text for a saved-output glob fails the `*.log` vectors, removing the time budget or counting a `**`'s directories only after it lists fails the bounds tests, and removing the `**`-then-`..` readings, the brace-expansion check, the expanded lookup words, the patch-header trim, the `file_glob` key or the dot-glob parent reading each fails the Rust tests and the Node evidence test; treating every oversized brace expansion as leaving, dropping the brace-built dot-glob check, listing the own checkout's subtree under a `**`, looking up locations in their given order (outside before inside, then shallowest first), dropping the per-directory memo, counting a checkout at home as the own one, keeping the backslash before `$` in double quotes, or dropping the POSIX-class or extglob reading each fails its Rust test and the Node evidence test; in a Windows session a shell `workdir` spelled `/c/x` is read only as Git Bash reads it, so arguments resolved from it miss a native tool's `D:\c\x` reading, the TS marker reader rejects structural errors anywhere in the marker but does not validate other values' TOML (`x = nope` invalidates the policy only natively), an administrative share reached through a loopback or host alias other than `localhost`/`127.0.0.1` (`\\127.0.0.2\c$`, `\\127.1\c$`, `\\<hostname>\c$`) or a `\\wsl$\…` path is matched as the UNC path it spells, Windows matching folds ASCII case only, and a drive-relative word counts as placed when a placeable argument's POSIX reading spells it; a `**/` matches one or more directories, never zero (documented in `marker-file.md`) || 11c | Capture hook ≤200ms budget (invariant #5) | `hooks/_lib.sh` capture path `curl --max-time 0.2` (context-fetch 1.0s and background drain 2.0s are separate, larger-budget paths) | none (shell-script timeout; hard to unit-test) — watch on any capture-path change | WATCH || 11d | Hook server-profile routing: a marker-selected server gets only its own capture and its own token (#992) | `ai-memory-cli/src/server_profiles.rs` `resolve` (validated `ProfileName`, strict `servers.toml` parse, `roots` required once two profiles exist, component-wise root match) and `marker.rs` `find_server_selection` (inherited down the tree, any value shape counts); `commands/hook.rs` `resolve_hook_route` drops a `Rejected` route before spool, handoff and backfill, and hands the drainer no live token for a profile route; `commands/hook_spool.rs` `static_retry_token` (a profile entry retries only with its own stored token), the loopback reroot skip, and chunk splitting on `profile`; generated TS `captureServerRouted` drops a routed repository and gates `fetchHandoff`; `hooks/_lib.sh` `ai_memory_server_routed` (flag refused by `ai_memory_post_hook`/`ai_memory_get_handoff`) and `hooks/lib/ai-memory-hook.ps1` `Test-AiMemoryServerRouted` drop it in the script hooks; `--check-capture` refuses a rejected server-profile selection without printing its token or URL; once `[auth].bearer_token_file` names `auth-tokens/default` (this install's root bearer), `commands/server.rs` `refuse_the_root_token_name` refuses `server add default` and `server remove default` so no profile can be handed, overwrite or delete the root bearer | `hook.rs` `each_repository_spools_to_its_own_profile_with_its_own_token`, `muse_hooks_honour_marker_scope_profiles_exclusions_and_allowlist` (the Meta Muse Code settings-hook front door: marker workspace/project, the profile's server and token never the install's, the payload's session id, an ignored relative `read_file` dropped with a kept control, allowlist silence from an unmarked checkout with a denylist control), `a_selection_that_does_not_resolve_emits_nothing` (unknown / tokenless / outside roots / roots required / invalid name, plus a resolving control), `session_start_handoff_comes_from_the_profile_server_only`, `a_repository_without_a_server_key_keeps_the_install_default`; `hook_spool.rs` `a_profile_entry_is_never_retried_with_the_install_live_token` (server B accepts exactly the install's live token and must still not get it), `a_profile_entry_recovers_with_its_own_rotated_token` (control), `a_profile_entry_on_a_dead_loopback_port_is_not_rerouted_to_the_default`, `profile_and_default_entries_at_one_address_ride_separate_batches`; `server_profiles.rs` roots/registry/name tests; `marker.rs` `nested_markers_without_server_inherit_the_ancestor_selection`; `install_hooks.rs` `generated_integrations_fail_closed_on_a_server_profile_marker`, `openclaw_plugin.rs` `openclaw_plugin_fails_closed_on_a_server_profile_marker`, and the `server-routed-*` checks in `generated_capture_policy_v1_node_runtime_evidence`; `hook.rs` `an_event_without_a_payload_cwd_routes_by_the_process_cwd`, `a_refused_route_prints_nothing_for_kimi_user_prompts`; `hook_spool.rs` `a_profile_entry_is_not_retried_with_a_token_issued_for_a_new_url`; `server_profiles.rs` `changing_the_url_without_a_token_discards_the_old_token`, `omitted_roots_keep_the_registered_ones`; `marker.rs` `outside_home_the_walk_reaches_a_marker_above_the_checkout_root`, `encoding_noise_cannot_hide_a_server_key`, `an_unreadable_marker_is_a_refused_selection`; `backfill.rs` `a_spawned_backfill_authenticates_like_the_hook_that_spawned_it`; `tests/hooks/test_lib.sh` "server profiles (#992)" section; `hook.rs` `a_mixed_spool_drains_each_event_only_to_its_own_server` (two token-gated servers, one spool, one drain: each server receives exactly its own event with exactly its own bearer); `tests/suite/server_profiles.rs` (the built binary: `server add` → `hook` spools to the profile with its token, unknown profile spools nothing, `uninstall` removes the tokens; `two_real_servers_each_receive_only_their_own_repository` runs two real `ai-memory serve` children with different root tokens and checks on each server which repository landed there); `ai-memory-hooks` `powershell_server_routed.rs` `server_routed_guard_mirrors_the_native_walk` (runs `Test-AiMemoryServerRouted` under real PowerShell: inherited, BOM, look-alike keys, the `$HOME` boundary with its control, past a checkout root outside home, current directory); `hook.rs` `a_selection_that_does_not_resolve_emits_nothing` (rejected routes refuse preflight; resolved profile control passes); `tests/hooks/test_lib.sh` and `powershell_home.rs` `a_trailing_separator_on_home_keeps_the_walk_boundary` (a `$HOME` ending in `/` or `\` keeps both script walks at home: a `server` marker above it routes nothing, with a root-home control that does); `server.rs` `the_root_bearer_file_name_cannot_be_registered_or_removed` (refused at the root bearer path; another name and an install without a root bearer file are the controls); `server_profiles.rs` `a_default_profile_shares_the_root_bearer_only_at_its_path`, `clear_tokens_keeps_the_root_bearer_and_removes_profile_tokens` | STRONG for native hooks, generated TS, `.sh` and `.ps1` hooks. Known gap: an older binary draining a shared spool ignores `profile` || 11e | Native self-upgrade archive confinement (#1025) | `ai-memory-cli/src/commands/upgrade.rs` normalizes every tar/zip path, rejects links and special entries, extracts only the binary and `hooks/`, accepts only the exact non-runtime support layout emitted by `release.yml`, and caps both entry count and declared expanded bytes before writing | `upgrade.rs` `release_workflow_support_assets_are_exact_and_ignored` (shipped support paths admitted, near-miss docs/packaging/template paths refused), `extracts_archive_built_like_release_yml` and `extracts_zip_happy_path_with_hooks` (real workflow-shaped archives succeed but support assets are not written), `validate_rejects_path_traversal`, `zip_extract_rejects_path_traversal`, `tar_extract_rejects_declared_expansion_past_limit`, with binary/hooks extraction as the legitimate control | STRONG |