Five registries were CONFIRMED blind by mutation and four have no tracker: pool_capability, resource_grading, exec_copy and shipped_binary are still green under the mutations that should redden them #178
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index#178
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is the sharpest finding of the #45.6 round and it is not tied to any one tool defect. Filed on its own so the class is on record and the audit it implies can be scheduled.
What happened
bless_registryexists to check that every registered bless switch routes through the sharedprojection::bless_verdict, so that all six of #45's refusals apply to all six artifacts rather than to one.Its routing check asked:
Every compliant owner defines a local wrapper of exactly that name — deliberately, so that each suite's unit arms read as assertions about its gate:
So the string was present whether or not the body delegated. The check was satisfied by the wrapper it was supposed to look through.
Measured, not argued
I replaced
corpus_tier3_ratchet's wrapper body with a weaker inline bar (any non-empty reason) that reached the shared verdict only with a claim it fabricated:The whole tree stayed green.
COSI_TIER3_BLESSwould have accepted a one-character reason, an empty categorised diff, no controls, a shrunken universe and a degraded resolver, and nothing in the workspace would have said so.That is the worst shape a gate can have: it is not merely weak, it reports compliance for the exact state it was built to catch, and it does so more confidently the more idiomatic the offending code looks.
Why the ordinary defences did not help
The fix, and why it needed two halves
delegates_to_the_shared_verdict(src)— strips//comments, then requires a reference to the shared item (projection::bless_verdict, or itsuse … asalias). A local definition cannot produce either. Graded in both directions by a newthe_delegation_detector_can_fail; making itreturn true;reddens with "a file that only SPELLS the name was read as delegating, which is the vacuity this predicate exists to remove".corpus_tier3_ratchet— a blessable claim, then one field varied per refusal, assertingCOSI_TIER3_BLESSis the switch named in the refusal. Because a lexical gate structurally cannot see whether a body calls what its file imported. Belt and brace, and the module note that previously argued against repeating the arms is amended to record why that argument was wrong.After both, weakening a shared refusal reddens all four suites.
The open work, which is why this is an issue and not a commit message
No other registry in this tree was audited for the same shape. The tree has at least:
bounding_site_registry,completeness_gate,production_caller_gate,retired_tier_gate,signature_gate,disclosure_derivation_registry,disclosure_surface_registry,reason_code_registry,ref_kind_stance_registry,refusal_stage_registry,resource_grading_registry,shipped_binary_registry,kind_table_guard,lockfile_forge_registry,generation_policy_registry,pool_capability_registry,exec_copy_registry,inline_cargo_build_registry,symbol_id_args_registry, and nowresolution_percentage_stance.The question to ask of each is not "does it scan the right files" — that is the check they all already have. It is:
Any registry whose predicate is
contains(<some identifier>)is a candidate, and the idiom that defeated this one — a thin local wrapper with the same name as the shared item, which is good style — is common in this codebase.What must NOT be done
🤖 Generated with Claude Code
https://claude.ai/code/session_01K1zj5VcFJvJt3pQxe9259K
The audit this issue asks for: 22 registry/population gates read, 11 rated vulnerable, 5 predicate mutations RUN — 5 confirmed, 0 refuted
Done in a detached worktree at
f6a878a. The five measured mutations were each written to make non-compliant code look compliant, per this issue's instruction; none of them is the mutation the gate's own author would have reached for, and each was applied against a paired control that proves the blindness is caused by the thing named and not by the edit being a no-op.MEASURED — all five stayed GREEN with the invariant violated
daemon/tests/lockfile_forge_registry.rslet payload = format!("root = \"{}\"\n…", root.display())) tomcp-server/src/main.rs's#[cfg(test)]module1 passed; 0 failed— GREENindexer/tests/pool_capability_registry.rs{admit_same_file}fromsymbol_buckets' INSERT and itspadmit.join(...)argument, then added one//comment naming both tokens17 passed; 0 failed— GREENmcp-server/tests/resource_grading_registry.rsevidence_gaps_for's 74-line body as a second implementation called fromgrade_resource_body, plus a comment holding the token count at 25 passed; 0 failed— GREENtest-support/tests/exec_copy_registry.rsfn install_executabledoing a barefs::copy, call-site text unchanged7 passed; 0 failed— GREENmcp-server/tests/shipped_binary_registry.rscode-indexentry from all 12INSTALL=lines inrelease.yml5 passed; 0 failed— GREENlockfile_forge_registryis blind today, in its own motivating file. Its exemptionhand_escaped = body.contains(r#"replace('\\'"#)is computed over the whole file inside a per-line loop, so one occurrence anywhere blanket-clears every line.crates/mcp-server/src/main.rs:1235carries that token in a doc comment — the paragraph explaining the original defect — and main.rs is the very file the gate's anti-vacuity assertion singles out to prove the scan reachessrc/. The scan reaches it; the predicate then exempts all of it, and 40 files undercrates/are in the same state. Control run (same forge, doc-comment token neutered): RED, namingmain.rs:1354. So the doc comment is provably the sole cause.pool_capability_registryhas its own fix sitting one directory away. Itsproduction_sourceapplies onlystrip_cfg_test; the siblinggeneration_policy_registry.rs:825appliesstrip_line_comments(&strip_cfg_test(&src))and its doc says so. Same crate, same directory, same helper name, different behaviour — the asymmetry that exposed the original bless defect, again.resource_grading_registryis the one no runtime arm can ever back up. Two variants were run. Replacing the call with a default value was caught — by behavioural siblings, which saw the changed behaviour, not the duplicated implementation. A faithful copy-paste (the defect #107 forbids: "Not a second implementation") shipped the whole file green. Behavioural arms only fire once a duplicate has drifted; they cannot see the duplication that causes the drift.The structural signal, which is more useful than any individual finding
The declared-mutation profile predicts vulnerability better than reading the predicates does. Every gate rated vulnerable-and-unbraced declares mutations touching only registry DATA or production SUBJECT. Every gate that survived scrutiny declares at least one mutation of its own predicate. That single question separates the two populations. Suggest making it the review question for any new registry.
Second pattern: negative corpora here are polarity-skewed. Where detector tests exist, their negatives are almost always false-positive controls ("this must NOT be flagged"). The polarity
bless_registryadded — a corpus holding the non-compliant shape that was measured green — appears in only three files (bless_registry,reason_code_registry,generation_policy_registry).Third: comment-stripping is applied inconsistently between sibling files and the split is not principled.
generation_policy_registry/reason_code_registrystrip;pool_capability_registry/disclosure_surface_registry/disclosure_derivation_registry/resource_grading_registrydo not.Source-level (NOT executed) — ranked, each with the concrete mutation
production_caller_gate.rs—body.contains("build::build("). Its doc reasons carefully about the false-red direction and never about false-green. Mutation: a nestedmod _pipeline_notes { pub mod build { pub fn build() {} } }, or one-lineconst _WHY: &str = "cmd_enable calls build::build( here";— a string literal, whichstrip_line_commentsdoes not touch.argument_registry_e2e.rs—src.contains(&format!("fn {func}(")), no#[test]check.ShapeProberows are skipped by the behavioural sweep, so this predicate is all that stands behind them. Mutation: delete the test body, leave/// Superseded. See the notes on fn wire_vintage_probe( in the design record.The file declares noMUTATION (RUN)block anywhere.ref_kind_stance_registry.rs— polarity blindness, not spelling.kinds_nameddoes strip comments (correcting one sub-finding), butcode.contains("'binding'")cannot distinguishIN (...)fromNOT IN (...). Mutation: delete the wordNOTatdaemon/src/graph.rs:1237— every assertion passes while the population has inverted to exactly the kinds the row declares excluded. Six sibling sites take the same one-token edit.disclosure_surface_registry.rs— six rows carryproducer: "lang", a 4-character bare substring matchinglanguage,lang_id,by_lang, or any comment. Mutation: delete a real disclosure, leave// no language disclosure here.disclosure_derivation_registry.rs— membership itself is decided byregion.contains("ACTIVATION_UNAVAILABLE")over an un-stripped corpus. Caught by an e2e forrender_count_basis; the same edit inrender_link_package_set(one of ~8) is green in both files.doc_citation_gate.rs— the comment filter is//-only. A single/* fn the_shipped_host_cannot_compile_wasm */at file scope makes the gate's own motivating phantom resolve as a declared item. The string-literal hole is disclosed and priced; this one is not mentioned anywhere.Also:
bounding_site_registry(vulnerable onfield_ident_exists, but honestly disclosed, best negative-corpus suite in the tree, and two of its declared mutations genuinely mutate the predicate);inline_cargo_build_registry(vulnerable by shape —.try_exists(), or an earlyreturn— but declares and runs a real predicate mutation);refusal_stage_registry(name-baseditem_is_declared, leans oncargo fmtto holdstarts_with("return ")up, but 2 of its 12 mutations are predicate mutations);resolution_percentage_stance(vulnerable only to rebinding, self-disclosed in the failure message, and already carries the full cure).NOT vulnerable — and these are the models to copy
reason_code_registry(comment/cfg(test)/enum/as_str/constall stripped before matching, word-boundarycontains_word,the_scan_itself_can_failwith 2 positives + 4 negatives, three declared scanner-predicate mutations plus a recorded survivor) ·plugin_command_registry(text predicate braced by a test that runs the real CLI per row) ·symbol_id_args_registry,completeness_gate,retired_tier_gate,signature_gate,tier3_origin_gate,prose_spacing_gate(behavioural) ·kind_table_guard, which countsmodule.imports()on the compiled module and says why: "a text scan for(importwould pass on a module whose import arrived some other way." That is this issue's lesson, written down before this issue existed.Two findings on the fixed exemplar itself
bless_registry's own declared mutation is now stale.every_registered_switch_routes_through_the_shared_verdictstill says "addbless_verdictto a waivered owner → RED". That wording was written for the OLDsrc.containspredicate (865e3a7) and survived the fix (b059146) unchanged. Underdelegates_to_the_shared_verdict, adding the bare name toruby_package_cost.rsleavesroutes == falseand the STALE WAIVER arm green. The mutation as written no longer produces the stated result.must_not_delegatehas no string-literal row. The predicate strips//but not string literals, so a refusal message containingprojection::bless_verdictwould satisfy it. The negative corpus covers local wrapper,//,///, and empty — not a string.What I did in this lane, and what I did not
I did not fix the eleven. Each needs its own
the_detector_can_failarm with its own predicate mutation, and bundling them into a workflow-and-bless lane would produce a diff nobody can review. They are recorded above with the exact edit that reproduces each.I did apply the lesson to the new gate this lane added (
ci_cadence::no_grading_step_is_masked_by_an_earlier_one, #169), and the result is worth recording here because it reproduces this issue inside a fresh file: weakeningruns_even_after_a_failureto accept any non-empty guard left the scan-over-real-workflows test GREEN — a compliant tree never exercises a weakened predicate — and only the syntheticthe_masking_detector_can_failwent red. A scan over real inputs structurally cannot discover that its own predicate has gone vacuous. That is the argument for the paired detector, measured rather than asserted.Priority if only three are fixed:
lockfile_forge_registry(failing now),pool_capability_registry(fix already written in the adjacent file),resource_grading_registry(the only invariant here no runtime arm can ever back up, guarded by acontainswhose own comment claims a discriminating property it does not have).🤖 Generated with Claude Code
https://claude.ai/code/session_01K1zj5VcFJvJt3pQxe9259K
Filed the first live instance of this class as #180 —
lockfile_forge_registry, which is blind today rather than merely capable of blindness. Its whole-filehand_escapedexemption is granted by a///doc comment atcrates/mcp-server/src/main.rs:1235, in the one file its own anti-vacuity floor singles out to prove the scan reachessrc/, so its declared mutation ("any scanned source → RED") is false as written. Measured with a control that isolates the doc comment as the sole cause.Two things from this issue's audit live in #180 rather than here, to keep them next to the worked example:
🤖 Generated with Claude Code
https://claude.ai/code/session_01K1zj5VcFJvJt3pQxe9259K
STAYING OPEN, NARROWED — the audit is complete; five confirmed-blind gates are still blind on master, and four of them are tracked nowhere else
Close-out lane, master
552e3a2. Title corrected.Done
The
bless_registryfix is on master and graded —the_delegation_detector_can_failatcrates/indexer/tests/bless_registry.rs:468, suite 5/5, EXIT=0. And the audit this issue asked for is finished: 11 registries rated vulnerable, all 11 mutated across two lanes, 11 confirmed / 0 refuted.Not done — and this is the whole reason the issue must stay open
Five of the confirmed-blind gates are unfixed, and
git log -- <file>shows none has been touched since this issue was filed:crates/daemon/tests/lockfile_forge_registry.rs09c9be4(pre-#178)crates/indexer/tests/pool_capability_registry.rs75f6308(pre-#178)crates/mcp-server/tests/resource_grading_registry.rs1aa6514(pre-#178)crates/test-support/tests/exec_copy_registry.rs656666f(pre-#178)crates/mcp-server/tests/shipped_binary_registry.rs8e6bcac(pre-#178)All five pass green today —
resource_grading_registry5/5,shipped_binary_registry5/5,exec_copy_registry7/7 — which is the same green they showed under the mutations that should have reddened them. A confirmed-blind gate that is still green is not a finding that has been acted on; it is a finding that has been written down.Only
lockfile_forge_registryhas its own tracker (#180). Closing #178 would droppool_capability_registry,resource_grading_registry,exec_copy_registryandshipped_binary_registryoff the board with no issue anywhere — which is exactly the silent disappearance this close-out lane exists to prevent.Corrected scope
Retitle as above. Strike "no other registry has been audited" — that is discharged. The remaining work is: fix, or split into per-gate trackers, the four blind registries that have no owner, plus
lockfile_forge_registryif #180 is not taken first.Residuals the implementing lane named, recorded here so they are not lost
disclosure_surface_registry'sproducesis still a spelling —fn search_text'slangparameter alone satisfies one row.kind_polarityleaves SQL shapes outside its four classes unclassified: 21 sites classify against a floor of 10.COSI_E2E_LEG=daemone2e failures with one signature on different tests per run (index_coverage_facts_e2e::a_refused_file_is_not_reported_as_indexed_and_current,activation_offer_e2e::an_unconsultable_store_is_never_rendered_as_nothing_to_activate), both passing in isolation — reported as a fixture-readiness race, not blessed. That is #192.Gate-design class: a population check satisfied by the very thing it was meant to detect — bless_registry's src.contains("bless_verdict") passed on every local wrapper, and the other registries were not audited for the same shapeto Five registries were CONFIRMED blind by mutation and four have no tracker: pool_capability, resource_grading, exec_copy and shipped_binary are still green under the mutations that should redden them$minFreeGbassignments with different values, and the gate pinning them matches whole-file so it only ever sees the first — the Windows reclaim can never fire #193release_gate_e2e.rs:102-122still says musl is continue-on-error and that nothing runs the step-13 migration gate — both false since #84 #187phantom_count == 0bounds ~50 hand-written probes, not the corpus, and it is cited across the tree as an absolute guarantee #188