Repository navigation
docs: R5 host_record rule for Claude Code 2.1.310 hook-context records (ACCEPTED: rule only) - #796
Merged
Merged
Conversation
…t records (rule only) Proposes classification rule R5 for the two transcript locations Claude Code 2.1.310 added (a rendered copy on hook_additional_context, and an api-request-blob with role system), which made all three A2 paths INCONCLUSIVE (#795). New category host_record: recorded, never delivery, never sufficient alone, never masking. R5a/R5b apply only when the location is an exact host wrapping of an R1-qualifying entry's content, so R5 can never unlock a label without R1 and makes no model-input claim. Projection only; no classifier change, reclassification or run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mneme self-governance checkMode: No files in scope. Filter: |
R1 matches the hook event but not the tool, and both H1a paths share PreToolUse. R5 now classifies a record only against a tool-attributed anchor: an R1-qualifying hook_additional_context entry whose hookName equals the expected label, whose toolUseID is this arm's tool_use for the expected tool, and whose emitter hook-log envelope names that event and tool (lifecycle paths: hookName is the bare event). Adds wrong-tool-under-right- event negative tests to the implementation requirements. R1-R4 unchanged; nothing reclassified. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TheoV823
marked this pull request as ready for review
November 11, 2026 19:11
TheoV823
added a commit
that referenced
this pull request
Nov 11, 2026
## Summary This is a **documentation-only acceptance record** for the R5 rule. Nothing technical changes. #796 was merged by the owner on 2026-11-11 as `70fbe524`. Its tree is identical to the reviewed head `efc93444`, which received an independent re-review ACCEPT. But the merged document's title and status line still said **PROPOSED**, and the squash title says "propose". This PR corrects only the title and the status block of `docs/plans/2026-11-11-dg1f-t08-d5-p2-a2-r5-host-record-rule.md`. It records: - the reviewed head; - the merge commit, with the identical tree; - the accepted scope: the R5 definition in §3, revision 2, with `host_record`, tool-attributed anchors A1–A6, exact derivation and R5a/R5b; R1–R4 unchanged. The rule text, §2–§9 and the non-authorization list are unchanged. The #796 PR record has been retitled ACCEPTED to match. ## Not authorized by this PR The R5 classifier implementation (the next separately authorized step), any reclassification, re-run or live probe, an H1c/A1 re-pin, any runtime change, freeze amendment, P2-first charter or implementation. H1 stays NOT MET, G3 partial, and DG1G and DG1 open. ## Execution provenance - Change author: agent - Agent: claude-code - Agent model: claude-opus-5-5 - Agent session: not-exposed - Task origin: claude - Human owner: @TheoV823 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Mneme Deploy <deploy@mnemehq.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
TheoV823
added a commit
that referenced
this pull request
Nov 13, 2026
…PTED: harness only) (#798) ## Summary **ACCEPTED** (independent final review ACCEPT on `0ddc0db2`, 2026-11-13; squash-merged pinned to that head). Acceptance authorizes no reclassification, re-run, runtime change, freeze amendment, P2-first charter or implementation; the A2 offline reclassification is a separately authorized next step. **PROPOSED, for independent review. Harness only.** This implements the accepted rule **R5** (`docs/plans/2026-11-11-dg1f-t08-d5-p2-a2-r5-host-record-rule.md`, #796/#797) in `classify_h1.py`, following §7 step 1 of the rule. It is step 2 of the three separately approved steps (rule, implementation, reclassification). **No evidence is reclassified, and nothing ran live.** ## Changes (`docs/validation/artifacts/dg1f-t08-d5-p2-h1-host-path/harness/`) - **`classify_h1.py`:** - `r5_anchors()` finds tool-attributed anchors that meet conditions A1–A6: - the event (A1); - the emitter invocation (A2); - the nonce in `attachment.content` (A3); - `hookName == L` exactly (A4); - on tool paths, `toolUseID` is the arm's `tool_use` for the expected tool (A5); - on tool paths, the hook-log envelope names that event and tool (A6). - `categorise()` returns the new `host_record` for R5a, the anchor's `rendered[i].content` with `renderedRole` `system` and an exact wrapping, and for R5b, an `api-request-blob` with role `system` where every nonce line is an exact anchor line. Everything else stays `unclassified`. - `nonce_locations()` now also takes the path's tool. - `RULES_ID` is now `"as-run table + R1-R5 (#551, #561, #796)"`, and `classify_a1.py` inherits it. - The label logic is unchanged. - **`selftest/stub_claude.py`:** a new `H1_STUB_DELIVERY=hook_r5` mode that writes the 2.1.310 shape recorded in #795. - **`selftest/test_r5_classifier.py`** (40 tests), covering the §7 list: - the positives (×3 paths); - the R5a negatives: role, a non-exact rendering, a length mismatch, the wrong `hookEvent`, the emitter not invoked, other attachment types; - the R5b negatives: role, prefix, suffix, wrong label, matching no anchor, a second non-matching line, no anchor, the emitter not invoked; - the **wrong-tool cases** from the #796 review: `hookName` `PreToolUse:Bash` on the Edit path, a `toolUseID` pointing at the Read call or at nothing, a hook-log `tool_name` of `Bash`, a `PreToolUse:Bash` blob line, and an H1b `hookName` of `SessionStart:startup`; - label interactions, and an anchor unit test; - **no-effect replays**: the H1 published subset keeps `outcome.r1r3.json` on all four paths, and the A1 published subset keeps `NOT_DELIVERED`. - **`test_h1_harness.py` and `test_a1_harness.py`:** the four `RULES_ID` pins are updated (the #562 precedent). - **`README.md`:** an R5 paragraph. ## Validation (offline; stub, NOT evidence) - **Tests:** `python -m pytest -q …/harness/selftest` passes **201** (161 existing and 40 new). PR CI does not run these tests, because they live under `docs/validation`. - **Mutation check:** each of these seven mutants is caught by at least one R5 test: - A4 off; - A5 off; - A6 off; - R5b relaxed to a prefix match; - R5a role check off; - R5a loosened back to any path under `rendered`; - R5 off entirely. The classifier was restored and hash-verified afterwards. ## Review of `3bbc8b84` (addressed in the second commit) - **R5a matched paths too broadly.** `path.startswith("rendered[")` would also have classified a nonce at, for example, `rendered[0].metadata` on a valid anchor as `host_record`. R5a now matches only `rendered[i].content` (fullmatch); any other path under `rendered` stays `unclassified`. - **New regression test:** a nonce in `rendered[0].metadata`, or in `renderedRole`, stays `unclassified` and gives `INCONCLUSIVE`. - **Both reviewer notes confirmed:** the wrong-tool `NOT_EXECUTED` label, and R2 covering `hook_success`. The narrow erratum to the accepted rule note is a separate docs-only PR; classifier semantics are unchanged. ## Two things for the reviewer (first draft) 1. **A label discrepancy in the accepted rule note's wording.** Rule note §3 says "a wrong-tool invocation gives 'emitter not invoked' and `INCONCLUSIVE`", and §7 lists the wrong-tool cases with the label `INCONCLUSIVE`. In the classifier, which is unchanged here, "emitter not invoked" is a precondition that returns **`NOT_EXECUTED`** (`classify()`). So the cases where the hook log does not name the expected tool, or the emitter did not emit, are labelled `NOT_EXECUTED`. The other wrong-tool cases are `INCONCLUSIVE`, as stated. - **Not affected:** in every case the R5 categories are exactly as the rule specifies (`unclassified`), and the label never passes. The tests assert the actual label. - **Proposed fix:** a one-line erratum to the rule note, which I can draft. This PR does not change the accepted note. 2. **`rendered` on a `hook_success` entry.** R2, unchanged, categorises every location of a `hook_success` entry as `host_output`, so a `rendered` copy there is `host_output`, not `unclassified`. It is never `host_record`. Rule note §3 says only that R5 does not cover it, which remains true. ## Not authorized by this PR - the offline reclassification of the A2 archive (§7 step 2), which is a separate go-ahead; - any re-run, live probe or H1c/A1 re-pin; - H2–H6; - any change under `mneme/`, a freeze amendment, a P2-first charter or implementation. H1 stays NOT MET, G3 partial, and DG1G and DG1 open. ## Execution provenance - Change author: agent - Agent: claude-code - Agent model: claude-opus-5-5 - Agent session: not-exposed - Task origin: claude - Human owner: @TheoV823 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Mneme Deploy <deploy@mnemehq.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
TheoV823
added a commit
that referenced
this pull request
Nov 13, 2026
…only; DELIVERED_TO_AGENT x3; H1 NOT MET) (#800) ## Summary **ACCEPTED (evidence only)** on independent re-review at `ae9b3984` (2026-11-13). The only later change is the atomicity wording below. This is the offline reclassification of the Amendment A2 evidence (#795) under the accepted rules R1–R5. It is step 2 of the [R5 rule note](docs/plans/2026-11-11-dg1f-t08-d5-p2-a2-r5-host-record-rule.md) §7. R5 was accepted in #796/#797 (erratum #799) and implemented in #798 (`b92eaf05`), and the owner authorized this step on 2026-11-13. **No host session ran, and nothing was re-run.** There is no runtime, classifier or freeze change. It follows the #553 and #563 precedent. | Path | As-run (#795) | R1–R5, raw (authoritative) | R1–R5, subset replay | |---|---|---|---| | H1a-edit | INCONCLUSIVE | **DELIVERED_TO_AGENT** | DELIVERED_TO_AGENT | | H1a-bash | INCONCLUSIVE | **DELIVERED_TO_AGENT** | DELIVERED_TO_AGENT | | H1b-start | INCONCLUSIVE | **DELIVERED_TO_AGENT** | DELIVERED_TO_AGENT | | Listed-path result (one host version) | NOT MET | **PASS** | — | - **Diff against the as-run outcomes:** on each path only two location categories change, both from `unclassified` to `host_record`: `rendered[0].content` (R5a) and the `api-request-blob` line (R5b). The label, `passes_path`, the now-empty reasons and `rules` follow from that. Every other field is identical, and the location set is unchanged. - **Delivery rests on R1** (`model_bound` at `attachment.content[0]`). `host_record` is never delivery. No unclassified location remains. - **Completeness: 0 omitted nonce occurrences** across all six arms: - events: 38 entries; - transcript: 182 entries, with the A2 selection (`rendered` and blob excerpts) reproduced; - stderr: none in any arm. Each control arm was also scanned for the paired emitter's nonce. - **H1 stays NOT MET.** H1c is not in A2 and is still pinned to 2.1.202, and mixed-version combination is not decided (A2-1). G3 stays partial. DG1G and DG1 stay open. ## Corrections after independent review The review of `e94c866d` asked for two fail-closed safeguards. Both are in `reclassify_a2.py` (now `79dca960…03a55a0f`): 1. **Omitted nonce evidence blocks PASS.** Any omitted hit, stderr included, makes that path's result and the listed-path result `PENDING_REVIEW`, whatever the classifier labels say. Only `reclassification.json` is then published, with the hits given as locations. The per-path `outcome.r1r5.json` files are withheld and the tool exits 3. 2. **Nothing is published before every check passes.** Outputs are redacted and leak-scanned into a staging directory. The archive is re-verified after classification and again immediately before the staged files are copied into place. A failed check leaves the published directory untouched. The final copy of the four files is not atomic: a filesystem error part-way through could leave some in place (re-review note; §8.2 step 5 says so, and the tool is unchanged since its hash is recorded). **Regression tests (+8):** - the review's stderr-only example; - the listed-path result in each case; - the publication step: a failing check, a leak in a later file, and refusing to overwrite; - three end-to-end `main()` runs: integrity failing after classification or immediately before the copy, an omitted hit, and a clean run. All 10 mutants (the earlier 4 plus 6 that each undo part of the new safeguards) are caught, and the full harness suite passes **217**. **Outputs regenerated with the corrected tool:** - The three `outcome.r1r5.json` files are **byte-identical** to `e94c866d`. - `reclassification.json` differs only in the tool hash and the new `result_r1r5_raw` and `publication` fields. - The archive still verifies (74/74, read-only), and so does the live root. - The tamper check again aborts with nothing written. - The §8 addendum is updated to match; §1–§7 are untouched. ## Integrity - **Archive.** `C:\dev\d5p2-h1-a2-archive\2026-11-11` (74 files, read-only) verified against `2026-11-11.SHA256SUMS` (`bbd4c5e5…21089e34`) before the run and after it. The tool re-checks it after classifying and refuses to write the summary if anything changed. The live root also verifies against the same listing. - **Manifest.** All 21 raw files hashed in #795's `MANIFEST.json` match. - **Tamper check.** A checksum list with one hash altered made the tool abort with nothing written. ## Changes - `harness/reclassify_a2.py` (new). It reuses `reclassify_h1.verify`/`subset_arm` unchanged, and its completeness diff uses `collect_a2.select_transcript_a2`. An omitted hit would be published as its location only, never the entry. - `harness/selftest/test_reclassify_a2_completeness.py`: 16 synthetic tests. All 10 mutants of the tool are caught. The full harness suite passes **217**; PR CI does not run it. - `live-a2-2026-11-11/{H1a-edit,H1a-bash,H1b-start}/outcome.r1r5.json` and `reclassification.json` (redacted; leak scan clean). - `docs/validation/dg1f-t08-d5-p2-host-path-h1-a2-2026-11-11.md`: an append-only §8 addendum. §1–§7 are unchanged. ## For the reviewer: a workspace-masking finding (§8.4) The first run keyed each arm to its **archive** path. On H1a-edit, identical Read and Edit requests then did not mask to `<WS>` and were recorded as "non-equivalent attempts". The label was unaffected, since only equivalent requests' decisions are compared. I deleted those outputs, changed the tool to read from the archive but key each arm to its recorded live location (`load_recorded`, with a regression test), and re-ran. **The accepted #553 output has the same artifact:** `live-2026-10-17/H1a-edit/outcome.r1r3.json` shows 0 equivalent requests and 2 non-equivalent attempts per arm, where the as-run outcome shows 2 equivalent requests. Its label is not affected. The review confirmed it: the decisions were all `executed`, but with zero matched requests the equality check was vacuous. This PR does not change it. A separate append-only correction is to follow after #800. ## Not authorized by this PR - any re-run, live probe, or H1c/A1 re-pin; - H2–H6; - a P2-first charter, a `[layer1-freeze]` amendment, or any change under `mneme/`; - any change to the accepted #553/#563 records. ## Execution provenance - Change author: agent - Agent: claude-code - Agent model: claude-opus-5-5 - Agent session: not-exposed - Task origin: claude - Human owner: @TheoV823 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Mneme Deploy <deploy@mnemehq.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
TheoV823
added a commit
that referenced
this pull request
Nov 16, 2026
…s only) (#806) ## Summary **ACCEPTED (harness only)** on independent review at `d9b1ab32`, subject to one A1 subset regression test, which was added in `c0fc6cca` (40 R6 tests, suite 336), with CI green at the new head. This implements the accepted rule **R6** (#805, `ca02b3f2`) in the H1 classifier. **Nothing is reclassified:** the offline reclassification of the A3 archive is the next, separate step. No live run. **`classify_h1.py`:** - **New `r6_stop_echo(arm, spec, emitter)`.** It returns the index of at most one stream event that meets **all** of S1–S6, as accepted: - **S1:** `system` / `informational`, `level: notice`, and the field set is **exactly** `type`, `subtype`, `content`, `level`, `session_id`, `uuid`. - **S2:** the path's event is `Stop`, and this is the emitter arm. - **S3:** exactly one Stop hook record, `stop_hook_active` false, whose emitted JSON object has a string `systemMessage` `S`. - **S4:** `content == "Stop says: " + S`, exactly. - **S5:** it is the only such event. - **S6:** it comes after the last `assistant` event and before the first `result` event. - **`host_events(arm, nonce, spec, emitter)`** leaves that one event out of the **subtype comparison only**. The **indicator scan still covers it** (R6-3). The control arm is never excluded. - **The outcome records the exclusion** as `host_events.r6_excluded` (`null` when nothing was excluded). - **`RULES_ID`** is now `as-run table + R1-R6 (#551, #561, #796, #805)`. `classify_a1.py` inherits it through `A1_ID`, and its "Known collision" docstring now points to R6. ## Separate harness ordering fix, disclosed `prep_a1_interactive.sh` and `finish_a1_interactive.sh` (#803) ran their finished-batch and finished-arm guards **before** their read-only flag checks. With the real A3 root now holding finished evidence, two local A3 tests got the guard's refusal instead of the `DISABLE_AUTOUPDATER` refusal they assert. The guards now sit after the read-only checks and **still before the first write**, as in the runners. `test_finished_batch_guard.py` still enforces "guard before first write" from the source. Both scripts still refuse without writing in every case; only which refusal message appears first can change. ## Validation (offline) - **Tests:** `selftest/test_r6_classifier.py` adds 40 tests, the §7 list: - the positive A3 shape; - S1: level or subtype mismatch, **an extra field, each missing field**; - S2: the control arm, PreToolUse and SessionStart paths; - S3: none, two, active, not JSON, a list, no key, not a string, flag absent; - S4: seven near misses; - S5: duplicates; - S6: before the reply, after `result`, no assistant event, no `result`; - the indicator safeguard; - no effect on published subsets: the A2 paths, the H1 2026-10-17 `H1c-stop`, and the **A1 headless** pair (`NOT_DELIVERED`, added after review of `d9b1ab32`) keep their labels, and R6 never fires. - **The pinned rules ID** is updated in the existing tests. - **Full harness suite:** 336 pass. - **Mutation checks:** 11 mutants, all caught, run against `test_r6_classifier.py` only, which executes no runner. One per condition, plus "exclusion never applied" and "excluded event skips the indicator scan". - **The skipped-scan mutant first survived.** With S1's exact field set, an excluded event can never carry a real indicator key, so the scan of it is unobservable in production. The test now treats one field as an indicator key to pin that the scan still runs. - **Evidence roots:** the A3 live root still matches its archive. No file in the H1, A1, A2 or A3 roots changed. ## Not authorized by this PR - the offline reclassification of the A3 archive; - the screenshot evidence decision; - the H1 gate record; - any live run; - H2–H6; - any change under `mneme/`; - a charter amendment or `[layer1-freeze]`. ## Execution provenance - Change author: agent - Agent: claude-code - Agent model: claude-opus-5-5 - Agent session: not-exposed - Task origin: claude - Human owner: @TheoV823 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Mneme Deploy <deploy@mnemehq.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ACCEPTED as rule R5 only (independent re-review ACCEPT on
efc93444; merged by the owner on 2026-11-11 as70fbe524, whose tree is identical toefc93444). The squash commit title and the in-file status line still say "propose"/PROPOSED; a docs-only follow-up records the acceptance in the file. Scope of acceptance: the R5 rule definition, revision 2 (categoryhost_record; tool-attributed anchors A1 to A6; exact derivation; R5a/R5b), with R1 to R4 unchanged. It authorizes no classifier change, reclassification, re-run, H1c/A1 re-pin, runtime change, freeze amendment, P2-first charter or implementation. Rule definition only (docs). This addsdocs/plans/2026-11-11-dg1f-t08-d5-p2-a2-r5-host-record-rule.md, which proposes classification rule R5 for the two transcript locations that Claude Code 2.1.310 added. Those locations made all three A2 pathsINCONCLUSIVEin the accepted evidence (#795).R5, briefly:
New category
host_record: the host's record or rendering of content another rule already classifies. It is never delivery, never sufficient on its own and never masks.Tool-attributed anchor (revision 2, answering the docs: R5 host_record rule for Claude Code 2.1.310 hook-context records (ACCEPTED: rule only) #796 review). This is an R1-qualifying
hook_additional_contextentry that also meets three tool conditions:hookNameequalsLexactly (PreToolUse:Edit,PreToolUse:BashorSessionStart);toolUseIDis the id of this arm'stool_usefor the expected tool;R1 checks only the event, and both H1a paths share
PreToolUse, so R5 does not rely on R1 alone. R1 itself is unchanged.R5a:
rendered[i].contenton an anchor, whererenderedRoleissystemand the text equals exactly<system-reminder>\n{L} hook additional context: {content[i]}\n</system-reminder>.R5b: an
api-request-blobwithmessage.rolesystem, where the arm has an anchor and every nonce line equals exactly{L} hook additional context: {C}for some anchor contentC.Wrong-tool negative tests are added to the §7 implementation requirements: a wrong
hookName, atoolUseIDpointing atReador at nothing, a hook-logtool_nameofBashon the Edit path, aPreToolUse:Bashblob line in the Edit arm, and an H1bhookNamethat isn't exactlySessionStart. All stayunclassified.Anything else stays
unclassified. R5 can never unlock a label without R1, and it makes no claim that either record is model input.Narrowness requirements from the #795 review, all kept: event matching and emitter attribution (inherited from R1, and repeated in R5b); unclassified-first, which is unchanged; and the line between model input and host output (
host_recordasserts neither).Basis: the published A2 artifacts, plus a read-only check of the integrity-verified raw archive. Each of the six unrecognised occurrences is an exact host wrapping of its arm's R1 content; no other entry carries the nonce; no control carries the emitter's nonce. Neither entry type occurs in the H1 (2.1.202) or A1 archives, so R5 changes nothing there.
Projection (§5, by reasoning only, not a result): A2 H1a-edit, H1a-bash and H1b-start would likely become
DELIVERED_TO_AGENT, and the listed-path result likely PASS. That is still not the H1 gate.Alternatives considered (§4):
model_boundfor the blob,host_outputfor both, a prefix match, relaxing unclassified-first, and a re-run. None is proposed; reasons in §4.Decisions for the reviewer (§8): R5-1 the category (
host_record); R5-2 exact derivation over a prefix match; R5-3 R5 tied to R1; R5-4 separate steps.Sequence (§7; each step a separate go-ahead)
outcome.r1r5.jsonalongside the as-run outcomes, and an append-only addendum to the docs(validation): record T-08 D5+P2 A2 live run on Claude Code 2.1.310 (ACCEPTED: evidence only; INCONCLUSIVE as classified) #795 record.Combining steps needs explicit owner authorization.
Not authorized by this PR
H1 stays NOT MET, and G3, DG1G and DG1 stay open.
Execution provenance
🤖 Generated with Claude Code