diff --git a/.ripwire_quality_acks b/.ripwire_quality_acks index 9e9ca80e9..e889f393b 100644 --- a/.ripwire_quality_acks +++ b/.ripwire_quality_acks @@ -598,6 +598,7 @@ ack duplication 121ebb365bfb27c5 41 now=41 was=0 p=src/model.h:312 41-token clon ack duplication 12a98f49622cc5c4 39 now=39 was=0 prov=recon facet=one-statement main.cpp split 2026-08-29: NOT new duplication — the 39-token AnchorKey::operator< / model.h lessUnindexedExt near-miss pair existed verbatim at the base (operator< moved byte-identical from main.cpp to verbs_report.h); clone groups key on their member set, so the moved path minted a new group id for a pre-split pair. argvdiffcheck proves the bodies unchanged ack duplication 15ba8af502e0d24e 93 assignment types (narrowcheck arms 44-51): api-surface buildFieldNarrowTables gains the class-name set (1 to 2 params) because its local-name set must drop an assignment's callee-read type that no class is called, the same rule Rule 2's varType table applies, and the set is built once in buildGraph and once in collectFieldUseSites rather than re-derived per call. duplication/new-clone-of-reused-helper classNameSet ~ layout.h buildAggIndex (93 tokens): classNameSet is the Class/Struct/Interface loop buildGraph already carried inline for Rule 2c, hoisted into resolve.h so collectFieldUseSites can share it; buildAggIndex maps a name to its ids in layout.h, which includes graph.h, so resolve.h cannot reuse it and a common helper would invert the include order for a 7-line loop with a different value type. ack duplication 160ac41979d9ebaf 674 capture-audit 2026-09-04 wave-1 close: symbols two lanes each grew past the other's acked magnitude — runDoctor (L10 legend + blobs_floor=, L9 built_from=), writeEnsembleReport (L9 root=, L10 conditional unavailable=), runAffected/runVerify (L9 root-relative block, L4 gauge), writeTestGateReport (L4 gauge splice, L9 row-gated root=; the XML/JSON twins' duplication is the lockstep mcpclidiffcheck asserts, as L9 acked; graphGaugeAttrXml/Json are the same lockstep), writePanelReport (L10 conditional attrs, L4 counts_floor), printUsage/validateConfig (L1 H10 hoist + L5/L9/L10 help text). Re-acked at the merged magnitude; prior reasons kept | prior: M12 (lane L9, capture-audit-2026-09-04): the deliberate cost of one root-relative path spelling across --affected/--test-gate/edit receipts/fetch_body plus the in_id= legend trim. runAffected grows the same mvSingleRoot/mvRootPrefix/mvRootAttr block verbs_report.h's dispatcher already threads (complexity 13->18, verbosity +17, mostly the comment naming the finding); writeTestGateReport/Json's duplication is the XML/JSON twin pair staying in lockstep, which is the property mcpclidiffcheck asserts; every short-horizon-churn row is this lane editing its own targets three times in one afternoon. +ack duplication 16e6f4fa69a7b5c4 83 now=83 was=0 p=src/exemplarfamily.h:1708 train ge2 composition, a shape-only pair over different data: unitIdsOf ranks each key by binary search in its sorted distinct set (it shrank to 83 tok when sort-unique folded its sort+erase into sortutil::sortUnique), shrinkInterned interns each token text into a hash map (new in qd-shrink-pair). Same reserve+push loop, different lookup and element types; over the operand path 80-tok ceiling, so the type proof cannot demote it. ack duplication 177c6a61c6c2c3a2 28 the three sidecar read seams keep one O_NOFOLLOW shape by design, each with its own once-per-site DISCLOSE (pathguard.h round 3) ack duplication 189c716a1f2298cc 42 now=42 was=0 prov=recon facet=one-statement test/verify_strkern.cpp keeps VERBATIM copies of escapeXml/appendCdataSafe/escapeInto (as *Ref, plus one deliberately mutated set) and a masksEqual predicate as the doctest ORACLES the kernels are proven against; a reference that shared the shipped code would move with it and prove nothing (the TU's header says so) ack duplication 197e1f32ffe97006 42 by=src/* now=42 was=0 prov=recon facet=one-statement slice honesty round (lane H): token-shape clones between one-line predicate/name-table helpers in slice.h and unrelated domains (naminglens predicatePrefixed, pattern servedNames/resolvedNames, quality headSnapExclHex, model localsCountedLang) — no shared identifiers, different scopes; reviewed by the lane and the orchestrator and declined to merge across domains (the clone-idiom class) @@ -674,19 +675,19 @@ ack duplication 649a99661f221ead 18 now=18 was=0 p=test/receiverevidencefix/js/l ack duplication 64b9cdaf064825c4 18 now=18 was=0 prov=recon facet=one-statement sendAll (mcpserver.h, network send-all-tolerating-short-writes) and pathguard::writeAll (file write-all-tolerating-short-writes) are the same RETRY-LOOP shape over different syscalls (send vs write/EINTR) and different domains (socket vs file descriptor) — the tree already acks this idiom repeatedly (e.g. the three os:: syscall passthroughs vs profilePmc.h): no shared helper exists to call, and folding network and file write-loops together would put a dispatch where a three-line loop is ack duplication 64c50349786b7508 26 now=26 was=0 prov=recon facet=one-statement nested-closure span-attribution fix (jsnestedcheck): spanContains is sameSpan's sibling predicate (containment vs identity — 26 shared tokens are the four ts_node_*_byte reads, nothing mergeable); captureTagsFacts verbosity is the constraint comment on the containment stop + churn=self is this fix editing the tags pass; webpack nest>=4 individually-scoped rows 18%->98%, gate jsnestedcheck green ack duplication 6562d36ca101b8a5 35 now=35 was=0 prov=recon timsort vendoring: every row is the vendored src/infra/timsort.hpp (upstream v3.0.1 + the recorded workspace patch) plus the facade forwarder it needs. The complexity/verbosity/params/duplication rows are UPSTREAM's shape — mergeLo/mergeHi, gallopLeft/gallopRight and the timsort/timmerge overload pairs are twins in the release itself — and restructuring them would destroy the property that makes the file auditable: that it can be re-derived byte-for-byte from a public tag plus one described patch. The one preexisting-worse row, infra::sort::stable vs infra::sort::unstable at 22 tokens, is what a facade IS: each entry is a one-line forward to a DIFFERENT algorithm, and collapsing them into one algorithm-parameterised template would hide the explicit named choice the layer exists to make (G5). Nothing is routed to timsort; test/timsortcheck.sh is what keeps the file honest. -ack duplication 675204169bc3d5d2 33 now=33 was=0 prov=recon wave-3 close, H7 hosts (substrfiltercheck --plan/--abi arms): printStrayFilterNoMatch is the ONE sentence for a --stray-content filter that selects no ref, spoken by the bare verb and its two hosts; it shares refuseFlagValue's fprintf shape (33 tokens) but not its contract — arm C pins the 'not a measurement' clause the value-domain sentence lacks +ack duplication 675204169bc3d5d2 33 now=33 was=0 prov=recon facet=call-sequence wave-3 close, H7 hosts (substrfiltercheck --plan/--abi arms): printStrayFilterNoMatch is the ONE sentence for a --stray-content filter that selects no ref, spoken by the bare verb and its two hosts; it shares refuseFlagValue's fprintf shape (33 tokens) but not its contract — arm C pins the 'not a measurement' clause the value-domain sentence lacks ack duplication 684647802ce3b5ef 45 now=45 was=0 prov=recon facet=one-statement D3 Windows port (lane/win32-d3-onto-os): four short token clones between os.h's Windows half and unrelated code, each a generic idiom rather than a shared rule — a one-line std::ranges::any_of membership lambda (win32TableProduces | cli.h shipsViewFlag, 34 tokens), a case-folding endsWith (oswin::endsWithAsciiCaseless | darkflags endsWithView, 45 tokens; os_win32_logic.h is a leaf infra header with no project includes, so it cannot call darkflags), an RAII reset (os_win32.cpp Unique::reset | pathguard OwnedFd::reset, 26 tokens; a HANDLE/SOCKET/HLOCAL owner cannot be an fd owner), and a three-term suffix OR (isWslLauncher | two unrelated predicates, 26 tokens). The larger clones (table scans, the PATHEXT reader) were refactored away instead of acked. ack duplication 689ab18d529fb67c 21 now=21 was=0 prov=recon P3.2 plan-lint model correction (validated against the field-evidence source repo's own flagship plan): computePlanLint/writePlanLint grow in complexity/verbosity because status now resolves from the §Status ledger as well as the card body (the real house dialect), extracted into resolveLedgerStatus to keep the growth to the genuinely new logic; missingWhy clones gitmine::coPairAttr and testmap::affectedSeededBy — the same trivial-classifier-idiom false positive already acked for glyphName/shapeName (a 3-branch string-constant selector has almost no room to look structurally unlike another one) ack duplication 689e8ff37b877fd0 169 P3 duplication: editCheckCallSites vs quality::topLevelCalleeNameHashes, 169 tokens. Both are 'one pass over ing.references with continue-filters, then sort+unique' — an IDIOM collision, not a reusable helper: different predicates, different element types (a pair vs a uint64 name hash) and different questions. Extracting a shared filter-sort-unique-over-references template parameterised by a lambda would be less readable than either and is the abstraction-for-its-own-sake G2 warns about. Kept as two clear loops, deliberately. ack duplication 68b1751fdaff3631 19 now=19 was=0 prov=recon lane fix/cpp-macro-member-reparse-2026-09-11: test/extentfix/leak.cpp and test/extentfix/control/leak.cpp are the extent detector's designed fixture PAIR (the control is the leak with semicolons added), so their free functions are byte-identical by construction; the pair only re-keyed because the leak's macro moved to lowercase (the member-macro re-parse repairs the ALL-CAPS spelling, so the detector needs a shape that still derails) and the leak copies are filed under IndiaError:: ack duplication 68b8ec360ff58496 38 a two-field DISCLOSE sink: the switch maps each reason to its own field, the shape every such sink shares ack duplication 698b647d75b377de 73 now=73 was=0 p=src/lintrules.h:311 lane FE-B (receiver evidence): lexical clone pairs, not shared logic — the per-language predicates (implicitReceiverLang, classNameReceiverLang, memberNeverReachesFreeFunction, isReceiverEvidenceKind, callableKind, classLike, isThisRoot) are one-line OR-lists over different enum sets that share only the shape with quality.h/model.h/slice.h predicates asking other questions; keyOf/typeKey build different keys into a reused buffer; classAt (innermost class span by byte) vs flipimpact innermostAtLine (by line, other table); impactViaColumn vs lintrules dependencyCapableMask share a bitmask idiom; the JS fixture encode|stringify is a deliberate twin (test/receiverevidencefix: same-named near misses); pargates.py is unchanged since cd87e30e (a regrouped pre-existing pair). The one real clone, the enclosing-function walk, was merged into innermostEnclosingFn instead of acked -ack duplication 69bea33de722cde5 23 now=23 was=0 prov=recon Integration train 1b (lane/reader-fuzzers @ 8f6f86f5): the fuzz harness appendPod deliberately re-implements the on-disk writers (qsnapPut's byte append) so the harness shares no code with the reader it attacks +ack duplication 69bea33de722cde5 23 now=23 was=0 prov=recon facet=call-sequence Integration train 1b (lane/reader-fuzzers @ 8f6f86f5): the fuzz harness appendPod deliberately re-implements the on-disk writers (qsnapPut's byte append) so the harness shares no code with the reader it attacks ack duplication 6a595c85c47abd60 74 now=74 was=0 prov=recon facet=switch-name-table per-enumerator switches name every enumerator and carry no default: on purpose — that is what makes -Werror=switch a compile error at each one when an enumerator is appended; two such switches over one enum share the enumerator spelling by construction ack duplication 6a7680fbd8a5083d 20 by=src/* now=20 was=0 prov=recon slice honesty round (lane H): token-shape clones between one-line predicate/name-table helpers in slice.h and unrelated domains (naminglens predicatePrefixed, pattern servedNames/resolvedNames, quality headSnapExclHex, model localsCountedLang) — no shared identifiers, different scopes; reviewed by the lane and the orchestrator and declined to merge across domains (the clone-idiom class) ack duplication 6c20f55a7fbeda1b 41 now=41 was=0 prov=recon lane E close (terminality round A): suite fixture data (bench/agentloop/editsuite/fixture/geometry.cpp) shares distance's body with test/fixture/geometry.cpp; the fixture is byte-frozen measured data (baseline + post-fix tables) ack duplication 6cd742e97a513018 121 now=121 was=0 prov=recon C++ template scopes (test/cpptmplscopecheck.sh): enclosingScopeOf's tail became one call, cppScopeNameText( fieldChild( p, Name ), src ), which strips a class specialization's template arguments. The shorter body is what put its ancestor walk (for-parent loop, kindIs owner chain, return the owner's name) over the similarity bar against kotlinEnclosingScopeOf; the shape itself predates this change. The two stay separate on purpose, for the reasons kotlinEnclosingScopeOf's own comment gives: Kotlin owners carry no name: field, and class_declaration is also a Java/C#/TS/Swift kind that the shared walker must not start scoping. Folding them would undo that, and padding the body back out to dodge the detector would be worse. -ack duplication 6d12720fc529d68f 78 now=78 was=0 prov=recon two --skipped parse-time classes, each a one-call wrapper over collectSkipClass; each conditional legend clause rides only with its own rows +ack duplication 6d12720fc529d68f 78 now=78 was=0 prov=recon facet=call-sequence two --skipped parse-time classes, each a one-call wrapper over collectSkipClass; each conditional legend clause rides only with its own rows ack duplication 6d150695fe878c68 46 now=46 was=0 p=src/mcp.h:663 truth-fixes review round 1: the nine duplication rows pair this lane's small helpers with unrelated idioms of the same shape, and merging any pair would name neither. rustUseHead (strip self::, cut at the first of ':{, ') matches helpBareName, scopeTail and RustPaths::crateRootDir only as a strip-then-cut string_view return; importTierRollupDir keeps the importer's directory when it is shallower than the depth, where TestRunnerIndex::leadingComponents returns the whole path; importTierRollupAttrXml/importTierRollupJson share only the present-only empty-or-attribute return with forLensNotesStanza and mcpEnvelopeNoteField; impactImportTier is now the collect-sort-unique of the seeds' files in front of impactImportTierOfFiles (IMPACT-PATH), the same idiom as callersUnionSize and mergeBuiltinsWithConfig. Complexity, verbosity and params rows are minor or new-symbol and do not gate. ack duplication 6df9a7992177fa30 30 by=src/extentsuspect.h now=30 was=0 prov=recon lane fix/cpp-macro-member-reparse-2026-09-11, extent detector (src/extentsuspect.h): extent::inSet is the std::find( begin, end, v ) != end membership test over a constexpr std::array of enums (the SymKind and Lang rule tables, 9 call sites). Its partners spell the same one-liner over a span of string_view (ingest_relations.h namesNode), an initializer_list of string_view (naminglens::ncAnyOf) and a Scope pattern vector (quality::scopeUsesDiffToken), and notes::sortNotes is a bare std::stable_sort. An idiom collision at 30-36 tokens across four subsystems: no member can take another member argument type, and the comment on namesNode records this spelling as the house one. ack duplication 6eb56ce0fdaf38b7 46 now=46 was=0 p=src/graph.h:15506 truth-fixes review round 1: the nine duplication rows pair this lane's small helpers with unrelated idioms of the same shape, and merging any pair would name neither. rustUseHead (strip self::, cut at the first of ':{, ') matches helpBareName, scopeTail and RustPaths::crateRootDir only as a strip-then-cut string_view return; importTierRollupDir keeps the importer's directory when it is shallower than the depth, where TestRunnerIndex::leadingComponents returns the whole path; importTierRollupAttrXml/importTierRollupJson share only the present-only empty-or-attribute return with forLensNotesStanza and mcpEnvelopeNoteField; impactImportTier is now the collect-sort-unique of the seeds' files in front of impactImportTierOfFiles (IMPACT-PATH), the same idiom as callersUnionSize and mergeBuiltinsWithConfig. Complexity, verbosity and params rows are minor or new-symbol and do not gate. @@ -704,9 +705,10 @@ ack duplication 767f5200ffbdb095 54 now=54 was=0 prov=recon E1 answer grader + q ack duplication 77278c286d945470 22 now=22 was=0 prov=recon timsort vendoring: every row is the vendored src/infra/timsort.hpp (upstream v3.0.1 + the recorded workspace patch) plus the facade forwarder it needs. The complexity/verbosity/params/duplication rows are UPSTREAM's shape — mergeLo/mergeHi, gallopLeft/gallopRight and the timsort/timmerge overload pairs are twins in the release itself — and restructuring them would destroy the property that makes the file auditable: that it can be re-derived byte-for-byte from a public tag plus one described patch. The one preexisting-worse row, infra::sort::stable vs infra::sort::unstable at 22 tokens, is what a facade IS: each entry is a one-line forward to a DIFFERENT algorithm, and collapsing them into one algorithm-parameterised template would hide the explicit named choice the layer exists to make (G5). Nothing is routed to timsort; test/timsortcheck.sh is what keeps the file honest. ack duplication 774b8194ffdecea7 59 by=src/* rung 3 flow-sensitive reaching definitions (docs/EVALS.md 'Flow-sensitive slice in the small', 2026-09-03, lane/n6-b). edgesOf: the contract change IS the point — the diff now reads the scan's reach table (scan, rowOfOcc, cap) so rows/flow/diff share one edge oracle. sliceEmitBody +4 cx: the rd= emission per use row (its formatting already factored into sliceAppendReachAttr). The three duplication rows are the idiomatic tree-sitter named-child loop (seq/hasStructureBelow vs ingest helpers) and a two-way family ternary — no shared logic to lift. short-horizon-churn = self-churn of the two files this lane owns. sliceLegendText +11 lines = the registered per-construct disclosures the band requires on the first screen. ack duplication 78dd7140b7c84cd3 20 now=20 was=0 p=src/cachelint.h:154 lane FE-B (receiver evidence): lexical clone pairs, not shared logic — the per-language predicates (implicitReceiverLang, classNameReceiverLang, memberNeverReachesFreeFunction, isReceiverEvidenceKind, callableKind, classLike, isThisRoot) are one-line OR-lists over different enum sets that share only the shape with quality.h/model.h/slice.h predicates asking other questions; keyOf/typeKey build different keys into a reused buffer; classAt (innermost class span by byte) vs flipimpact innermostAtLine (by line, other table); impactViaColumn vs lintrules dependencyCapableMask share a bitmask idiom; the JS fixture encode|stringify is a deliberate twin (test/receiverevidencefix: same-named near misses); pargates.py is unchanged since cd87e30e (a regrouped pre-existing pair). The one real clone, the enclosing-function walk, was merged into innermostEnclosingFn instead of acked +ack duplication 78fc2655c0e1c19a 59 now=59 was=0 p=src/defectshape.h:3851 QD-VA-FORMS (E0): Script::vacuousJudgmentSites is the 4-line filter loop (push each judgment's pos that vacuous() marks); markInnerRows and isThisBuildRootBlobName match its loop shape only ack duplication 7981b72e3b2a8a8b 42 now=42 was=0 prov=recon mcpIsGitOnlyVerb (finding #8, 2026-08-15 harvest) is a 6-line linear-scan-and-compare over the SAME small kMcpGitOnlyVerbs table mcpGitOnlyNotBatchServed already loops beside it (mcp.h:127-144); query.h::isKnownLayerWord is the same trivial 'is w one of these known short strings' idiom over an UNRELATED domain (the graph-query layer vocabulary). Per this repo's own precedent (V6/isKnownVerb, ROUTING_LEDGER.md's V6 lane), forcing a shared cross-file generic membership helper across two unrelated small closed vocabularies is the wrong abstraction for a token-shape match, not a real duplication to collapse ack duplication 7ad6b911a1122824 71 now=71 was=0 prov=recon a probe TU deliberately mirrors layout declarations (#224 structlayout_probe.cpp) -ack duplication 7ad7c707204ff7b3 23 now=23 was=0 prov=recon qsnapPut is constrained to types with unique object representations instead of asserting trivially-copyable, which leaves its body the same one-line byte append ByteW::u32 is; the two live in different translation units on purpose (quality.h cannot include the ingest cache) +ack duplication 7ad7c707204ff7b3 23 now=23 was=0 prov=recon facet=call-sequence qsnapPut is constrained to types with unique object representations instead of asserting trivially-copyable, which leaves its body the same one-line byte append ByteW::u32 is; the two live in different translation units on purpose (quality.h cannot include the ingest cache) ack duplication 7c7e4b442785bcb3 44 now=44 was=0 prov=recon DISCLOSE sinks: a reason-to-field switch is the shape every multi-reason sink shares; -Wswitch exhaustiveness over DisclosureWhy is the point (Diagnostics.h 4b) ack duplication 7d0430629c8f4eb3 56 now=56 was=0 prov=recon DISCLOSE sinks: a reason-to-field switch is the shape every multi-reason sink shares; -Wswitch exhaustiveness over DisclosureWhy is the point (Diagnostics.h 4b) ack duplication 7f16ebd0f240a76b 154 now=154 was=0 prov=recon ingest() decomposition: emitBindingAliases/emitRouteDefs are the FFI-alias and route-def sort ladders moved verbatim out of ingest()'s body into named phase helpers (ingest_model.h); as inline statements the clone scanner could not see them, as small functions their comparator shape token-matches sortLintRows - different element types and orderings, no shareable contract, zero behavior change (argvdiff byte-identical) @@ -714,8 +716,10 @@ ack duplication 800e349715392948 34 now=34 was=0 prov=recon cachefix fixture fun ack duplication 80592eb798e70ca6 47 now=47 was=0 prov=recon facet=one-statement Integration train 2b (PR #244, TS/JS literal receivers): isJsTsLitRecv (a five-case RecvKind membership test), jsLitCtorName (a five-case RecvKind -> constructor-name switch) and isJsTsBuiltinCtor (a five-string membership test) are each the smallest spelling of one fact about the Lit* enumerators appended in the same PR. Their token runs match refRoleTag, styleTag, votingStyle, langUsesHashComment, elixirTypedAttribute and a clone-idiom fixture by SHAPE (a short enum switch, an OR of equality tests), not by shared logic: no helper exists they could call, and folding unrelated enums into one table would couple them. Acked at the train that first measured them on the merged tree; the three stay adjacent in model.h beside the enum they describe. ack duplication 80687d1d75e6d462 86 now=86 was=0 p=src/graph.h:15441 truth-fixes review round 1: the nine duplication rows pair this lane's small helpers with unrelated idioms of the same shape, and merging any pair would name neither. rustUseHead (strip self::, cut at the first of ':{, ') matches helpBareName, scopeTail and RustPaths::crateRootDir only as a strip-then-cut string_view return; importTierRollupDir keeps the importer's directory when it is shallower than the depth, where TestRunnerIndex::leadingComponents returns the whole path; importTierRollupAttrXml/importTierRollupJson share only the present-only empty-or-attribute return with forLensNotesStanza and mcpEnvelopeNoteField; impactImportTier is now the collect-sort-unique of the seeds' files in front of impactImportTierOfFiles (IMPACT-PATH), the same idiom as callersUnionSize and mergeBuiltinsWithConfig. Complexity, verbosity and params rows are minor or new-symbol and do not gate. ack duplication 8171b5f88b2abb71 26 now=26 was=0 prov=recon D3 Windows port (lane/win32-d3-onto-os): four short token clones between os.h's Windows half and unrelated code, each a generic idiom rather than a shared rule — a one-line std::ranges::any_of membership lambda (win32TableProduces | cli.h shipsViewFlag, 34 tokens), a case-folding endsWith (oswin::endsWithAsciiCaseless | darkflags endsWithView, 45 tokens; os_win32_logic.h is a leaf infra header with no project includes, so it cannot call darkflags), an RAII reset (os_win32.cpp Unique::reset | pathguard OwnedFd::reset, 26 tokens; a HANDLE/SOCKET/HLOCAL owner cannot be an fd owner), and a three-term suffix OR (isWslLauncher | two unrelated predicates, 26 tokens). The larger clones (table scans, the PATHEXT reader) were refactored away instead of acked. +ack duplication 8411d490b4fbcab6 61 now=61 was=0 p=src/shstatus.h:1534 QD-VA-FORMS (E0): shstatus listTextOf joins the and-or texts it computes per element (itemsText) with ' ; '; joinClauses / commaSymbols join precomputed views, so reuse would build a temporary vector of strings to join ack duplication 8a652c25d25d8e47 37 by=src/* now=37 was=0 prov=recon facet=one-statement member-variable round (card A3), side-table rule: isMemberAccessSite is the ONE definition of the member-access predicate contextratio.h / nonlocalstate.h / graph.h share; the 37-token pairs with editCheckImplicitReceiver and eligibleForJoin are the two-conjunct-bool-predicate SHAPE, not shared logic ack duplication 8a9cd25a7ac4001d 46 now=46 was=0 p=src/ingest_binds.h:5194 call-result typing: rustWrapperOf is the house one-line table lookup (std::ranges::find with a projection), the same idiom as subscriptOperatorNamesOf / startupRecordFor; three rows, nothing to share +ack duplication 8b01b130480374a5 22 now=22 was=0 p=src/query.h:185 QD-VA-FORMS (E0): shstatus Parser::peek and query's Eval::peek are each parser's bounded accessor of its own token vector (22 tokens, the one-statement idiom) ack duplication 8b236ff8e22bac99 43 now=43 was=0 prov=recon dynmapsimd harness oracles deliberately restate the scalar contract (independent test oracle); dynamic_map ctor churn is this feature's own edit window ack duplication 8c1252540ce9a74e 56 now=56 was=0 prov=recon OPTREMARKS F3 (docs/OPTREMARKS.md §8b): the ~430 per-AST-node std::strcmp( t, "literal" ) sites in the five ingest walk sections become rw::kindIs (src/infra/nodekind.h) — an inline compare, because strcmp is an external symbol LTO cannot inline and on macOS costs two dyld stub hops before it starts. Measured: 10.6% of busy CPU in strcmp leaves on a cold llvm run, 6-12% on four other corpora; 0.23% after. Output byte-identical across 7 corpora x 5 verbs, argvdiffcheck 640/642 vectors identical (the 2 that differ are the +dirty build stamp in --version). WHAT THESE ROWS ARE. (a) 95 short-horizon-churn rows, churn=self: the mechanical rewrite touches essentially every function in ingest_{metrics,binds,sidecap,relations,names}.h, so every one of them shows this lane's own single edit. Not thrash — one commit. (b) 7 duplication rows and 1 new-clone-of-reused-helper. These are REAL new clone groups (--clones, uncapped: 407 groups before, 409 after; the rewrite adds 7 and removes 5) and they are IDIOM COLLISIONS, not copies. kindIs( t, "x" ) is shorter than std::strcmp( t, "x" ) == 0, so short predicate bodies that were previously above the clone threshold now match each other's normalized token stream. Six of the seven pair a node-kind || -chain with an unrelated || -chain over a DISJOINT literal set in a different subsystem — cc_isParamList (tree-sitter parameter-list kinds) against predicatePrefixed (English name prefixes is/has/can), against sliceIsJsPatternKind (JS destructuring kinds), rubyCallIsAssignmentTarget against slice.h's JS binding probes. The tool's own rule is that two ladders over the SAME enum are a copy; these share no non-keyword identifier and no domain, and merging any pair would need a helper parameterised on an unrelated literal table — a wrong abstraction to satisfy a lint. The seventh, kindIs | lexTokenEqualsLowered, is the same shape at 56 tokens with materially different contracts: lexTokenEqualsLowered takes an explicit length and case-folds one side, kindIs takes its length from the literal's type and compares the terminating NUL as an ordinary byte — and that NUL comparison is precisely the safety property kindIs depends on (test/nodekindcheck.sh arm B proves the absence of a read past it with an mprotect(PROT_NONE) guard page). Folding them together would erase the one property being gated. Gate: test/nodekindcheck.sh, 4 arms, 1,348,096 enumerated (candidate, literal) pairs against std::strcmp plus two mutation controls that each turn an arm red. ack duplication 8c49388791b303b8 56 now=56 was=0 prov=recon DISCLOSE sinks: a reason-to-field switch is the shape every multi-reason sink shares; -Wswitch exhaustiveness over DisclosureWhy is the point (Diagnostics.h 4b) @@ -745,12 +749,15 @@ ack duplication a405a9c684c97953 781 now=781 was=0 prov=recon timsort vendoring: ack duplication a42cd763fdab0077 101 a probe TU deliberately mirrors layout declarations (#224 structlayout_probe.cpp) ack duplication a5943aaae0184b8f 30 readability-wave1 (naming lens): ncAnyOf is a one-expression std::find wrapper, sortNotes a one-expression std::stable_sort wrapper — 30 normalized tokens of the SAME STL-adapter idiom over unrelated types (a char-class set test vs a note sort). There is no call ncAnyOf could make to sortNotes, and rewriting the std::find as a hand loop would only hide the detector. Kept as written. ack duplication a702e882c0354944 44 now=44 was=0 prov=recon DISCLOSE sinks: a reason-to-field switch is the shape every multi-reason sink shares; -Wswitch exhaustiveness over DisclosureWhy is the point (Diagnostics.h 4b) +ack duplication a706372cca78119c 61 now=61 was=0 p=src/mcprefusal.h:151 QD-VA-FORMS (E0): shstatus listTextOf joins the and-or texts it computes per element (itemsText) with ' ; '; joinClauses / commaSymbols join precomputed views, so reuse would build a temporary vector of strings to join +ack duplication a7385e5c77e06492 26 now=26 was=0 facet=one-statement p=src/quality.h:1164 qd-shrink-pair 2026-11-20: pathQualifiedKey(relPath, Symbol) now delegates its keying rule to definitionQualityKey (the one rule the history-blob readers share, langidentity predicates -1); the one-statement pair with symbolHasStaticLinkage (a linkage predicate) shares only the s.lang read, and no helper serves both ack duplication a7aef5cdfefbb6e0 89 now=89 was=0 prov=recon sibling row-emitter PAIR (writeUnindexedExtRows/writeLangRows) - exactly TWO members: the key a7aef5cdfefbb6e0 is fnv1a64('writeLangRows\nwriteUnindexedExtRows\n') and nothing else. WAVE-3 VERIFIER CORRECTION (P6-6): this reason previously named writeHealthRows as a third member, which is in NO clone group at all - that made the ack unverifiable against the ledger and made '2-instance' read as a three-way judgement it never was; and it cited 'the DOD doctrine' (G2), a DATA-LAYOUT guardrail that says nothing about a six-line emitter running once per report. The engineering call is unchanged and was independently attacked and NOT refuted. Its real authority is --quality-delta's own 'a wrong abstraction beats a low score' plus this repo's own fold threshold: src/mergescout.h:637 writeSymRows and src/main.cpp:8746 writeDropRows were folded because the attribute SCHEMA is identical and only the tag varies, while writeOversizeRows/writeDropRows sit deliberately UNFOLDED in the same block at a LARGER similarity=0.90 tokens=139, for exactly the discriminator that applies here - differing attribute sets. writeLangRows/writeUnindexedExtRows differ in the key attribute name (x= vs n=), the key SOURCE (a stored field ue.ext vs a derived rw::langTag) and the attribute arity (files= vs files=+symbols=), so they fall on the repo's own keep-separate side; every consolidation sketch is net longer, needs two callables per site, and drags the fixed-buffer snprintf into a lambda past test/fixedbufsweep.sh:259's per-site census (which this wave already had to re-pin 191->193). TREND, recorded rather than left silent: this six-emitter block now carries TWO unfolded clone pairs (139 preexisting + 89 new) and accretes sibling emitters by design. At a THIRD same-schema sibling, writeSymRows' three-caller precedent flips the answer - and it cannot creep there silently, because this ack is keyed at exactly tokens=89 over exactly these two members, so a third member is a new member set, a new group, and a new finding ack duplication a8ae4177bad34c1b 47 now=47 was=0 prov=recon facet=switch-name-table per-enumerator switches name every enumerator and carry no default: on purpose — that is what makes -Werror=switch a compile error at each one when an enumerator is appended; two such switches over one enum share the enumerator spelling by construction ack duplication aa09687719d00a40 21 now=21 was=0 p=src/atoms.h:562 resolveFocus is the two-line projection wrapper the tower split (their focusOfOrderedMatches) makes inevitable: its 21-token overlap with atomsOfConfusion and testRowsJoined is the house forwarding idiom itself (return g(ing, args...) ) — three unrelated lanes that each delegate once to a named callee. Removing the wrapper would re-open the composition at every single-pick call site, which is MORE duplication, not less; collapsing the helpers would weld the atoms, test-rows and name-resolution lanes into one shared body that has no common contract. Reviewed shape, acked as idiom. ack duplication aaaee0ca15e7adfd 56 now=56 was=0 p=src/model.h:246 lane FE-B (receiver evidence): lexical clone pairs, not shared logic — the per-language predicates (implicitReceiverLang, classNameReceiverLang, memberNeverReachesFreeFunction, isReceiverEvidenceKind, callableKind, classLike, isThisRoot) are one-line OR-lists over different enum sets that share only the shape with quality.h/model.h/slice.h predicates asking other questions; keyOf/typeKey build different keys into a reused buffer; classAt (innermost class span by byte) vs flipimpact innermostAtLine (by line, other table); impactViaColumn vs lintrules dependencyCapableMask share a bitmask idiom; the JS fixture encode|stringify is a deliberate twin (test/receiverevidencefix: same-named near misses); pargates.py is unchanged since cd87e30e (a regrouped pre-existing pair). The one real clone, the enclosing-function walk, was merged into innermostEnclosingFn instead of acked ack duplication aada023eba533a38 35 now=35 was=0 prov=recon facet=one-statement lane C plain-text prose tier (test/textdocscheck.sh): .rst/.adoc/.org/.mdx join kLangTable on Lang::Markdown so --recall can answer from an ADR that is not written in markdown. All five gating rows are this lane's own footprint. TWO short-horizon-churn churn=self rows: kLangTable is the language table this change exists to extend, and kParserVer is the cache key an extraction change is REQUIRED to move (ingest_cache.h's own note says so) — both are structural for any lane of this kind, not thrash. THREE clone rows on isMarkdownGrammarExtension, all 35-token idiom collisions on a one-line membership predicate: it now spells the sorted-table + std::binary_search + is_sorted static_assert shape that externalnames.h::isShellBuiltinName/isPythonBuiltin/isCFamilyStdName already carry (their own note at externalnames.h:98 records this exact collision and settles on this shape), and the KindCounts::total pair is a std::accumulate over std::begin/std::end normalizing to the same token stream. Two cheaper spellings were tried and REJECTED by measurement first: a hand-rolled scan loop is the five-instance clone shape ingest.h::isNonTextExtension's note already names, and a std::find one-liner cloned KindCounts::total alone. What was FIXED rather than acked in this pass: six duplication rows (the loop -> the house binary_search shape) and kLangTable's verbosity row 96->120 (the tiling essay moved out of the table body onto the seam above it). ack duplication aafecfcf6097b13e 20 now=20 was=0 prov=recon facet=one-statement sendAll (mcpserver.h, network send-all-tolerating-short-writes) and pathguard::writeAll (file write-all-tolerating-short-writes) are the same RETRY-LOOP shape over different syscalls (send vs write/EINTR) and different domains (socket vs file descriptor) — the tree already acks this idiom repeatedly (e.g. the three os:: syscall passthroughs vs profilePmc.h): no shared helper exists to call, and folding network and file write-loops together would put a dispatch where a three-line loop is +ack duplication ac42c58498a7fc09 50 now=50 was=0 p=src/defectshape.h:3851 QD-VA-FORMS (E0): Script::vacuousJudgmentSites is the 4-line filter loop (push each judgment's pos that vacuous() marks); markInnerRows and isThisBuildRootBlobName match its loop shape only ack duplication ac8c6ea52654e17b 33 now=33 was=0 p=test/pargates.py:510 lane FE-B (receiver evidence): lexical clone pairs, not shared logic — the per-language predicates (implicitReceiverLang, classNameReceiverLang, memberNeverReachesFreeFunction, isReceiverEvidenceKind, callableKind, classLike, isThisRoot) are one-line OR-lists over different enum sets that share only the shape with quality.h/model.h/slice.h predicates asking other questions; keyOf/typeKey build different keys into a reused buffer; classAt (innermost class span by byte) vs flipimpact innermostAtLine (by line, other table); impactViaColumn vs lintrules dependencyCapableMask share a bitmask idiom; the JS fixture encode|stringify is a deliberate twin (test/receiverevidencefix: same-named near misses); pargates.py is unchanged since cd87e30e (a regrouped pre-existing pair). The one real clone, the enclosing-function walk, was merged into innermostEnclosingFn instead of acked ack duplication af2e342eda9648ed 50 wave merge 2026-08-20 (harvestexec): isTypeMentionNode, from lane/resolver-precision. Both duplication rows pair it with an EXISTING member of src/ingest.cpp's kind-table family (isBaseTypeNode, isJsonShapeModifier) — a static const char* const table with one commented row per language, scanned by strcmp. What the clone detector sees is that shared idiom, and it is right that it is shared: it is the file's house pattern for a node-kind predicate, and every future language row lands as one commented line rather than an edit to a condition. Neither collapse is available. Merging into isBaseTypeNode would be a CORRECTNESS change, not a cleanup: base-type admits eight kinds (qualified_identifier, generic_type, user_type...) and a type MENTION must admit only type_identifier — that narrowness is precisely the round-1 ACCEPT result, and test/typerefcheck.sh fails if it widens. Collapsing today's single-row table to a bare strcmp would remove the per-language comment slot the siblings use and would have to be undone by the first non-C++ grammar added. Acked as a deliberate instance of an established shape, not as a shortcut. ack duplication b16454c12b64a72e 52 now=52 was=0 prov=recon cachefix fixture functions deliberately mirror common loop shapes; token-matches to unrelated src helpers are the fixture doing its job @@ -797,11 +804,14 @@ ack duplication cc31469cb4338f36 59 now=59 was=0 prov=recon Integration train 1b ack duplication ccc257e5193cb8bf 80 now=80 was=0 p=src/graph.h:15069 truth-fixes review round 1: the nine duplication rows pair this lane's small helpers with unrelated idioms of the same shape, and merging any pair would name neither. rustUseHead (strip self::, cut at the first of ':{, ') matches helpBareName, scopeTail and RustPaths::crateRootDir only as a strip-then-cut string_view return; importTierRollupDir keeps the importer's directory when it is shallower than the depth, where TestRunnerIndex::leadingComponents returns the whole path; importTierRollupAttrXml/importTierRollupJson share only the present-only empty-or-attribute return with forLensNotesStanza and mcpEnvelopeNoteField; impactImportTier is now the collect-sort-unique of the seeds' files in front of impactImportTierOfFiles (IMPACT-PATH), the same idiom as callersUnionSize and mergeBuiltinsWithConfig. Complexity, verbosity and params rows are minor or new-symbol and do not gate. ack duplication ccc462865f2f2b59 40 now=40 was=0 prov=recon wave-3 close: re-grouping artifact — hasAnyExt/isValidSeverity/isMcpProtocolVersionSupported/isDecisionShaped/hasNode did not change; their clone group lost the isShellBuiltinName member and the remaining pre-existing pairs re-emerge as new pairs vs HEAD ack duplication ccdc625bb518d417 161 now=161 was=0 prov=recon the merge-bomb threshold became the named constant kChurnMergeBombMaxFiles at all four call sites, as the review asked: a literal 100 sat beside a comment claiming parity with it. That one token is what pairs these two multi-root walks at 161 tokens - flipping it back clears the row, which is how this was verified. The bodies are not the same work: one accumulates a uint32 commit-frequency table from file SETS, the other sums a per-root double weight vector, so merging them would mean templating the ranking core on its accumulator to delete a similarity the constant created. +ack duplication cde1ea97fbc8f6f0 31 now=31 was=0 facet=one-statement p=src/externalnames.h:432 QD-VA-FORMS (E0): shstatus hasName binary-searches a runtime std::vector with svLess; externalnames' inSortedTable takes a span of constexpr string_view tables, so the one-statement idiom cannot share a signature ack duplication ce3ae91a3d24ac8c 64 now=64 was=0 prov=recon timsort vendoring: every row is the vendored src/infra/timsort.hpp (upstream v3.0.1 + the recorded workspace patch) plus the facade forwarder it needs. The complexity/verbosity/params/duplication rows are UPSTREAM's shape — mergeLo/mergeHi, gallopLeft/gallopRight and the timsort/timmerge overload pairs are twins in the release itself — and restructuring them would destroy the property that makes the file auditable: that it can be re-derived byte-for-byte from a public tag plus one described patch. The one preexisting-worse row, infra::sort::stable vs infra::sort::unstable at 22 tokens, is what a facade IS: each entry is a one-line forward to a DIFFERENT algorithm, and collapsing them into one algorithm-parameterised template would hide the explicit named choice the layer exists to make (G5). Nothing is routed to timsort; test/timsortcheck.sh is what keeps the file honest. ack duplication cf6c83caaec68565 19 now=19 was=0 prov=recon facet=one-statement taskroute v1 landing: (1) the five clone/new-clone rows are taskroute.h re-implementing word-boundary find / comma join / enum-name helpers that exist only as OTHER modules private-namespace statics (darkflags/docdrift/mcprefusal/accessshape) — importing them would cross-couple unrelated modules; consolidation home is the REGISTERED infra refactor round (PLAN board, ranked second) which owns the infra:: helper extraction; (2) kTotalFlagArms churn=self fires on every flag addition by construction (one-shared-bump discipline) — the field-report churn-advisory-unless-combined backlog item is the real fix; (3) complexity/verbosity on main is the new verb dispatch arm growing main.cpp main by the minimum a flag costs, MISATTRIBUTED by path to bench/agentloop/analyze.py:280 by the known cross-file churn-keying bug (fix exists unpushed at d593de3); analyze.py is untouched in this diff ack duplication d00e8847a6532b4d 18 now=18 was=0 p=test/receiverevidencefix/superroot/cs/App/Panel.cs:13 lane call-result-typing (train 29) arm (L) fixtures: tiny call-then-member-call fixture functions (18-23 tokens) that share a shape with older receiver-evidence fixtures by design — each pairs a local with a same-named method on two classes; no shared logic to extract (test fixtures are never built) ack duplication d02609215b4dde37 338 P3.2 plan-lint mechanical footprint: printUsage grows with the new help block; glyphName clones accessshape::shapeName (an enum-to-string switch idiom, the exact false-positive class P2.1's clone-idiom demotion targets, not yet landed); gitBlameLineSha clones quality.h::gitBlameRangeHasWindowCommit's blame-porcelain invocation shape — a shared-invocation extraction was tried and reverted as net-worse (it only moved the cost onto that untouched function's own churn), see planlint.h's own comment on the decision ack duplication d02fc7c439904e54 43 now=43 was=0 p=src/lsp.h:147 pre-existing pair (#279-era cap notice vs C2-era multi-def notice), surfaced by re-basing the range to main, not introduced by D: both are one-line window/logMessage assemblers sharing the frame+jsonEscape idiom at 43 tokens; extracting a common builder for two differently-worded sentences would add indirection without dedup value — D4 only added the suffix parameter to the cap one | prior: task C disclosure builders: the two notice senders share the concat-to-frame shape by design; unifying their sentence assembly would couple disclosures that must evolve and carry independent byte pins (arms 17/19) +ack duplication d14ad8328fdf7043 57 now=57 was=0 p=src/layout.h:3238 QD-VA-FORMS (E0): shstatus unq drops every quote character; layout's squeeze drops whitespace: the same copy-filter loop over a different class +ack duplication d154f94bfec9d28b 26 now=26 was=0 p=src/docdrift.h:339 QD-VA-FORMS (E0): shstatus isTrivialOr (trimmed text is true or :) matches docdrift's isMarkdownPath in shape only: two literal compares after one call ack duplication d1754de2cfeae4a5 27 now=27 was=0 prov=recon facet=threshold-ladder lane fix/cpp-macro-member-reparse-2026-09-11: test/extentfix/leak.cpp and test/extentfix/control/leak.cpp are the extent detector's designed fixture PAIR (the control is the leak with semicolons added), so their free functions are byte-identical by construction; the pair only re-keyed because the leak's macro moved to lowercase (the member-macro re-parse repairs the ALL-CAPS spelling, so the detector needs a shape that still derails) and the leak copies are filed under IndiaError:: ack duplication d2187166e5746ef0 23 now=23 was=0 p=test/kotlinfix/JavaBridge.java:13 lane call-result-typing (train 29) arm (L) fixtures: tiny call-then-member-call fixture functions (18-23 tokens) that share a shape with older receiver-evidence fixtures by design — each pairs a local with a same-named method on two classes; no shared logic to extract (test fixtures are never built) ack duplication d343b392d3ab9ecb 114 now=114 was=0 prov=recon timsort vendoring: every row is the vendored src/infra/timsort.hpp (upstream v3.0.1 + the recorded workspace patch) plus the facade forwarder it needs. The complexity/verbosity/params/duplication rows are UPSTREAM's shape — mergeLo/mergeHi, gallopLeft/gallopRight and the timsort/timmerge overload pairs are twins in the release itself — and restructuring them would destroy the property that makes the file auditable: that it can be re-derived byte-for-byte from a public tag plus one described patch. The one preexisting-worse row, infra::sort::stable vs infra::sort::unstable at 22 tokens, is what a facade IS: each entry is a one-line forward to a DIFFERENT algorithm, and collapsing them into one algorithm-parameterised template would hide the explicit named choice the layer exists to make (G5). Nothing is routed to timsort; test/timsortcheck.sh is what keeps the file honest. @@ -823,6 +833,7 @@ ack duplication dec50094e5aef506 74 now=74 was=0 prov=recon OPTREMARKS F3 (docs/ ack duplication ded26f9f9c045bfc 74 now=74 was=0 p=src/receiverevidence.h:50 lane FE-B (receiver evidence): lexical clone pairs, not shared logic — the per-language predicates (implicitReceiverLang, classNameReceiverLang, memberNeverReachesFreeFunction, isReceiverEvidenceKind, callableKind, classLike, isThisRoot) are one-line OR-lists over different enum sets that share only the shape with quality.h/model.h/slice.h predicates asking other questions; keyOf/typeKey build different keys into a reused buffer; classAt (innermost class span by byte) vs flipimpact innermostAtLine (by line, other table); impactViaColumn vs lintrules dependencyCapableMask share a bitmask idiom; the JS fixture encode|stringify is a deliberate twin (test/receiverevidencefix: same-named near misses); pargates.py is unchanged since cd87e30e (a regrouped pre-existing pair). The one real clone, the enclosing-function walk, was merged into innermostEnclosingFn instead of acked ack duplication df5a70dc16c85001 33 now=33 was=0 prov=recon timsort vendoring: every row is the vendored src/infra/timsort.hpp (upstream v3.0.1 + the recorded workspace patch) plus the facade forwarder it needs. The complexity/verbosity/params/duplication rows are UPSTREAM's shape — mergeLo/mergeHi, gallopLeft/gallopRight and the timsort/timmerge overload pairs are twins in the release itself — and restructuring them would destroy the property that makes the file auditable: that it can be re-derived byte-for-byte from a public tag plus one described patch. The one preexisting-worse row, infra::sort::stable vs infra::sort::unstable at 22 tokens, is what a facade IS: each entry is a one-line forward to a DIFFERENT algorithm, and collapsing them into one algorithm-parameterised template would hide the explicit named choice the layer exists to make (G5). Nothing is routed to timsort; test/timsortcheck.sh is what keeps the file honest. ack duplication e0406bb747448d85 154 now=154 was=0 prov=recon ingest() decomposition: emitBindingAliases/emitRouteDefs are the FFI-alias and route-def sort ladders moved verbatim out of ingest()'s body into named phase helpers (ingest_model.h); as inline statements the clone scanner could not see them, as small functions their comparator shape token-matches sortLintRows - different element types and orderings, no shareable contract, zero behavior change (argvdiff byte-identical) +ack duplication e2a2414e29124aae 84 now=84 was=0 p=src/defectshape.h:1902 QD-VA-FORMS (E0): Prov::emptyUnder (every failure-set leaf is in the set) shares only the nonempty && all_of(find) idiom with defslookup's picksAlone, which resolves a spelling first; different element types, no common step to extract ack duplication e2d22ac45d11d555 19 now=19 was=0 prov=recon facet=one-statement review of #219: the run= relativity claim is CONDITIONAL, so the predicate has to reach every site that states it — prLegendText and writeFlipHeader take rootRelativeRuns (and its root= attribute) because the legend sentence and the command spelling must be decided by ONE fact, testmap.h runsAreRootRelative; a legend that claims a relativity the spelling does not have is the defect this round fixes. The duplication row pairs that 19-token predicate with mcp.h mcpOmitsGitVerbs, which asks a different question about a different field and shares only the shape of a two-term boolean return — merging them would name neither. ack duplication e3410f4eae133942 35 wave-3 close (--quality-delta=ec5e3c3..HEAD convergence): isShellBuiltinName takes externalnames.h's own house shape — a static_assert-sorted table read by binary_search/svLess, the one-liner its siblings isPythonBuiltin/isCFamilyStdName already are; the KindCounts::total match is token-shape only (accumulate over begin/end vs binary_search). The hand loop L7's P4 landed with cloned five unrelated predicates; this shape clones its two siblings, deliberately ack duplication e3b20760731b4121 50 the three sidecar read seams keep one O_NOFOLLOW shape by design, each with its own once-per-site DISCLOSE (pathguard.h round 3) @@ -841,6 +852,7 @@ ack duplication e94fce0d5caa811d 66 now=66 was=0 prov=recon timsort vendoring: e ack duplication ea4ae03ca699bce4 35 now=35 was=0 prov=recon facet=one-statement lane C plain-text prose tier (test/textdocscheck.sh): .rst/.adoc/.org/.mdx join kLangTable on Lang::Markdown so --recall can answer from an ADR that is not written in markdown. All five gating rows are this lane's own footprint. TWO short-horizon-churn churn=self rows: kLangTable is the language table this change exists to extend, and kParserVer is the cache key an extraction change is REQUIRED to move (ingest_cache.h's own note says so) — both are structural for any lane of this kind, not thrash. THREE clone rows on isMarkdownGrammarExtension, all 35-token idiom collisions on a one-line membership predicate: it now spells the sorted-table + std::binary_search + is_sorted static_assert shape that externalnames.h::isShellBuiltinName/isPythonBuiltin/isCFamilyStdName already carry (their own note at externalnames.h:98 records this exact collision and settles on this shape), and the KindCounts::total pair is a std::accumulate over std::begin/std::end normalizing to the same token stream. Two cheaper spellings were tried and REJECTED by measurement first: a hand-rolled scan loop is the five-instance clone shape ingest.h::isNonTextExtension's note already names, and a std::find one-liner cloned KindCounts::total alone. What was FIXED rather than acked in this pass: six duplication rows (the loop -> the house binary_search shape) and kLangTable's verbosity row 96->120 (the tiling essay moved out of the table body onto the seam above it). ack duplication eb2e912436eacba2 49 by=test/macroreparsefix now=49 was=0 prov=recon lane fix/cpp-macro-member-reparse-2026-09-11, member-macro re-parse fixtures (test/macroreparsefix): sumDraft (leak_plain.cpp) and tallyCargo (leak_anon.cpp, control/semi.cpp) are deliberately ordinary C loops around the member macros, and test/macroreparsecheck.sh pins them BY NAME as the functions a derailed parse loses, so their bytes are the measured input. Their token streams meet unrelated plain loops (abicheck KindCounts::sumWhere, vendored dynamic_map.hpp node_rank::lt/le, bench geometry perimeter, the cloneidiomfix and sliceflowsensfix fixtures) with no shared identifier or contract; rewording a fixture to dodge a token match would game the number. ack duplication ec3f7b5523723637 110 now=110 was=0 prov=recon C1 F-06/F-07/F-10 (the listing-paging round): three listing verbs learn to disclose and page their row listings, and every gating row is that one change. api-surface 14 = ONE trailing DEFAULTED parameter each (an int pageOffset, an McpPageArgs window, a SituPageArgs, or the next= invocation a header now carries) on the emitters that must be TOLD their window — writeFlags/writeGate, writeCappedRows/writeCappedList/writeFlip/writeFlipHeader/writeFlipLights, computeFlip, nearestGateNames (which gains its cap and its TOTAL, the disclosure itself), situShowingNote/writeSituation, and the three MCP twins flagsText/flipText/situationDiffJson; additive by construction, every pre-existing call site compiles unchanged, and the alternative — a second capped emitter per verb — is the drift this repo removes rather than adds, because two emitters that disagree about a window can drop the row that IS the answer. verbosity 3 = kDocDriftLegend +20 lines and writeDocDriftPage +10 are the in-band vocabulary a reader needs to read shown_failed=/failed_capped=/failed_total= where they meet it (the rationale and the next= scan were already hoisted OUT of the body into their own function and comment, which took the complexity row to zero and the LOC row from +48 to +10); dispatchMcpLine +12 is two pagedResult wrappers on a pre-existing 1376-line dispatcher this lane adds to rather than creates. complexity 1 = the same dispatcher, +9 on a base of 518. duplication 1 = flagsText | flipText at 110 tokens, down from 131 after the shared mcpRowCap fold; the residual is getIndex + compute + captureXml, the shape EVERY index-backed MCP twin in this file has, and merging two verbs that return different results behind one entry point would be worse code than the clone. short-horizon-churn 19 = this lane's own footprint across cli.h/docdrift.h/darkflags.h/flipimpact.h/situ.h/mcp*, plus cli.h symbols three other lanes touched the same day; none foreign, none thrash. +ack duplication ee2558b64b93a15e 30 now=30 was=0 facet=one-statement p=src/forunused.h:690 QD-VA-FORMS (E0): shstatus isWordChar is Python's \w (namesplit::isIdentChar or a non-ASCII byte); forunused's isIdent also takes '$': a different class, both already built on namesplit::isIdentChar ack duplication ee2dfd7190839cca 44 now=44 was=0 prov=recon DISCLOSE sinks: a reason-to-field switch is the shape every multi-reason sink shares; -Wswitch exhaustiveness over DisclosureWhy is the point (Diagnostics.h 4b) ack duplication ef24ca16fd475a4c 40 now=40 was=0 prov=recon DISCLOSE sinks: a reason-to-field switch is the shape every multi-reason sink shares; -Wswitch exhaustiveness over DisclosureWhy is the point (Diagnostics.h 4b) ack duplication ef3d5272b705b505 107 now=107 was=0 prov=recon ingest.cpp split 2026-08-29: pre-split clone pairs (buildNewlineOffsets vs the bench_newline_ab arms, acked lane-B3 at keys 98099b517e9d2fbb/a6f7de52f80c9f48) whose clone-group keys changed because buildNewlineOffsets moved VERBATIM into ingest_astquery.h — the disclosed clone-ack rename floor, same artifact as the main.cpp split's moved-clone row; argvdiffcheck vs c267a4b proves no body changed @@ -858,7 +870,7 @@ ack duplication fb9ac4034d49c58e 50 by=src/* now=50 was=0 prov=recon facet=one-s ack duplication fcb35112f353f497 43 now=43 was=0 p=src/graph.h:15506 truth-fixes review round 1: the nine duplication rows pair this lane's small helpers with unrelated idioms of the same shape, and merging any pair would name neither. rustUseHead (strip self::, cut at the first of ':{, ') matches helpBareName, scopeTail and RustPaths::crateRootDir only as a strip-then-cut string_view return; importTierRollupDir keeps the importer's directory when it is shallower than the depth, where TestRunnerIndex::leadingComponents returns the whole path; importTierRollupAttrXml/importTierRollupJson share only the present-only empty-or-attribute return with forLensNotesStanza and mcpEnvelopeNoteField; impactImportTier is now the collect-sort-unique of the seeds' files in front of impactImportTierOfFiles (IMPACT-PATH), the same idiom as callersUnionSize and mergeBuiltinsWithConfig. Complexity, verbosity and params rows are minor or new-symbol and do not gate. ack duplication fe3f7f2f02e95c3a 153 now=153 was=0 prov=recon the slice arming hook is pagerank's RIPWIRE_TEST_PR_MAXITERS rule byte-for-byte, kept inline so pagerank.cpp's include set stays minimal ack duplication fe6b0a82e5418e62 130 now=130 was=0 prov=recon facet=switch-name-table a distinct display vocabulary over the same enum: #279's LSP hover words (function/variable/interface), not the terse XML tag table symTag -ack duplication feeb66f991bcb281 20 the three sidecar read seams keep one O_NOFOLLOW shape by design, each with its own once-per-site DISCLOSE (pathguard.h round 3) +ack duplication feeb66f991bcb281 20 now=20 was=0 prov=recon the three sidecar read seams keep one O_NOFOLLOW shape by design, each with its own once-per-site DISCLOSE (pathguard.h round 3) ack duplication ff14ff2b821304c8 24 by=src/* slice honesty round (lane H): token-shape clones between one-line predicate/name-table helpers in slice.h and unrelated domains (naminglens predicatePrefixed, pattern servedNames/resolvedNames, quality headSnapExclHex, model localsCountedLang) — no shared identifiers, different scopes; reviewed by the lane and the orchestrator and declined to merge across domains (the clone-idiom class) ack duplication ff72a44609fec15b 127 OPTREMARKS F3 (docs/OPTREMARKS.md §8b): the ~430 per-AST-node std::strcmp( t, "literal" ) sites in the five ingest walk sections become rw::kindIs (src/infra/nodekind.h) — an inline compare, because strcmp is an external symbol LTO cannot inline and on macOS costs two dyld stub hops before it starts. Measured: 10.6% of busy CPU in strcmp leaves on a cold llvm run, 6-12% on four other corpora; 0.23% after. Output byte-identical across 7 corpora x 5 verbs, argvdiffcheck 640/642 vectors identical (the 2 that differ are the +dirty build stamp in --version). WHAT THESE ROWS ARE. (a) 95 short-horizon-churn rows, churn=self: the mechanical rewrite touches essentially every function in ingest_{metrics,binds,sidecap,relations,names}.h, so every one of them shows this lane's own single edit. Not thrash — one commit. (b) 7 duplication rows and 1 new-clone-of-reused-helper. These are REAL new clone groups (--clones, uncapped: 407 groups before, 409 after; the rewrite adds 7 and removes 5) and they are IDIOM COLLISIONS, not copies. kindIs( t, "x" ) is shorter than std::strcmp( t, "x" ) == 0, so short predicate bodies that were previously above the clone threshold now match each other's normalized token stream. Six of the seven pair a node-kind || -chain with an unrelated || -chain over a DISJOINT literal set in a different subsystem — cc_isParamList (tree-sitter parameter-list kinds) against predicatePrefixed (English name prefixes is/has/can), against sliceIsJsPatternKind (JS destructuring kinds), rubyCallIsAssignmentTarget against slice.h's JS binding probes. The tool's own rule is that two ladders over the SAME enum are a copy; these share no non-keyword identifier and no domain, and merging any pair would need a helper parameterised on an unrelated literal table — a wrong abstraction to satisfy a lint. The seventh, kindIs | lexTokenEqualsLowered, is the same shape at 56 tokens with materially different contracts: lexTokenEqualsLowered takes an explicit length and case-folds one side, kindIs takes its length from the literal's type and compares the terminating NUL as an ordinary byte — and that NUL comparison is precisely the safety property kindIs depends on (test/nodekindcheck.sh arm B proves the absence of a read past it with an mprotect(PROT_NONE) guard page). Folding them together would erase the one property being gated. Gate: test/nodekindcheck.sh, 4 arms, 1,348,096 enumerated (candidate, literal) pairs against std::strcmp plus two mutation controls that each turn an arm red. ack duplication ffbb89e07f18c870 113 now=113 was=0 prov=recon per-enumerator switches name every enumerator and carry no default: on purpose — that is what makes -Werror=switch a compile error at each one when an enumerator is appended; two such switches over one enum share the enumerator spelling by construction @@ -899,16 +911,16 @@ ack new-clone-of-reused-helper 5feb1db1a255a3da 4 now=4 was=0 p=src/graph.h:4367 ack new-clone-of-reused-helper 6128f33640dfab87 5 now=5 was=0 prov=recon Integration train 2b: the gate-local one-line helpers run(){ perl -e 'alarm 30; exec @ARGV' "$BIN" "$@" 2>/dev/null; }, cnt() and defs() in test/cpptmplscopecheck.sh (#256) beside test/cppqualcheck.sh and test/callformcheck.sh (#243) are the self-contained-gate idiom this repo spells inline in each gate; test/lib has no shared runner or attribute reader to source, and a gate is meant to read and run on its own. The clone count moved from 3 to 5 only because both lanes' gates now share one tree; #256 acked the same idiom at 3. | prior: C++ template scopes: test/cpptmplscopecheck.sh defines the gate-local one-line wrapper run(){ perl -e 'alarm 30; exec @ARGV' "$BIN" "$@" 2>/dev/null; }, the same self-contained idiom 11 gates under test/ already spell inline (cppqualcheck, stdqualcheck, callformcheck's cxrun among them). test/lib/ has no shared runner to source, and a gate here is meant to read and run on its own. Factoring the idiom into test/lib would touch eleven unrelated gates, which does not belong in this lane. ack new-clone-of-reused-helper 6464ab2300b93b7a 3 now=3 was=0 prov=recon facet=one-statement scopeless-fold lane: the five gating rows are the new mechanism itself, read one by one. (1) remapAckIdentity complexity 26->29: it resolves THREE rescue routes now (rename, content, and the 2026-08-25 key-scheme replay) where it resolved two; the growth is one route-selection ternary plus a third switch arm, and collapsing them would hide WHICH mechanism moved an ack, which is the disclosure this round exists to provide. A branchless array tally was tried and measured identical, so it bought nothing. (2)+(4) qualityKey pairs with resolve.h::canonicalIdRelTo: the similarity is deliberate and load-bearing. They take the same (ing, symbol, root) and differ ONLY in which identity question they answer - canonicalIdRelTo builds the ENTITY id (path::scope::name, which must keep folding the 21 extern-C tree_sitter_X declarations into the one C function they actually are), qualityKey builds the SOURCE key (pathQualifiedKey, which must not fold anything). Merging them would re-create the exact bug this lane fixed. (3)+(5) baselineHeaderIsForeign pairs with crossref::isNullSha at 32 tokens: a shape match between two unrelated three-line string predicates, not shared behaviour. It was extracted precisely BECAUSE the tool objected to the same logic inline in readBaseline; there is no third spelling that satisfies both. ack new-clone-of-reused-helper 64c50349786b7508 3 now=3 was=0 prov=recon facet=one-statement nested-closure span-attribution fix (jsnestedcheck): spanContains is sameSpan's sibling predicate (containment vs identity — 26 shared tokens are the four ts_node_*_byte reads, nothing mergeable); captureTagsFacts verbosity is the constraint comment on the containment stop + churn=self is this fix editing the tags pass; webpack nest>=4 individually-scoped rows 18%->98%, gate jsnestedcheck green -ack new-clone-of-reused-helper 675204169bc3d5d2 4 now=4 was=0 prov=recon wave-3 close, H7 hosts (substrfiltercheck --plan/--abi arms): printStrayFilterNoMatch is the ONE sentence for a --stray-content filter that selects no ref, spoken by the bare verb and its two hosts; it shares refuseFlagValue's fprintf shape (33 tokens) but not its contract — arm C pins the 'not a measurement' clause the value-domain sentence lacks +ack new-clone-of-reused-helper 675204169bc3d5d2 4 now=4 was=0 prov=recon facet=call-sequence wave-3 close, H7 hosts (substrfiltercheck --plan/--abi arms): printStrayFilterNoMatch is the ONE sentence for a --stray-content filter that selects no ref, spoken by the bare verb and its two hosts; it shares refuseFlagValue's fprintf shape (33 tokens) but not its contract — arm C pins the 'not a measurement' clause the value-domain sentence lacks ack new-clone-of-reused-helper 689ab18d529fb67c 4 now=4 was=0 prov=recon P3.2 plan-lint model correction (validated against the field-evidence source repo's own flagship plan): computePlanLint/writePlanLint grow in complexity/verbosity because status now resolves from the §Status ledger as well as the card body (the real house dialect), extracted into resolveLedgerStatus to keep the growth to the genuinely new logic; missingWhy clones gitmine::coPairAttr and testmap::affectedSeededBy — the same trivial-classifier-idiom false positive already acked for glyphName/shapeName (a 3-branch string-constant selector has almost no room to look structurally unlike another one) -ack new-clone-of-reused-helper 69bea33de722cde5 4 now=4 was=0 prov=recon Integration train 1b (lane/reader-fuzzers @ 8f6f86f5): the fuzz harness appendPod deliberately re-implements the on-disk writers (qsnapPut's byte append) so the harness shares no code with the reader it attacks +ack new-clone-of-reused-helper 69bea33de722cde5 4 now=4 was=0 prov=recon facet=call-sequence Integration train 1b (lane/reader-fuzzers @ 8f6f86f5): the fuzz harness appendPod deliberately re-implements the on-disk writers (qsnapPut's byte append) so the harness shares no code with the reader it attacks ack new-clone-of-reused-helper 6a595c85c47abd60 5 now=5 was=0 prov=recon facet=switch-name-table per-enumerator switches name every enumerator and carry no default: on purpose — that is what makes -Werror=switch a compile error at each one when an enumerator is appended; two such switches over one enum share the enumerator spelling by construction ack new-clone-of-reused-helper 6a7680fbd8a5083d 4 by=src/* now=4 was=0 prov=recon slice honesty round (lane H): token-shape clones between one-line predicate/name-table helpers in slice.h and unrelated domains (naminglens predicatePrefixed, pattern servedNames/resolvedNames, quality headSnapExclHex, model localsCountedLang) — no shared identifiers, different scopes; reviewed by the lane and the orchestrator and declined to merge across domains (the clone-idiom class) ack new-clone-of-reused-helper 6df9a7992177fa30 4 by=src/extentsuspect.h now=4 was=0 prov=recon lane fix/cpp-macro-member-reparse-2026-09-11, extent detector (src/extentsuspect.h): extent::inSet is the std::find( begin, end, v ) != end membership test over a constexpr std::array of enums (the SymKind and Lang rule tables, 9 call sites). Its partners spell the same one-liner over a span of string_view (ingest_relations.h namesNode), an initializer_list of string_view (naminglens::ncAnyOf) and a Scope pattern vector (quality::scopeUsesDiffToken), and notes::sortNotes is a bare std::stable_sort. An idiom collision at 30-36 tokens across four subsystems: no member can take another member argument type, and the comment on namesNode records this spelling as the house one. ack new-clone-of-reused-helper 73b08512b41c61f2 4 E1 follow-up (CodeRabbit on #214, threads 1-3): the pr-context legend must follow the RENDERED rows, so the chosen body is now rendered before the head is written. prRenderLevel NAMES the memstream dance pickPrTrimLevel already ran inline and the unbudgeted root now needs as well - two call sites, one copy - and the clone it matches is packtask.h's packTaskRenderToString, the same seven-line idiom this tree already spells nine more times in mcpverbs.h; hoisting one shared helper into serialize.h would collapse three DEGRADED_PATH_ALERT messages that deliberately say WHICH buffer failed, so the duplication is the cheaper honesty and is recorded here rather than papered over. prBodyHasTestRow is a two-find predicate (a test row opener or a group row opener); its 36-token match against accessshape::chaseTypeCanPoint is the shape find(x)!=npos || find(y)!=npos, not shared logic. writePrContext's churn=self is this lane's own third edit to that one function inside the window - the E1 landing, the CI budget fix, and this rows-gated legend - one change seen three times, none foreign. ack new-clone-of-reused-helper 73e06cf71f4ea8bc 5 now=5 was=0 p=src/ingest_binds.h:1263 lane FE-B (receiver evidence): lexical clone pairs, not shared logic — the per-language predicates (implicitReceiverLang, classNameReceiverLang, memberNeverReachesFreeFunction, isReceiverEvidenceKind, callableKind, classLike, isThisRoot) are one-line OR-lists over different enum sets that share only the shape with quality.h/model.h/slice.h predicates asking other questions; keyOf/typeKey build different keys into a reused buffer; classAt (innermost class span by byte) vs flipimpact innermostAtLine (by line, other table); impactViaColumn vs lintrules dependencyCapableMask share a bitmask idiom; the JS fixture encode|stringify is a deliberate twin (test/receiverevidencefix: same-named near misses); pargates.py is unchanged since cd87e30e (a regrouped pre-existing pair). The one real clone, the enclosing-function walk, was merged into innermostEnclosingFn instead of acked ack new-clone-of-reused-helper 7981b72e3b2a8a8b 3 now=3 was=0 prov=recon mcpIsGitOnlyVerb (finding #8, 2026-08-15 harvest) is a 6-line linear-scan-and-compare over the SAME small kMcpGitOnlyVerbs table mcpGitOnlyNotBatchServed already loops beside it (mcp.h:127-144); query.h::isKnownLayerWord is the same trivial 'is w one of these known short strings' idiom over an UNRELATED domain (the graph-query layer vocabulary). Per this repo's own precedent (V6/isKnownVerb, ROUTING_LEDGER.md's V6 lane), forcing a shared cross-file generic membership helper across two unrelated small closed vocabularies is the wrong abstraction for a token-shape match, not a real duplication to collapse -ack new-clone-of-reused-helper 7ad7c707204ff7b3 14 now=14 was=0 prov=recon qsnapPut is constrained to types with unique object representations instead of asserting trivially-copyable, which leaves its body the same one-line byte append ByteW::u32 is; the two live in different translation units on purpose (quality.h cannot include the ingest cache) +ack new-clone-of-reused-helper 7ad7c707204ff7b3 14 now=14 was=0 prov=recon facet=call-sequence qsnapPut is constrained to types with unique object representations instead of asserting trivially-copyable, which leaves its body the same one-line byte append ByteW::u32 is; the two live in different translation units on purpose (quality.h cannot include the ingest cache) ack new-clone-of-reused-helper 845088dc7642af45 4 now=4 was=0 prov=recon V3 harvest 2026-08-15: two MCP gate harnesses. Every MCP gate in this suite is deliberately STANDALONE — the house rule in their own headers is 'does NOT edit regression.sh or any other existing test file', so a gate carries its own 3-4 line JSON-RPC transport wrapper (mcp_call in mcphandlecheck, mcpCall in mcpeditpresencecheck, the curl wrapper in mcpremotecheck). test/mcptoolprunecheck.sh needs BOTH transports (HTTP for the pinned-root arms A-E/G, stdio for arm F, and the pair is the point: pinning is exactly what makes the omission provable), so its http_call and stdio_call land as the 9th and 10th members of two families that already exist. Extracting a shared test/lib harness would couple every MCP gate to one file and is a suite-wide refactor, not this lane's; sharing one of the two existing spellings instead would make this gate fail whenever an unrelated gate edits its own helper. No production code involved ack new-clone-of-reused-helper 894d5d3469e376e9 3 M1: four MCP gates now share a call() helper that injects legend:"full" for the seventeen declaring verbs. The clone is DELIBERATE and this repo's gates say why in their own comments: two gates deriving the same fact through one shared helper fail together on a shared mistake, so gate helpers are copied, not factored. Each copy carries its own re-pin note explaining the posture that gate needs. ack new-clone-of-reused-helper 8fe2382a32e0fb9f 5 now=5 was=0 p=src/graph.h:13866 resolveFocus is the two-line projection wrapper the tower split (their focusOfOrderedMatches) makes inevitable: its 21-token overlap with atomsOfConfusion and testRowsJoined is the house forwarding idiom itself (return g(ing, args...) ) — three unrelated lanes that each delegate once to a named callee. Removing the wrapper would re-open the composition at every single-pick call site, which is MORE duplication, not less; collapsing the helpers would weld the atoms, test-rows and name-resolution lanes into one shared body that has no common contract. Reviewed shape, acked as idiom. @@ -917,6 +929,8 @@ ack new-clone-of-reused-helper 9a4535db03a4028c 11 now=11 was=0 prov=recon ruby- ack new-clone-of-reused-helper 9b15c6e24f597b61 4 now=4 was=0 prov=recon taskroute v1 landing: (1) the five clone/new-clone rows are taskroute.h re-implementing word-boundary find / comma join / enum-name helpers that exist only as OTHER modules private-namespace statics (darkflags/docdrift/mcprefusal/accessshape) — importing them would cross-couple unrelated modules; consolidation home is the REGISTERED infra refactor round (PLAN board, ranked second) which owns the infra:: helper extraction; (2) kTotalFlagArms churn=self fires on every flag addition by construction (one-shared-bump discipline) — the field-report churn-advisory-unless-combined backlog item is the real fix; (3) complexity/verbosity on main is the new verb dispatch arm growing main.cpp main by the minimum a flag costs, MISATTRIBUTED by path to bench/agentloop/analyze.py:280 by the known cross-file churn-keying bug (fix exists unpushed at d593de3); analyze.py is untouched in this diff ack new-clone-of-reused-helper a42cd763fdab0077 42 a probe TU deliberately mirrors layout declarations (#224 structlayout_probe.cpp) ack new-clone-of-reused-helper a5943aaae0184b8f 4 readability-wave1 (naming lens): ncAnyOf is a one-expression std::find wrapper, sortNotes a one-expression std::stable_sort wrapper — 30 normalized tokens of the SAME STL-adapter idiom over unrelated types (a char-class set test vs a note sort). There is no call ncAnyOf could make to sortNotes, and rewriting the std::find as a hand loop would only hide the detector. Kept as written. +ack new-clone-of-reused-helper a706372cca78119c 6 now=6 was=0 p=src/mcprefusal.h:151 QD-VA-FORMS (E0): shstatus listTextOf joins the and-or texts it computes per element (itemsText) with ' ; '; joinClauses / commaSymbols join precomputed views, so reuse would build a temporary vector of strings to join +ack new-clone-of-reused-helper a7385e5c77e06492 9 now=9 was=0 facet=one-statement p=src/quality.h:1164 qd-shrink-pair 2026-11-20: pathQualifiedKey(relPath, Symbol) now delegates its keying rule to definitionQualityKey (the one rule the history-blob readers share, langidentity predicates -1); the one-statement pair with symbolHasStaticLinkage (a linkage predicate) shares only the s.lang read, and no helper serves both ack new-clone-of-reused-helper aa09687719d00a40 4 now=4 was=0 p=src/atoms.h:562 the same two-line projection wrapper the previous ack named (runLsp/tagEq round): resolveFocus forwards to focusOfOrderedMatches over resolveAllByNameQualified; atomsOfConfusion is another one-line forwarder of the same shape. The clone is the delegation idiom, unifying them would couple unrelated lanes for one fewer line. | prior: resolveFocus is the two-line projection wrapper the tower split (their focusOfOrderedMatches) makes inevitable: its 21-token overlap with atomsOfConfusion and testRowsJoined is the house forwarding idiom itself (return g(ing, args...) ) — three unrelated lanes that each delegate once to a named callee. Removing the wrapper would re-open the composition at every single-pick call site, which is MORE duplication, not less; collapsing the helpers would weld the atoms, test-rows and name-resolution lanes into one shared body that has no common contract. Reviewed shape, acked as idiom. ack new-clone-of-reused-helper aada023eba533a38 4 now=4 was=0 prov=recon facet=one-statement lane C plain-text prose tier (test/textdocscheck.sh): .rst/.adoc/.org/.mdx join kLangTable on Lang::Markdown so --recall can answer from an ADR that is not written in markdown. All five gating rows are this lane's own footprint. TWO short-horizon-churn churn=self rows: kLangTable is the language table this change exists to extend, and kParserVer is the cache key an extraction change is REQUIRED to move (ingest_cache.h's own note says so) — both are structural for any lane of this kind, not thrash. THREE clone rows on isMarkdownGrammarExtension, all 35-token idiom collisions on a one-line membership predicate: it now spells the sorted-table + std::binary_search + is_sorted static_assert shape that externalnames.h::isShellBuiltinName/isPythonBuiltin/isCFamilyStdName already carry (their own note at externalnames.h:98 records this exact collision and settles on this shape), and the KindCounts::total pair is a std::accumulate over std::begin/std::end normalizing to the same token stream. Two cheaper spellings were tried and REJECTED by measurement first: a hand-rolled scan loop is the five-instance clone shape ingest.h::isNonTextExtension's note already names, and a std::find one-liner cloned KindCounts::total alone. What was FIXED rather than acked in this pass: six duplication rows (the loop -> the house binary_search shape) and kLangTable's verbosity row 96->120 (the tiling essay moved out of the table body onto the seam above it). ack new-clone-of-reused-helper b94f262fa5cff312 120 now=120 was=0 prov=recon test/verify_strkern.cpp keeps VERBATIM copies of escapeXml/appendCdataSafe/escapeInto (as *Ref, plus one deliberately mutated set) and a masksEqual predicate as the doctest ORACLES the kernels are proven against; a reference that shared the shipped code would move with it and prove nothing (the TU's header says so) @@ -928,6 +942,7 @@ ack new-clone-of-reused-helper c63561350b4b9a0a 3 now=3 was=0 p=test/receiverevi ack new-clone-of-reused-helper c7ac66bb47a14f56 3 now=3 was=0 prov=recon facet=switch-name-table per-enumerator switches name every enumerator and carry no default: on purpose — that is what makes -Werror=switch a compile error at each one when an enumerator is appended; two such switches over one enum share the enumerator spelling by construction ack new-clone-of-reused-helper c8b32435256b863e 4 by=src/* Phase 5 (docs/EVALS.md): the external-name veto (@external, externalnames.h tables, ExternalVeto predicate, import-name bindings at ingest) and the receiver MRO walk (rule1BaseWalk, SuperObj); every gating row is this one change — the four deliberate contract changes (serialize/serializeJson gain externalCalls, captureIncludes gains binds, methodOnTypeOrBases gains skipSelf/unionOnMulti), the ladder's two new steps in buildGraph, the census's tenth mechanism, kParserVer 77, and the two lexical clone false-positives (a one-line binary_search vs a counts total; a key-buffer probe vs a JSON string writer) ack new-clone-of-reused-helper ca79cc414dda8197 5 now=5 was=0 prov=recon Integration train 2b (PR #244, TS/JS literal receivers): isJsTsLitRecv (a five-case RecvKind membership test), jsLitCtorName (a five-case RecvKind -> constructor-name switch) and isJsTsBuiltinCtor (a five-string membership test) are each the smallest spelling of one fact about the Lit* enumerators appended in the same PR. Their token runs match refRoleTag, styleTag, votingStyle, langUsesHashComment, elixirTypedAttribute and a clone-idiom fixture by SHAPE (a short enum switch, an OR of equality tests), not by shared logic: no helper exists they could call, and folding unrelated enums into one table would couple them. Acked at the train that first measured them on the merged tree; the three stay adjacent in model.h beside the enum they describe. +ack new-clone-of-reused-helper cde1ea97fbc8f6f0 3 now=3 was=0 facet=one-statement p=src/externalnames.h:432 QD-VA-FORMS (E0): shstatus hasName binary-searches a runtime std::vector with svLess; externalnames' inSortedTable takes a span of constexpr string_view tables, so the one-statement idiom cannot share a signature ack new-clone-of-reused-helper cf6c83caaec68565 10 now=10 was=0 prov=recon facet=one-statement taskroute v1 landing: (1) the five clone/new-clone rows are taskroute.h re-implementing word-boundary find / comma join / enum-name helpers that exist only as OTHER modules private-namespace statics (darkflags/docdrift/mcprefusal/accessshape) — importing them would cross-couple unrelated modules; consolidation home is the REGISTERED infra refactor round (PLAN board, ranked second) which owns the infra:: helper extraction; (2) kTotalFlagArms churn=self fires on every flag addition by construction (one-shared-bump discipline) — the field-report churn-advisory-unless-combined backlog item is the real fix; (3) complexity/verbosity on main is the new verb dispatch arm growing main.cpp main by the minimum a flag costs, MISATTRIBUTED by path to bench/agentloop/analyze.py:280 by the known cross-file churn-keying bug (fix exists unpushed at d593de3); analyze.py is untouched in this diff ack new-clone-of-reused-helper d11c67611bc73d49 3 now=3 was=0 prov=recon mcpgrepdegradedcheck round (2026-08-30): the gate's mcp_text/batch_sub/call shell harness is the 7th deliberate copy of mcpclidiffcheck's — gate scripts are self-contained by design (each runs standalone under RIPWIRE_BIN with no shared lib to source), the same trade every earlier MCP gate made; a shared test/lib refactor is its own round, not this diff's ack new-clone-of-reused-helper da2b082324acc9b0 4 now=4 was=0 p=src/model.h:114 honesty-small-068: lexical clone false positives on one-line helpers. isStructOrNamedType (a two-term kind test) matched routematch::methodsCompatible and localsCountedLang, and lspKindWord (a table read behind its EXPECTS) matched ConfigScopes::scope: each shares only the shape of a one-line boolean or indexed return, asks a different question of a different type, and a merge would name neither. Earlier rounds of this lane FIXED the real findings instead: pathText complexity/verbosity (one shared pathUnreachedXml clause), lspKindWord's switch near-clone of langTag (now a table), three sum/any helpers (sums carried). @@ -940,6 +955,7 @@ ack new-clone-of-reused-helper e5435e09a9b2e2be 3 now=3 was=0 prov=recon the qua ack new-clone-of-reused-helper e6ae1365cb6c154a 3 V3 harvest 2026-08-15: two MCP gate harnesses. Every MCP gate in this suite is deliberately STANDALONE — the house rule in their own headers is 'does NOT edit regression.sh or any other existing test file', so a gate carries its own 3-4 line JSON-RPC transport wrapper (mcp_call in mcphandlecheck, mcpCall in mcpeditpresencecheck, the curl wrapper in mcpremotecheck). test/mcptoolprunecheck.sh needs BOTH transports (HTTP for the pinned-root arms A-E/G, stdio for arm F, and the pair is the point: pinning is exactly what makes the omission provable), so its http_call and stdio_call land as the 9th and 10th members of two families that already exist. Extracting a shared test/lib harness would couple every MCP gate to one file and is a suite-wide refactor, not this lane's; sharing one of the two existing spellings instead would make this gate fail whenever an unrelated gate edits its own helper. No production code involved ack new-clone-of-reused-helper e79604c61e955de9 42 now=42 was=0 prov=recon facet=switch-name-table a distinct display vocabulary over the same enum: #279's LSP hover words (function/variable/interface), not the terse XML tag table symTag ack new-clone-of-reused-helper e828c02eebfa38f2 4 now=4 was=0 p=src/model.h:663 lane FE-B (receiver evidence): lexical clone pairs, not shared logic — the per-language predicates (implicitReceiverLang, classNameReceiverLang, memberNeverReachesFreeFunction, isReceiverEvidenceKind, callableKind, classLike, isThisRoot) are one-line OR-lists over different enum sets that share only the shape with quality.h/model.h/slice.h predicates asking other questions; keyOf/typeKey build different keys into a reused buffer; classAt (innermost class span by byte) vs flipimpact innermostAtLine (by line, other table); impactViaColumn vs lintrules dependencyCapableMask share a bitmask idiom; the JS fixture encode|stringify is a deliberate twin (test/receiverevidencefix: same-named near misses); pargates.py is unchanged since cd87e30e (a regrouped pre-existing pair). The one real clone, the enclosing-function walk, was merged into innermostEnclosingFn instead of acked +ack new-clone-of-reused-helper ee2558b64b93a15e 13 now=13 was=0 facet=one-statement p=src/forunused.h:690 QD-VA-FORMS (E0): shstatus isWordChar is Python's \w (namesplit::isIdentChar or a non-ASCII byte); forunused's isIdent also takes '$': a different class, both already built on namesplit::isIdentChar ack new-clone-of-reused-helper ef69b96712422a31 3 by=src/extentsuspect.h now=3 was=0 prov=recon facet=one-statement lane fix/cpp-macro-member-reparse-2026-09-11, extent detector (src/extentsuspect.h): extent::inSet is the std::find( begin, end, v ) != end membership test over a constexpr std::array of enums (the SymKind and Lang rule tables, 9 call sites). Its partners spell the same one-liner over a span of string_view (ingest_relations.h namesNode), an initializer_list of string_view (naminglens::ncAnyOf) and a Scope pattern vector (quality::scopeUsesDiffToken), and notes::sortNotes is a bare std::stable_sort. An idiom collision at 30-36 tokens across four subsystems: no member can take another member argument type, and the comment on namesNode records this spelling as the house one. ack new-clone-of-reused-helper f10ce50bdc680d80 6 Review of #214, round 2. The section now cuts over its own grouped, escaped rendering and the run-hint clause is gated on the row COUNT the emitter reports, so the seams that carry those two facts changed shape together and every gating row is that one change. api-surface writeFlipHeader 4->5: ONE parameter, the count of test files the caller already rendered, so the header can gate its clause on the rows the document will carry - a flip with paid 180 B for a rule about rows it has none of, and the header cannot see the corpus to count them itself (one caller, updated in the same commit). duplication/new-clone renderToString | chargeSection: chargeSection is the est_tokens family's FAULT-INJECTABLE buffer (openChargeBuffer is constexpr-false in release and is what estchargecheck degrade arm switches on), so it cannot route through a plain open_memstream seam without deleting the only reachable degrade path the gate has; mcpverbs captureXml WAS folded into the seam in this same commit rather than acked. short-horizon-churn churn=self on writeFlip/writeFlipHeader/writeHandoffPacket/writePrContext/partitionTestRows/dispatchMcpLine is this lane own footprint across the two rounds of one item - the E1 landing, the CI budget fix, the first review round and this one - none foreign, none thrash. ack new-clone-of-reused-helper f5a96185fd557a83 3 now=3 was=0 prov=recon R2 pattern lane: the six gating rows left after two real extractions are idiom and dispatcher footprint, not new debt. runLint complexity/verbosity: adding a FIFTH verb to a five-verb dispatcher grows it; the compile, refusal and disclosure assembly are already out in runPatternSearch (the split runMatchQuery established) and the legend is out in kPatternLegend, so what remains is the emission loop every sibling verb also has inline. The four lintCatalogFind clone rows: a std::find_if over a constexpr table returning pointer-or-null IS the idiomatic spelling, and wrapping std::find_if to make two three-line lookups tokenize differently is the 'do not game the number' case this verb's own legend names. diff --git a/README.md b/README.md index a3572946c..2ccbcfa70 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@

Trendshift: C++ Repository of the Week badge for redhat-et/ripwire

Ranked, deterministic call graph: what to touch, what it breaks, which tests to run. On the edit: blast -radius, tests that reach it, twelve quality kinds reporting only what got worse, forgotten co-changes, fields +radius, tests that reach it, thirteen quality kinds reporting only what got worse, forgotten co-changes, fields read and written, names that resolve more than one way. **Just want to use it?** Install it with the one line below, then start each coding session by telling your agent to @@ -961,12 +961,13 @@ firing on the same function is corroboration rather than one metric counted twic That matters most for code an agent wrote. Empty-catch error masking is **+47%** more common in AI-authored commits, a function rewritten again inside two weeks **+15%** more likely, and reuse is *declining* as AI's share of commits grows (GitClear, *AI Copilot Code Quality*, 2026). Ten of -`--quality-delta`'s 12 kinds each target one measured mode like those (the eleventh, `placeholder`, +`--quality-delta`'s 13 kinds each target one measured mode like those (the eleventh, `placeholder`, lists the stubs and TODOs a change adds, and never gates; the twelfth, `defect-shape`, catches four defect shapes review kept finding by hand — new-symbol rows never gate, except defect-shape format-arity and a new function at the ceiling, because a format/argument mismatch is a defect, not debt, and a new function at 4x the bar — ccx 60 or 240 lines — -is how a 1,000-line function starts), and it reports **only what your +is how a 1,000-line function starts; the thirteenth, `tangle`, is report-only: a long function's nesting, deep share and +steering locals, with length only amplifying them, so a long orchestrator of named steps stays quiet), and it reports **only what your change made worse** — then `--exemplar` shows the pattern in your own repo to copy, and `--test-gate` names the tests that must run before "done." diff --git a/changelog.d/qd-false-rows.md b/changelog.d/qd-false-rows.md new file mode 100644 index 000000000..6509f66e9 --- /dev/null +++ b/changelog.d/qd-false-rows.md @@ -0,0 +1,16 @@ +### Changed — quality-delta: a run of calls that shares no callee is an idiom collision, not a copy; range answers say when the files on disk moved on + +Duplication rows gain a fifth recognized idiom, `call-sequence`: a body that is only call statements (no return, +declaration, assignment or control flow). Normalized, every such body reads `$I . $I ( … ) ;` repeated, so a +reused two-line helper (`sortUnique`: sort, then erase-unique) gated as a NEW clone of a four-call stream writer +and of a bench wrapper it has nothing in common with. A call-sequence group whose members share no callee or +other identifier (parameter names, `std::` chains and container words aside), sit in different files or scopes, +are under 80 tokens and are not one body with renamed parameters is now reported `sev="minor"` with +`idiom="call-sequence"` instead of gating. A shared callee, one namespace, or a parameter-only rename keeps it +gating. On this repo, tmux and hono the rule demotes no existing clone group; `test/cloneidiomcheck.sh` arm (P) +pins both directions. + +`--quality-delta=A..B` now carries `stale_tree="1"` (and a one-line stderr note) when the files on disk are not B's +tree — uncommitted edits, untracked files, or a HEAD whose tree differs from B's (another commit with the same tree is +not stale) — so a green range answer is not read as a +pass for the files on disk. Never gating; `test/qdrefpaircheck.sh` arm (B2). diff --git a/changelog.d/qd-lessons-1.md b/changelog.d/qd-lessons-1.md new file mode 100644 index 000000000..62531b71f --- /dev/null +++ b/changelog.d/qd-lessons-1.md @@ -0,0 +1,41 @@ +### Changed — `--quality-delta`: a short clone row over different data stops gating; a repeated decision is named on its complexity row + +**Clone rows over different data (QD-IDIOM-ELEMTYPE).** Some clone groups are under 80 tokens, sit in distinct +contexts and were not already demoted as a recognized idiom. Such a group is now reported `sev="minor"`, and no +longer gates, when every pair of members operates on different data. "Different data" means one of two things. +The members share no literal: 0 and 1 are left out, and `true`, `nullptr`, `None` and the like count. Or the members +take the same number of concrete parameters, with a different type at some position. The row says which with +`why="different literals"`, `why="different parameter types"` or `why="different literals or parameter types"`. +A shared literal rules out the literal proof, and a template or generic member or an untyped parameter rules out the +type proof; a group with neither proof keeps gating, as before. A recognized idiom whose members share a domain +value, such as a ladder over the same `Grade::Poor` … with tuned thresholds, a pair sharing a named constant, or a +pair calling the same helper, keeps gating under both proofs. A function passed by value, like `svLess`, does not +count. Two bodies that both pass their literal straight to a call keep gating too, because that is one function with +the literal as a parameter (`rfind( '/' )` beside `rfind( "::" )`, the `afterLast` family). +`--clones` does not read this verdict and is byte-identical. + +Measured on ripwire's own history, gating rows fell from 13 to 3 on the 13 acknowledged VA-FORMS rows. The 3 that +still gate do so by design: one is past the 80-token ceiling, and two members share the literal `0x80`. Other ranges: +- 41 to 36 on 40 tmux commits; +- no change on the qd-tangle range, the last 20 merges, the slip commits, textual or 20 other tmux commits; +- 1,863 to 1,327 on a synthetic envoy range that adds two whole subtrees. + +The real duplicates still gate (`writeTangleLines`/`writeHexPairLines`, `steer_find`/`JsonNode::get`). Hand-reading +24 envoy demotions found 21 idiom collisions over different data and 3 borderline rows, among them the identical +"all matchers match" loop over two element types. None was a verbatim copy. `test/cloneoperandcheck.sh` pins the +path: three positives, six counted negatives and a guard-off proof. + +**A repeated decision (QD-REPEATED-DECISION).** A function may test the same condition twice: the same 6 or more +tokens, verbatim, in an `if`/`while`/`elif` or a `( … ) ?` ternary. Or it may repeat a loop body: 12 or more tokens +identical. Its complexity or tangle row now carries `fix="name the decision once: is tested at lines A and +B"` or `fix="name the loop once: the loop body at line A repeats at line B"`. This is a facet. It never makes a row, +and it never changes a severity or gating. In Python a keyword counts only when it starts its line, so comprehensions +and conditional expressions are not read as statements. Ruby, Lua, Elixir and shell are not read. + +On ripwire's last 20 merges 14 rows gained the fix, among them `chooseInWindow`'s copied pass loop. Three of the 42 +distinct fix= rows across the ripwire, tmux and textual ranges re-test a fact that changes in between: +`memguard::overHardLimit()`, `!qsnapGet(…)` and tmux `event_initialized`. For those, deciding once is the wrong advice. +`test/repeateddecisioncheck.sh` pins it with two positives and five counted negatives. + +The legend defines `why=` on a clone row and the new fix= text only when a row carries them. The compact dictionary's +`why` entry now also covers the clone row, so its `dictv` moves. diff --git a/changelog.d/qd-shrink-pair.md b/changelog.d/qd-shrink-pair.md new file mode 100644 index 000000000..c6101f90e --- /dev/null +++ b/changelog.d/qd-shrink-pair.md @@ -0,0 +1,26 @@ +### Changed — `--quality-delta`: a clone pair that crossed the bar only because one member shrank stops gating + +**Shrink-only clone pairs (QD-SHRINK-PAIR).** A Type-3 pair's similarity is 2·LCS/(|a|+|b|), so it rises when either +member loses tokens the other does not share. Handing a body's sort and `erase( unique )` lines to a helper therefore +made it look more like its neighbour: on lane/sort-unique, `cFamilyMacroNames` fell from 135 to 99 tokens, its shared +LCS with `jsExportsOf` fell from 84 to 81, and the pair crossed 0.8. It printed as a gating duplication row and a gating +new-clone-of-reused-helper row about an edit that removed code and copied none. + +Such a row is now reported `sev="minor"`, and no longer gates, when all of these hold: +- every member existed at the base; +- some member's body has fewer tokens now, and no member's body was cut to under half its base tokens; +- no pair's shared LCS grew. + +The row says why: `why="pair crossed the bar because cFamilyMacroNames shrank 135->99 tok; shared code did not grow +(LCS 84->81)"`. A pair whose LCS grew still gates, even while a member shrank, because code was copied in. A member +cut to under half its body is a rewrite the rule cannot judge (a long base body holds most short ones as a subsequence, +so its base LCS says nothing), and it still gates. A group with +a member the base did not hold still gates, and so does one with an overload under a member's key, more than four +members, or a body the base commit could not be read for. The base bodies are read from git at the base commit for +the files of those rows only: the range form's base, or HEAD for the working-tree form, MCP `quality_delta` and the +`--quality-baseline` dirty-pin check. They are read with the same extraction and tokenizer the clone pass uses. +No snapshot or cache format changes. `--clones` does not read this verdict and is byte-identical. + +The legend defines the new `why=` only when a row carries it, and the compact dictionary's `why` entry now covers it, +so its `dictv` moves. `test/shrinkpaircheck.sh` pins the rule with three positives (range, working tree, MCP), a +both-shrank positive, four counted negatives and a guard-off proof. diff --git a/changelog.d/qd-tangle.md b/changelog.d/qd-tangle.md new file mode 100644 index 000000000..83880c7be --- /dev/null +++ b/changelog.d/qd-tangle.md @@ -0,0 +1,13 @@ +### Added — `--quality-delta` reports `tangle`, the thirteenth kind, with a best-since-tag ratchet and an `` section + +A long function whose nesting goes past 3, whose deep regions take a growing share, or whose steering locals (a +primitive set in one step and read by a branch 10 or more statements later) multiply, scores a tangle: T from those +three inputs, S = T x log2(lines / 50), so a function of 50 lines or fewer scores 0 and a long orchestrator of named +steps scores 0 too. The row is report-only (always `sev="minor"`) and carries `why=` (the inputs that rose), `fix=` +(the shape the rise calls for, with lines) and `locals=` (the steering locals); `--metrics` gains `steer=` and +`tangle=`. Short arms of a 4+-arm switch or else-if chain are left out of the deep share, so a flat dispatcher reads +flat. A function above its best since the last tag gets `ratchet="TAG"` (the history is read on the first-parent +line, at most 512 versions; a ref-pair range reads no history and gets no ratchet), and an `` section (JSON +`"improved"`) lists what the change made better, never as a row and never gating. Measured on 44 hand labels across +ripwire, tmux, textual and envoy: AUC 0.986 for S (0.728 for the cx metric, 0.882 for ccx). The ingest +cache moves to 54 and the warm snapshot to 4 (the definition record carries the steering byte), so both rebuild once. diff --git a/changelog.d/qd-unchecked-status.md b/changelog.d/qd-unchecked-status.md new file mode 100644 index 000000000..5edc1e90a --- /dev/null +++ b/changelog.d/qd-unchecked-status.md @@ -0,0 +1,12 @@ +### Added — `--quality-delta` names a dropped I/O or child status (`defect="unchecked-status"`) + +A fifth defect-shape facet reports, as a minor row that never gates, a status the change drops: in C/C++ a +statement-level `pclose`, `rename`, `write`, `system`, `fflush` (not of stdout/stderr), `waitpid` whose status +nothing reads, and `fclose`/`close` of a stream or fd the function wrote (plain, `std::`, `os::` or `rw::os::`); in +Python `subprocess.run` without `check=` whose result is dropped or read only for its output, `subprocess.call` and +`os.system`. A `(void)` cast, `check=` and a cleanup inside a failed write's branch say "decided" and give no row. The +row's `p=` is the dropped call's line and its new `call=` attribute names the call (XML, `--json` and MCP). Replaying +three fix commits backwards gives their rows (3 of 3); a 20-site hand-check on tmux, code-review-graph and this tree +found 20 of 20 drops real and 16 worth a check. Go `_ = f()` and Rust `let _ = f()` stay out, as in error-masking. +The quality snapshot scheme moves to 37 (qd-unhandled-arm, later in the same release, takes it to 38), so an older snapshot cache is rebuilt once; the legend dictionary moves to +`dictv=ff6a8ec8438b7fe0 entries=1176` (with the other quality-delta changes in this release). diff --git a/changelog.d/qd-unhandled-arm.md b/changelog.d/qd-unhandled-arm.md new file mode 100644 index 000000000..8f6decc65 --- /dev/null +++ b/changelog.d/qd-unhandled-arm.md @@ -0,0 +1,15 @@ +### Added — `--quality-delta` names a classifier that leaves a value without an outcome (`defect="unhandled-arm"`) + +A sixth defect-shape facet reports, as a minor row that never gates, a classifier over a closed set that gives a +value it does not name no outcome: a C/C++ `switch` with no `default:` that decides a value (every arm returns one, +or every arm assigns the same name) over an enum defined in the indexed tree and leaves one of its enumerators out +(count sentinels such as `kFooCount` and aliases are owed no arm); a shell `case` with no `*)` arm that ends its +function with `return`/`echo`/`printf` arms, or whose arms each set one name read after `esac`; a Python if/elif +chain or `match` that ends a value-returning function with no `else`, so an unmatched value returns `None` (an +`Enum` the file defines is checked for coverage). The row's `p=` is the switch's line and its new `why=` attribute +names what is left out (XML, `--json` and MCP). Because the site names the missing enumerators, appending one to an +enum gives a row on every switch it leaves incomplete, even an untouched one. A default/`*)`/`else`, full coverage, +a comment that states the omission, a void dispatcher, an `#if` in the switch or the enum, and generated code give +no row. Rust and TypeScript stay out (the compiler checks `match`; TS has no never-check reading yet). The quality +snapshot scheme moves to 38, so an older snapshot cache is rebuilt once; the legend dictionary moves to +`dictv=ff6a8ec8438b7fe0 entries=1176` (with the other quality-delta changes in this release). diff --git a/changelog.d/qd-va-forms.md b/changelog.d/qd-va-forms.md new file mode 100644 index 000000000..315a84ffe --- /dev/null +++ b/changelog.d/qd-va-forms.md @@ -0,0 +1,9 @@ +### Changed — `defect="vacuous-assert"` reads a test script's exit-status dataflow, not a grep prefilter + +The vacuous-assert facet now runs on a C++ port of the exit-status matcher in `test/lib/exitstatus.py` +(`src/shstatus.h`; `test/gateexitcheck.sh` H4 holds the two equal on 9,144 calls). It reports an assertion that +passes on an empty text (an absence `grep`, `[ -z ]`, a `cmp`/`diff`/`=` parity) when the text was read off a run +whose status nothing checks: a capture, a pipe without `pipefail`, a redirected file, a dropped wrapper status, a FAIL +reporter inside `$( )` or an unread `rc=$?`. Every test script is read (the `grep` prefilter is gone). Recall is 8 of +11 on this project's own fix commits (it was 0), with 0 new rows on a forward replay of the same files. The row stays +`sev="minor"`. The quality snapshot scheme moves to 35 (later members of the same release take it to 38). diff --git a/docs/COMMANDS.md b/docs/COMMANDS.md index 718dcffef..d17775047 100644 --- a/docs/COMMANDS.md +++ b/docs/COMMANDS.md @@ -9,7 +9,7 @@ python3 docs/docs_commands_build.py --bin build/ripwire The flag surface below is read from `ripwire --help`, so it cannot disagree with the shipped binary. `test/docscommandscheck.sh` fails if it ever does — in either direction. -Sample output is lifted from a real recorded run (`docs/captures/COMMANDS_showcase_2026-11-19.md`), trimmed to the first few lines and +Sample output is lifted from a real recorded run (`docs/captures/COMMANDS_showcase_2026-11-20.md`), trimmed to the first few lines and scrubbed of local paths. It is illustrative, not a golden: run the command yourself for the current shape. @@ -72,14 +72,14 @@ $ ./build/ripwire . --top-k=5 - - + + - - + + ... [17 more line(s); run it to see the whole thing] @@ -108,17 +108,17 @@ $ ./build/ripwire . --top-k=5 --no-inventory - - + + - - + + -... [13 more line(s); run it to see the whole thing] +... [14 more line(s); run it to see the whole thing] ``` **Caveats (stated by the binary):** @@ -142,8 +142,8 @@ $ ./build/ripwire . --max-tokens=1500 - - + + @@ -172,7 +172,7 @@ _GATE form: exit 3 if the map's own est_tokens exceeds the budget (over-budget f ``` $ ./build/ripwire . --token-budget=100 - + ``` **Shaped by:** `--top-k`, `--max-tokens`, `--for`, `--sections`, `--recall`, `--handoff`, `--pr-context`, `--from-trace` @@ -225,14 +225,14 @@ _Name-shaped query: the router picks name-exact BM25 (header says which/why)._ ``` $ ./build/ripwire . --for="rankGraphTeleport" - + - + PageRank with an explicit teleport / personalization vector p (Σp = 1). The prior is name-quality-biased through biasPrior() so all rank modes share one weighting seam; the transition matrix (edgesinline RankedGraph rankGraphTeleport( const Graph& g, const std::vector<float>&am … [line truncated: 31 more bytes on this line] #### The convergence disclosure contract -### Wave-2 adversarial verification (2026-08-19) — six probes against `aa97c9e` +### Wave-2 adversarial verification (2026-08-19) — six probes against `aa97c9e` @@ -262,14 +262,14 @@ _Restore the / sections the --for bundle collapses to a counted s ``` $ ./build/ripwire . --for="tree-sitter parse of a source file" --sections=lego,compose - + inline bool topLevelEvidence( std::string_view source, const TSLanguage* language, const Predicate& predicate ) + The crawl's per-file byte ceiling. A text file larger than this is skipped: at this size it is o…constexpr std::size_t kDefaultMaxFileBytes = 4u * 1024u * 1024u -TSTree* parseTree( TSParser* parser, std::string_view src ) +TSTree* parseTree( TSParser* parser, std::string_view src ) Exercise every registered grammar and its embedded query, reporting loaded and expected totalsinline DoctorGrammarProbe doctorProbeGrammars() ... [21 more line(s); run it to see the whole thing] @@ -289,14 +289,14 @@ _T3 opt-out: the signatures-only lens (no auto bodies, no bundle="auto" attribut ``` $ ./build/ripwire . --for="rankGraphTeleport" --signatures-only - + - + PageRank with an explicit teleport / personalization vector p (Σp = 1). The prior is name-quality-biased through biasPrior() so all rank modes share one weighting seam; the transition matrix (edgesinline RankedGraph rankGraphTeleport( const Graph& g, const std::vector<float>&am … [line truncated: 31 more bytes on this line] #### The convergence disclosure contract -### Wave-2 adversarial verification (2026-08-19) — six probes against `aa97c9e` +### Wave-2 adversarial verification (2026-08-19) — six probes against `aa97c9e` @@ -324,14 +324,14 @@ _Opt OUT of compact conceptual serving: restore the rank-first auto wal ``` $ ./build/ripwire . --for="tree-sitter parse of a source file" --auto-bodies - + inline bool topLevelEvidence( std::string_view source, const TSLanguage* language, const Predicate& predicate ) + The crawl's per-file byte ceiling. A text file larger than this is skipped: at this size it is o…constexpr std::size_t kDefaultMaxFileBytes = 4u * 1024u * 1024u -TSTree* parseTree( TSParser* parser, std::string_view src ) +TSTree* parseTree( TSParser* parser, std::string_view src ) Exercise every registered grammar and its embedded query, reporting loaded and expected totalsinline DoctorGrammarProbe doctorProbeGrammars() ... [21 more line(s); run it to see the whole thing] @@ -356,17 +356,17 @@ _Same query with routing forced OFF (plain subtoken+body BM25) — contrast with ``` $ ./build/ripwire . --for="rankGraphTeleport" --no-route - + - + PageRank with an explicit teleport / personalization vector p (Σp = 1). The prior is name-quali…inline RankedGraph rankGraphTeleport( const Graph& g, const std::vector<float>& p, float alpha = 0.85f ) - + uniform-teleport PageRank (the default). A kRankFlagNotNamed unit (model.h) has no edge and a 0 …inline RankedGraph rankGraph( const Graph& g, float alpha = 0.85f ) The default map's PageRank — uniform teleport, the one rank that is a function of the Graph al…inline std::optional<RankedGraph>& storedDefaultRank() noexcept -inline ChurnRanking churnRankedGraph( const MainDispatch& d ) +inline ChurnRanking churnRankedGraph( const MainDispatch& d ) ... [20 more line(s); run it to see the whole thing] ``` @@ -388,14 +388,14 @@ _Cut the result at the relevance cliff (Adaptive-k) — on a flat ranking nothin ``` $ ./build/ripwire . --for="tree-sitter parse of a source file" --adaptive - + inline bool topLevelEvidence( std::string_view source, const TSLanguage* language, const Predicate& predicate ) + The crawl's per-file byte ceiling. A text file larger than this is skipped: at this size it is o…constexpr std::size_t kDefaultMaxFileBytes = 4u * 1024u * 1024u -TSTree* parseTree( TSParser* parser, std::string_view src ) +TSTree* parseTree( TSParser* parser, std::string_view src ) Exercise every registered grammar and its embedded query, reporting loaded and expected totalsinline DoctorGrammarProbe doctorProbeGrammars() ... [21 more line(s); run it to see the whole thing] @@ -419,11 +419,11 @@ _Same task with the anchor disabled — the contrast the flag exists for._ ``` $ ./build/ripwire . --for="why does src/lexical.h chooseForRanker pick name-exact BM25" --no-mention-boost - - + The name-exact ranker AS THE RETRIEVAL LENS SERVES IT: whole-name BM25 plus the definition-over-…inline std::vector<float> lexicalScoresNameExactRanked( const IngestResult& ing, std::string_view query, const std::vector<float>* symbolScoreMul ) P11.12: the interpretive footer for --eval's ranker table, pulled into its own function so the 9…inline void printEvalRankerNote() @@ -449,15 +449,15 @@ _The same task with doc-mention surfacing OFF — the contrast the flag exists f ``` $ ./build/ripwire . --for="quality delta acks ledger rubber stamp" --no-doc-mention - + - - + + L2 stale acks in the range form. A changed-files answer holds no whole target tree to check the …std::vector<rw::quality::StaleAck> refPairStaleAcks( const gtl::btree_map<std::string, rw::quality::AckRecord>& acks, const RefPairDelta& refs ) -inline QualityDeltaOutcome computeQualityDelta( const std::string& root ) -inline std::string staleByKindValue( const std::vector<StaleAck>& staleAcks ) -inline constexpr const char* kAtStampLegend = "<!-- at= is the git commit these numbers were computed at +inline QualityDeltaOutcome computeQualityDelta( const std::string& root ) +inline std::string staleByKindValue( const std::vector<StaleAck>& staleAcks ) +inline constexpr const char* kAtStampLegend = "<!-- at= is the git commit these numbers were computed at ... [22 more line(s); run it to see the whole thing] ``` @@ -479,7 +479,7 @@ _Interface -> implementors view: every existing impl of the named interface; the $ ./build/ripwire . --lego=Vehicle - + @@ -510,7 +510,7 @@ _The repo's best-in-class instance to imitate before writing new code (picked by $ ./build/ripwire . --exemplar="format byte sizes for humans" - + - + + + + + + - - - - - ... [17 more line(s); run it to see the whole thing] ``` @@ -708,14 +713,14 @@ $ ./build/ripwire . --order=stable --top-k=5 - + - - + + ... [17 more line(s); run it to see the whole thing] @@ -739,14 +744,14 @@ $ ./build/ripwire . --no-stable --top-k=3 - - + + - - + + ... [17 more line(s); run it to see the whole thing] @@ -773,7 +778,7 @@ $ ./build/ripwire . --around=rankGraphTeleport - + @@ -823,18 +828,18 @@ _What SYM calls (1-hop out-edges)._ ``` $ ./build/ripwire . --callees=rankGraphTeleport - - + + - - - - - - + + + + + + ``` @@ -858,16 +863,16 @@ _The resolvable use-sites (call/read/write/import/extends) with file:line; count ``` $ ./build/ripwire . --uses=rankGraphTeleport - - - - + + + + - - - - - + + + + + ``` @@ -892,17 +897,17 @@ _Composable node-set query: functions within 2 caller-hops of rankGraphTeleport. ``` $ ./build/ripwire . --graph-query='and(callers(name("rankGraphTeleport"),2),kind(all,fn))' - - - - + + + + - - - + + + - + ... [17 more line(s); run it to see the whole thing] @@ -929,19 +934,19 @@ _Names referenced but never defined in-corpus (stdlib/third-party surface). The ``` $ ./build/ripwire . --external-surface - - - - - - - - - - - - - + + + + + + + + + + + + + ... [17 more line(s); run it to see the whole thing] ``` @@ -964,13 +969,13 @@ _Shortest directed call-path SRC -> DST. CHANGED: now reports from_p/to_p/from_d ``` $ ./build/ripwire . --path=main,rankGraphTeleport - - - - - - + + + + + + ... [20 more line(s); run it to see the whole thing] ``` @@ -988,14 +993,14 @@ _Which definitions each name binds, one row per definition group with sel= (the $ ./build/ripwire . --defs=main,rankGraphTeleport - + - + @@ -1016,13 +1021,13 @@ _Minimal connecting subgraph over 3 symbols (finds shared-caller joins)._ ``` $ ./build/ripwire . --connect=rankGraphTeleport,runEval,getIndex - + - - + + - + ``` @@ -1126,7 +1131,7 @@ _Test files that transitively reach the changed file._ ``` $ ./build/ripwire . --affected=src/graph.h - @@ -1137,6 +1142,7 @@ $ ./build/ripwire . --affected=src/graph.h + ``` @@ -1186,7 +1192,7 @@ _Mid-task situational report for the current git diff — recorded against a CLE $ ./build/ripwire . --situ ripwire situational-awareness — 0 changed file(s), 0 symbols in them root: . -at: b1fdfdb4e +at: b0cb13d8d (0 changed files — working tree is clean, nothing to analyze) ``` @@ -1205,18 +1211,18 @@ _The continuation packet for the NEXT session: disk truth (branch/sha ``` $ ./build/ripwire . --handoff - + - + - - - + + + + ... [1 more line(s); run it to see the whole thing] ``` @@ -1240,7 +1246,7 @@ _Pre-PR gate on a CLEAN tree: no obligations, exit 0._ ``` $ ./build/ripwire . --test-gate - ``` @@ -1265,7 +1271,7 @@ _Literal trigram-indexed search. Each hit carries its MATCHED line as the $ ./build/ripwire . --grep=DISCLOSE - + - + - + ... [17 more line(s); run it to see the whole thing] ``` @@ -1567,7 +1573,7 @@ _Importance-weighted detail: FULL bodies for top-2, signatures for the rest._ ``` $ ./build/ripwire . --for="pagerank power iteration" --detail=2 - + @@ -1604,14 +1610,14 @@ $ ./build/ripwire . --pack-signatures --top-k=10 - - + + - - + + ... [17 more line(s); run it to see the whole thing] ``` @@ -1633,7 +1639,7 @@ $ ./build/ripwire . --outline=rankGraphTeleport --top-k=0 signature rows. est_tokens=: price as emitted (an upper bound under compact). root=: p= relative to it. --> - + & p, float alpha = 0.85f ) { PROFILE_SCOPE_DESCRIBE( "rankGraph: PageRank (power iteration)" ); @@ -1664,7 +1670,7 @@ $ ./build/ripwire . --top-k=0 --expand=rankGraphTeleport - + + - - + + - + - - + + ... [17 more line(s); run it to see the whole thing] @@ -1836,16 +1842,16 @@ _File->file dependency graph (god-files, cycles)._ ``` $ ./build/ripwire . --deps - - - - - + + + + + + - @@ -1873,18 +1879,18 @@ _Complexity x recent git churn (maintenance pain)._ $ ./build/ripwire . --hotspots - - - - - - - - - + + + + + + + + + - - + + ... [17 more line(s); run it to see the whole thing] ``` @@ -1900,18 +1906,18 @@ _Token-normalized duplicate bodies._ ``` $ ./build/ripwire . --clones - - + + - + - + ... [17 more line(s); run it to see the whole thing] @@ -1932,15 +1938,15 @@ _Per-function size ranking, largest Halstead volume/token entropy/lines first ``` $ ./build/ripwire . --biggest-first --limit=8 - - - + + + - + - - - + + + ``` @@ -1965,7 +1971,7 @@ _Per function, the non-local MUTABLE state it can reach (transitively), most wri ``` $ ./build/ripwire . --nonlocal-state --limit=8 - @@ -2000,12 +2006,12 @@ _The family join: per function, which of four orthogonal evidence families fire, ``` $ ./build/ripwire . --ensemble --limit=8 - + - + @@ -2031,17 +2037,17 @@ _THE single wide-angle quality read: six families in one pass, an eligible/ranke ``` $ ./build/ripwire . --quality-panel - + - + - - + + - + ... [17 more line(s); run it to see the whole thing] @@ -2068,13 +2074,13 @@ _The local-reasoning lens: to understand this symbol, how much must you know tha ``` $ ./build/ripwire . --context-ratio --limit=8 - - - - - - + + + + + + ... [23 more line(s); run it to see the whole thing] ``` @@ -2099,19 +2105,19 @@ _Score the naming-* rules against this repo's own rename history: proxy=old/(old ``` $ ./build/ripwire . --naming-calibration - + - +

-

+

... [14 more line(s); run it to see the whole thing] ``` @@ -2134,11 +2140,11 @@ _The corpus's OWN case-convention vote per (language, kind) group; off-conventio ``` $ ./build/ripwire . --naming-consistency --limit=8 - - - - - + + + + + @@ -2171,8 +2177,8 @@ _The opt-in --lint modifier: naming predicates over LOCAL variable names too, C/ ``` $ ./build/ripwire . --lint --naming-locals - - + + @@ -2180,10 +2186,10 @@ $ ./build/ripwire . --lint --naming-locals - + - + ... [17 more line(s); run it to see the whole thing] ``` @@ -2206,13 +2212,13 @@ _Functions WITH a doc comment, most name-restating first: c_coeff (high = the co ``` $ ./build/ripwire . --comment-coherence --limit=8 - + - - - - + + + + @@ -2239,16 +2245,16 @@ _Files that change together in git (hidden coupling)._ ``` $ ./build/ripwire . --cochange - + - + - - - - + + + + ... [22 more line(s); run it to see the whole thing] ``` @@ -2271,16 +2277,16 @@ _Only pairs whose co-change RECURS in 2+ sub-windows of the mined window (sub_wi ``` $ ./build/ripwire . --cochange --cochange-recur=2 - + - - - + + + - + ... [22 more line(s); run it to see the whole thing] ``` @@ -2297,15 +2303,15 @@ _Modularity-violation GROUPS instead of pairs: "X co-changes with {A,B,C}, none ``` $ ./build/ripwire . --cochange --cochange-groups - - + + - + @@ -2326,18 +2332,18 @@ _Hotspots scoped to RECENT churn (the regression lens)._ ``` $ ./build/ripwire . --hotspots --since="2 weeks ago" - - - - - - - - - - - - + + + + + + + + + + + + ... [17 more line(s); run it to see the whole thing] ``` @@ -2451,8 +2457,8 @@ _Built-in AST checks (c-cast, goto, unsafe-c-fn, ...)._ ``` $ ./build/ripwire . --lint - - + + @@ -2460,10 +2466,10 @@ $ ./build/ripwire . --lint - + - + ... [17 more line(s); run it to see the whole thing] ``` @@ -2560,8 +2566,8 @@ _DROP two families, applied after selection; the raw select=/ignore= you passed ``` $ ./build/ripwire . --lint --lint-ignore=naming-,cache- - + @@ -2569,10 +2575,10 @@ $ ./build/ripwire . --lint --lint-ignore=naming-,cache- - + - + ... [17 more line(s); run it to see the whole thing] ``` @@ -2674,15 +2680,15 @@ _Cluster the call graph into cohesive modules._ ``` $ ./build/ripwire . --communities - + - + @@ -2705,7 +2711,7 @@ _Drill into ONE call-graph community by id — the drill= the --communities outp ``` $ ./build/ripwire . --community=0 - ``` @@ -2730,19 +2736,19 @@ _Nested module hierarchy (multi-level Louvain) + cross-module bridges — shown_ ``` $ ./build/ripwire . --zoom - - + + + + - + - - + + - - ... [17 more line(s); run it to see the whole thing] ``` @@ -2767,16 +2773,16 @@ $ ./build/ripwire . --report # ripwire architecture report -4763 files · 43356 symbols · 42475 edges · 4933 modules (20575 call-graph isolated) +4779 files · 44046 symbols · 43830 edges · 5053 modules (20765 call-graph isolated) Root: `.` -Call-graph isolate provenance: 5626 declaration, 3404 header, 4521 source, 7024 document; 0 connected Louvain singletons +Call-graph isolate provenance: 5724 declaration, 3481 header, 4519 source, 7041 document; 0 connected Louvain singletons -## Modules (call-graph clusters; showing 12 of 4933) -- **src::emitTo@infra/emit.h:53:2760 [write,run,emit]** — 1800 symbols -- **src::kindIs@infra/nodekind.h:46:3271 [push,emit,read]** — 679 symbols -- **src::DISCLOSE@infra/Diagnostics.h:622:43913 [read,compute,resolve]** — 557 symbols +## Modules (call-graph clusters; showing 12 of 5053) +- **src::emitTo@infra/emit.h:53:2760 [write,run,emit]** — 1880 symbols +- **src::kindIs@infra/nodekind.h:46:3271 [push,emit,read]** — 697 symbols +- **src::DISCLOSE@infra/Diagnostics.h:622:43913 [read,check,collect]** — 252 symbols ... [17 more line(s); run it to see the whole thing] ``` @@ -2793,9 +2799,9 @@ _Cross-module call seams no test reaches. NOW carries seam_pairs/shown/capped._ ``` $ ./build/ripwire . --seams - - + + @@ -2803,9 +2809,9 @@ $ ./build/ripwire . --seams - - - + + + ... [17 more line(s); run it to see the whole thing] ``` @@ -2824,15 +2830,15 @@ $ ./build/ripwire . --mermaid %% ripwire --mermaid: module (directory) dependency graph — node = dir (symbol count), edge = inter-module calls (>= 3). Render at mermaid.live. flowchart LR subgraph sg0 ["src"] - n105["src
14030"] - n106["src/infra
1675"] + n105["src
14596"] + n106["src/infra
1684"] end subgraph sg1 ["test"] - n107["test
6886"] + n107["test
6966"] n750["test/legochargefix
546"] n472["test/fixtures/recallpassage
314"] n491["test/fnslotcpp2
285"] - n913["test/lib
235"] + n913["test/lib
253"] n712["test/ifacepeelfix/cpp
206"] n1252["test/slotjoinfix
182"] ... [17 more line(s); run it to see the whole thing] @@ -2853,8 +2859,8 @@ _Bus-factor: recency-weighted author ownership per file._ ``` $ ./build/ripwire . --owners - - + + @@ -2884,7 +2890,7 @@ _Internal functions with no caller found in the index — a name-based graph rea ``` $ ./build/ripwire . --dead-code=src - + @@ -2892,7 +2898,7 @@ $ ./build/ripwire . --dead-code=src - + ... [20 more line(s); run it to see the whole thing] ``` @@ -2957,7 +2963,7 @@ _The same run, the same clone, the folded rows printed back: each stale acknowle ``` $ ./build/ripwire . --quality-delta --show-stale - @@ -2975,9 +2981,9 @@ $ ./build/ripwire . --quality-delta --show-stale ### `--quality-delta` -**Answers:** before a PR: report ONLY what your change made worse, across 12 kinds — pair with --test-gate. +**Answers:** before a PR: report ONLY what your change made worse, across 13 kinds — pair with --test-gate. -Each kind is measured against the baseline (complexity/verbosity/nesting/params/dup/dead/api-surface + error-masking/short-horizon-churn/new-clone-of-reused-helper + placeholder + defect-shape); every finding is classified by ORIGIN: a symbol that EXISTED at the baseline and got worse (preexisting-worse="N", no attribute on the row) vs one that exists only because the code is NEW (new-symbol="N", origin="new-symbol" on the row). A small numeric delta is additionally sev="minor". EXIT 2 ONLY on a major AND unacked row that is preexisting-worse, defect-shape format-arity (any origin) or a new function at the ceiling — the gating="N" header count. New-symbol rows are still PRINTED (they are the debt you are adding — read them); new-symbol rows never gate, except defect-shape format-arity and a new function at the ceiling (4x the bar: ccx 60 or 240 lines, not a moved body, not test code, ceiling= on the row); exit 0 means "nothing that already existed got worse", not "clean". Clone kinds classify by member set (new-symbol only if EVERY member is new); short-horizon-churn is preexisting by construction. LIMIT: origin is canonId (path::scope::name) identity; a function RENAMED or MOVED with its body unchanged (whitespace and its own name aside: one body that left its key, matched to one new key) keeps its identity and the move reports nothing (and a file rename git recorded keeps each symbol in it under its own name, twins and changed bodies included), while one whose body also changed reads as new and a regression carried in with it will not gate; a function over the ccx or line bar whose body moved with a small edit (a clone-sketch match to a body that left its key) reads origin="moved" and never gates. error-masking = a NEW empty/pass/comment-only handler, or log-only (a broad handler whose body only logs and never names the error) or rethrow-only (the sole handler re-throws it unchanged); those two gate only where their precision was measured (Python) and are sev="minor" in every other language. Empty counts Go's `if err != nil {}` on a call's err and Rust's `if let Err(..) = f() {}` / `Err(..) => {}` or `=> ()`, and gates like Python's `except: pass`; log-only counts a Rust Err arm of print/log macros and a C++ catch of `std::cerr <<`, `LOG( x ) <<` or `fprintf( stderr, … )` (sev="minor"). facet="failure-default": a read, parse or spawn failure returned as an empty success (a TypeScript catch or .catch returning []/null/{}/false/0/'' around JSON.parse/fs reads/exec/spawn/fetch, in a function typed to return an array/boolean/object; a C++ value_or( empty ) on a file read); it never gates by itself. placeholder = a stub the change ADDED (todo!()/unimplemented!(), Kotlin TODO(), NotImplementedException, a bare raise NotImplementedError as a free function's body, a throw/raise/panic/assert saying "not implemented") or a comment line opening with TODO/FIXME that names no issue (#12, ABC-12, a URL); new-symbol by construction, so it never gates. Counted per enclosing symbol, like error-masking: a file-level TODO outside every definition is not counted. defect-shape = a known defect shape the change ADDED, named by defect=: format-arity (a literal std::format/print/format_to, fmt::, rw::emitTo/formatTo or Python "literal".format whose fields do not match its arguments — GATES on any origin, a defect not debt), utf8-cut and dedup-first (C++) and vacuous-assert (Bash test scripts) — report-only, always sev="minor". A site is new only when its text occurs more often than in the baseline: a moved one is not. Test-fixture dirs + doc sections are exempt from dead-code/churn; churn needs COMMITTED thrash evidence (rewritten across recent commits AND again by this diff), never the current edit alone WHICH FLOOR IT COMPARES AGAINST, and a side effect: the sidecar is honored only when the sha it was pinned at EQUALS the current git HEAD (strict equality — an ancestor commit describes a DIFFERENT tree, so everything committed since would read as your regression). A sidecar pinned anywhere else is STALE: this verb then DELETES it from your working tree (self-heal, so the next run does not rediscover the dead pin) and auto-compares the working tree vs git HEAD instead. Re-pin with --quality-baseline. The read-only MCP quality_delta verb applies the SAME staleness test but never deletes. A sidecar at the current HEAD that ANOTHER ripwire build pinned (its producer stamp names other sources — a dead set depends on how calls were resolved) is FOREIGN: both arms ignore it, never delete it, and auto-compare vs git HEAD. Which floor was actually used is on every report as baseline=: sidecar | git-HEAD | git-HEAD (stale sidecar removed) | git-HEAD (stale sidecar ignored) | git-HEAD (foreign sidecar ignored) — the stale two say a stale sidecar existed, and 'removed' means the file is gone. A non-git root has no HEAD to fall back to, so its sidecar is honored whenever this build pinned it; without one there, or with another build's, the verb exits 1. +Each kind is measured against the baseline (complexity/verbosity/nesting/params/dup/dead/api-surface + error-masking/short-horizon-churn/new-clone-of-reused-helper + placeholder + defect-shape + tangle, report-only); every finding is classified by ORIGIN: a symbol that EXISTED at the baseline and got worse (preexisting-worse="N", no attribute on the row) vs one that exists only because the code is NEW (new-symbol="N", origin="new-symbol" on the row). A small numeric delta is additionally sev="minor". EXIT 2 ONLY on a major AND unacked row that is preexisting-worse, defect-shape format-arity (any origin) or a new function at the ceiling — the gating="N" header count. New-symbol rows are still PRINTED (they are the debt you are adding — read them); new-symbol rows never gate, except defect-shape format-arity and a new function at the ceiling (4x the bar: ccx 60 or 240 lines, not a moved body, not test code, ceiling= on the row); exit 0 means "nothing that already existed got worse", not "clean". Clone kinds classify by member set (new-symbol only if EVERY member is new); short-horizon-churn is preexisting by construction. LIMIT: origin is canonId (path::scope::name) identity; a function RENAMED or MOVED with its body unchanged (whitespace and its own name aside: one body that left its key, matched to one new key) keeps its identity and the move reports nothing (and a file rename git recorded keeps each symbol in it under its own name, twins and changed bodies included), while one whose body also changed reads as new and a regression carried in with it will not gate; a function over the ccx or line bar whose body moved with a small edit (a clone-sketch match to a body that left its key) reads origin="moved" and never gates. error-masking = a NEW empty/pass/comment-only handler, or log-only (a broad handler whose body only logs and never names the error) or rethrow-only (the sole handler re-throws it unchanged); those two gate only where their precision was measured (Python) and are sev="minor" in every other language. Empty counts Go's `if err != nil {}` on a call's err and Rust's `if let Err(..) = f() {}` / `Err(..) => {}` or `=> ()`, and gates like Python's `except: pass`; log-only counts a Rust Err arm of print/log macros and a C++ catch of `std::cerr <<`, `LOG( x ) <<` or `fprintf( stderr, … )` (sev="minor"). facet="failure-default": a read, parse or spawn failure returned as an empty success (a TypeScript catch or .catch returning []/null/{}/false/0/'' around JSON.parse/fs reads/exec/spawn/fetch, in a function typed to return an array/boolean/object; a C++ value_or( empty ) on a file read); it never gates by itself. placeholder = a stub the change ADDED (todo!()/unimplemented!(), Kotlin TODO(), NotImplementedException, a bare raise NotImplementedError as a free function's body, a throw/raise/panic/assert saying "not implemented") or a comment line opening with TODO/FIXME that names no issue (#12, ABC-12, a URL); new-symbol by construction, so it never gates. Counted per enclosing symbol, like error-masking: a file-level TODO outside every definition is not counted. defect-shape = a known defect shape the change ADDED, named by defect=: format-arity (a literal std::format/print/format_to, fmt::, rw::emitTo/formatTo or Python "literal".format whose fields do not match its arguments — GATES on any origin, a defect not debt), utf8-cut and dedup-first (C++) and vacuous-assert (Bash test scripts) and unchecked-status (a dropped pclose/rename/write/system/fflush/close/waitpid status in C/C++; Python subprocess.run without check=, subprocess.call, os.system; the row carries call=) and unhandled-arm (a C/C++ switch with no default: that leaves an in-tree enum's enumerator out, a shell case with no *) arm whose result is read, a Python if/elif or match ending a value-returning function with no else; the row carries why=) — report-only, always sev="minor". A site is new only when its text occurs more often than in the baseline: a moved one is not. Test-fixture dirs + doc sections are exempt from dead-code/churn; churn needs COMMITTED thrash evidence (rewritten across recent commits AND again by this diff), never the current edit alone WHICH FLOOR IT COMPARES AGAINST, and a side effect: the sidecar is honored only when the sha it was pinned at EQUALS the current git HEAD (strict equality — an ancestor commit describes a DIFFERENT tree, so everything committed since would read as your regression). A sidecar pinned anywhere else is STALE: this verb then DELETES it from your working tree (self-heal, so the next run does not rediscover the dead pin) and auto-compares the working tree vs git HEAD instead. Re-pin with --quality-baseline. The read-only MCP quality_delta verb applies the SAME staleness test but never deletes. A sidecar at the current HEAD that ANOTHER ripwire build pinned (its producer stamp names other sources — a dead set depends on how calls were resolved) is FOREIGN: both arms ignore it, never delete it, and auto-compare vs git HEAD. Which floor was actually used is on every report as baseline=: sidecar | git-HEAD | git-HEAD (stale sidecar removed) | git-HEAD (stale sidecar ignored) | git-HEAD (foreign sidecar ignored) — the stale two say a stale sidecar existed, and 'removed' means the file is gone. A non-git root has no HEAD to fall back to, so its sidecar is honored whenever this build pinned it; without one there, or with another build's, the verb exits 1. **Try it** @@ -2986,7 +2992,7 @@ _The regression-free answer on a clone whose ledger holds stale acknowledgements ``` $ ./build/ripwire . --quality-delta - ``` @@ -3000,9 +3006,9 @@ $ ./build/ripwire . --quality-delta ### `--quality-delta=REV|A..B` -**Answers:** the same 12-kind report between two committed trees — a whole branch at once the same 12-kind report between two COMMITTED TREES instead of the working tree vs a baseline — the WAVE-level measurement (=A..B = tree B against tree A; +**Answers:** the same 13-kind report between two committed trees — a whole branch at once the same 13-kind report between two COMMITTED TREES instead of the working tree vs a baseline — the WAVE-level measurement (=A..B = tree B against tree A; -=REV = that commit against its FIRST PARENT; an EMPTY side of the range means HEAD). Same grammar --dmm= takes, and A...B is REFUSED rather than read as A..B. Use it to measure a whole integration branch at once (--quality-delta=..): per-lane checks each compare against their own baseline and cannot see a regression the WAVE introduced. Identical output contract to the bare form — same kinds, gating="N", exit 2, and the same .ripwire_quality_acks ratchet (acks are keyed root-relative, so a ledger recorded from working-tree runs applies unchanged). base_ref= and target_ref= disclose the two RESOLVED shas. No sidecar is read, written or deleted by this form, and at= is omitted: the two refs ARE the anchor. A==B is a legal, empty, exit-0 comparison. ONE KIND CANNOT BE MEASURED HERE and says so as churn="unavailable": short-horizon-churn needs git history at the tree being judged, and both trees are materialized OUT of the repo into temp dirs. The other 10 kinds are computed exactly as the bare form computes them. UNDER MEMORY PRESSURE IT ANSWERS PART OF THE QUESTION rather than nothing: when the guard stops either commit's full tree, or projects that the target phase will not fit the limit, it ingests only both commits' CHANGED files and runs the kinds those decide; the header names the rest (kinds_skipped=, ingest_scope="changed-files", memory_need=, also_skipped=) and kinds_next= replays exactly them. Exit 2 when a row gates (the skipped kinds only add rows), else 6 — partial, never 0; exit 5 only when even the changed files do not fit or cannot stand in for the trees (a symlink, an export attribute). --quality-ack (it needs every kind's rows) skips the projection: only a real memory stop refuses it (exit 5, ledger untouched). +=REV = that commit against its FIRST PARENT; an EMPTY side of the range means HEAD). Same grammar --dmm= takes, and A...B is REFUSED rather than read as A..B. Use it to measure a whole integration branch at once (--quality-delta=..): per-lane checks each compare against their own baseline and cannot see a regression the WAVE introduced. Identical output contract to the bare form — same kinds, gating="N", exit 2, and the same .ripwire_quality_acks ratchet (acks are keyed root-relative, so a ledger recorded from working-tree runs applies unchanged). base_ref= and target_ref= disclose the two RESOLVED shas. No sidecar is read, written or deleted by this form, and at= is omitted: the two refs ARE the anchor. A==B is a legal, empty, exit-0 comparison. ONE KIND CANNOT BE MEASURED HERE and says so as churn="unavailable": short-horizon-churn needs git history at the tree being judged, and both trees are materialized OUT of the repo into temp dirs. The other 12 kinds are computed exactly as the bare form computes them. UNDER MEMORY PRESSURE IT ANSWERS PART OF THE QUESTION rather than nothing: when the guard stops either commit's full tree, or projects that the target phase will not fit the limit, it ingests only both commits' CHANGED files and runs the kinds those decide; the header names the rest (kinds_skipped=, ingest_scope="changed-files", memory_need=, also_skipped=) and kinds_next= replays exactly them. Exit 2 when a row gates (the skipped kinds only add rows), else 6 — partial, never 0; exit 5 only when even the changed files do not fit or cannot stand in for the trees (a symlink, an export attribute). --quality-ack (it needs every kind's rows) skips the projection: only a real memory stop refuses it (exit 5, ledger untouched). **Try it** @@ -3011,7 +3017,7 @@ _The regression-free answer on a clone whose ledger holds stale acknowledgements ``` $ ./build/ripwire . --quality-delta - ``` @@ -3025,25 +3031,25 @@ $ ./build/ripwire . --quality-delta ### `--quality-kinds=K[,K...]` -**Answers:** (with --quality-delta=A..B) run only the named kinds — the replay a partial answer hands back (with --quality-delta=A..B) run ONLY the named kinds, comma-separated, of the twelve: api-surface, complexity, dead-code, defect-shape, duplication, error-masking, nesting, new-clone-of-reused-helper, params, placeholder, short-horizon-churn, verbosity. +**Answers:** (with --quality-delta=A..B) run only the named kinds — the replay a partial answer hands back (with --quality-delta=A..B) run ONLY the named kinds, comma-separated, of the thirteen: api-surface, complexity, dead-code, defect-shape, duplication, error-masking, nesting, new-clone-of-reused-helper, params, placeholder, short-horizon-churn, tangle, verbosity. -A named kind's rows are exactly its rows in a full answer (same code, same bars); the header names the others (kinds_skipped=, skipped_why="selector"), stale acks are judged for the named kinds only, and a pass no named kind needs does not run. An unknown name is refused (exit 1) naming the twelve; refused beside --quality-ack or --quality-baseline and on the bare form (the working-tree form and the MCP quality_delta tool have no selector yet). A selection the changed files cannot answer (whole-tree kinds, with or without defect-shape) is never pre-empted by the memory projection: it runs in full, and only a real memory stop refuses it (exit 5) — so the kinds_next= replay is not degraded again. +A named kind's rows are exactly its rows in a full answer (same code, same bars); the header names the others (kinds_skipped=, skipped_why="selector"), stale acks are judged for the named kinds only, and a pass no named kind needs does not run. An unknown name is refused (exit 1) naming the thirteen; refused beside --quality-ack or --quality-baseline and on the bare form (the working-tree form and the MCP quality_delta tool have no selector yet). A selection the changed files cannot answer (whole-tree kinds, with or without defect-shape) is never pre-empted by the memory projection: it runs in full, and only a real memory stop refuses it (exit 5) — so the kinds_next= replay is not degraded again. **Try it** -_A ref range run for two of the twelve kinds only: the named kinds' rows are exactly their rows in the full answer, the header names the others (kinds_skipped=, skipped_why="selector"), and a pass no named kind needs does not run. The replay a memory-stopped range answer hands back (kinds_next=) is this flag. Refused without --quality-delta=A..B._ +_A ref range run for two of the thirteen kinds only: the named kinds' rows are exactly their rows in the full answer, the header names the others (kinds_skipped=, skipped_why="selector"), and a pass no named kind needs does not run. The replay a memory-stopped range answer hands back (kinds_next=) is this flag. Refused without --quality-delta=A..B._ ``` $ ./build/ripwire . --quality-delta=HEAD~1..HEAD --quality-kinds=complexity,dead-code -. at=: commit+dirty+shallow. available=0: no score at all (dmm=UNAVAILABLE, reason= says why); never read as 1.000 or 0.000. combine=pooled: root dmm= is summed good over summed good+bad of the 3 properties (ripwire's own). low_loc=/low_cx=/low_params=: a unit is LOW risk at or under these lines / cyclomatic / params. base_units=/base_volume=/target_units=/target_volume=: units with a body and their line span per side. reason=: why no score (no unit's size, complexity or params moved; a tree failed to parse ...). --> -

@@ -3098,7 +3104,7 @@ $ ./build/ripwire . --quality-delta --quality-ack --ack-only=zzznope **Answers:** (with --quality-ack) ack only SOME findings — those whose KIND, canonical id or FACET matches (with --quality-ack) ack only SOME findings — those whose KIND, canonical id, or FACET contains one of these; -the pseudo-token 'gating' selects exactly what would exit 2. Bare --quality-ack accepts the WHOLE report, so accepting one deliberate change silently accepts the rest — how a ratchet turns into a rubber stamp. Prefer the facet: --ack-only=contract-change acks the deliberate arity changes WITHOUT the never-gating api-surface new-symbol rows; a defect-shape facet (format-arity, utf8-cut, dedup-first, vacuous-assert) selects that shape alone. Matching nothing refuses (exit 1) rather than falling back to acking everything. Whatever you leave unacked stays visible. +the pseudo-token 'gating' selects exactly what would exit 2. Bare --quality-ack accepts the WHOLE report, so accepting one deliberate change silently accepts the rest — how a ratchet turns into a rubber stamp. Prefer the facet: --ack-only=contract-change acks the deliberate arity changes WITHOUT the never-gating api-surface new-symbol rows; a defect-shape facet (format-arity, utf8-cut, dedup-first, vacuous-assert, unchecked-status, unhandled-arm) selects that shape alone. Matching nothing refuses (exit 1) rather than falling back to acking everything. Whatever you leave unacked stays visible. **Try it** @@ -3129,14 +3135,14 @@ _OWNERSHIP partition for a shared tree: every regression here lives in src/infra ``` $ ./build/ripwire . --quality-delta --scope=src/graph.h - - - - - - - + + + + + + ... [22 more line(s); run it to see the whole thing] ``` @@ -3159,14 +3165,14 @@ _Fast per-symbol post-edit contract check vs git HEAD (unchanged on a clean tree ``` $ ./build/ripwire . --edit-check=rankGraphTeleport - - - - - - - + + + + + + ``` @@ -3209,17 +3215,21 @@ _Insert BEFORE, with --edit-target-file pinning which same-named definition (her ``` $ ./build/ripwire . --insert-before-symbol=nonNegativeFloatDescKey --edit-payload=/aux/payload_note.h --edit-target-file=src/infra/sortutil.h -{"applied":"insert_before_symbol","symbol":"nonNegativeFloatDescKey","file":"src/infra/sortutil.h","span":{"start":3161,"end":3249},"lines":{"start":77,"end":78},"replaced_bytes":0,"old_file_bytes":8855,"new_file_bytes":8943,"file_eol":"lf","eol_normalized":false,"trailing_newline_folded":false,"sep … [line truncated: 753 more bytes on this line] +{"applied":"insert_before_symbol","symbol":"nonNegativeFloatDescKey","file":"src/infra/sortutil.h","span":{"start":3656,"end":3744},"lines":{"start":87,"end":88},"replaced_bytes":0,"old_file_bytes":9350,"new_file_bytes":9438,"file_eol":"lf","eol_normalized":false,"trailing_newline_folded":false,"sep … [line truncated: 753 more bytes on this line] {"n":"benchAdaptive","p":"bench/bench_radix_ab.cpp:157","l":[162]}, -{"n":"radixSortNonNegativeFloatsDesc","p":"src/infra/sortutil.h:108","l":[117]}, -{"n":"radixSortByScoreDescId","p":"src/infra/sortutil.h:123","l":[183]}], -"graph_ambiguous":3646,"graph_unresolved":19925,"graph_unindexed":310,"counts_floor":true},"tests_to_run":[{"p":"test/verify_radix.cpp","hops":1,"run":"bash test/greptiercheck.sh"}, +{"n":"radixSortNonNegativeFloatsDesc","p":"src/infra/sortutil.h:118","l":[127]}, +{"n":"radixSortByScoreDescId","p":"src/infra/sortutil.h:133","l":[193]}], +"graph_ambiguous":3637,"graph_unresolved":20080,"graph_unindexed":311,"counts_floor":true},"tests_to_run":[{"p":"test/verify_radix.cpp","hops":1,"run":"bash test/greptiercheck.sh"}, {"p":"test/adaptivecutshapefix/adaptive_cut_shape_test.cpp","hops":2,"run":"bash test/adaptivecutshapecheck.sh"}, +{"p":"test/connectcore_harness.cpp","hops":2,"run":"bash test/connectcorecheck.sh"}, {"p":"test/forrowfeatures_unit.cpp","hops":2,"run":"bash test/forrowfeaturescheck.sh"}, +{"p":"test/fuzz/readers/readers_domain.cpp","hops":2,"run_unknown":true}, {"p":"test/verify_csr.cpp","hops":2,"run":"bash test/a9disclosurecheck.sh"}, +{"p":"test/cloneband_harness.cpp","hops":3,"run":"bash test/clonebandcheck.sh"}, +{"p":"test/shstatus_harness.cpp","hops":3,"run":"bash test/gateexitcheck.sh"}, +{"p":"test/type3clone_harness.cpp","hops":3,"run":"bash test/type3clonecheck.sh"}, {"p":"test/includeprecise_unit.cpp","hops":4,"run":"bash test/includeprecisecheck.sh"}, -{"p":"test/rustimport_unit.cpp","hops":4,"run":"bash test/rustimportprecisecheck.sh"}], -"order":"evidence","partners":0,"run_first":1,"tests":6,"script_gates_unmodelled":941,"graph_ambiguous":3646,"graph_unresolved":19925,"graph_unindexed":310,"counts_floor":true,"next":"--uses=src/infra/sortutil.h:nonNegativeFloatDescKey"} +... [3 more line(s); run it to see the whole thing] ``` ### `--insert-after-symbol=TARGET` @@ -3234,14 +3244,20 @@ _Insert immediately AFTER one uniquely-resolved definition; replaced_bytes=0 bec ``` $ ./build/ripwire . --insert-after-symbol=lessByScoreDescId --edit-payload=/aux/payload_note.h -{"applied":"insert_after_symbol","symbol":"lessByScoreDescId","file":"src/infra/sortutil.h","span":{"start":2641,"end":2729},"lines":{"start":59,"end":61},"replaced_bytes":0,"old_file_bytes":8679,"new_file_bytes":8767,"file_eol":"lf","eol_normalized":false,"trailing_newline_folded":true,"separator_p … [line truncated: 650 more bytes on this line] -"graph_ambiguous":3646,"graph_unresolved":19925,"graph_unindexed":310,"counts_floor":true},"tests_to_run":[{"p":"test/verify_radix.cpp","hops":1,"run":"bash test/greptiercheck.sh"}, +{"applied":"insert_after_symbol","symbol":"lessByScoreDescId","file":"src/infra/sortutil.h","span":{"start":3136,"end":3224},"lines":{"start":69,"end":71},"replaced_bytes":0,"old_file_bytes":9174,"new_file_bytes":9262,"file_eol":"lf","eol_normalized":false,"trailing_newline_folded":true,"separator_p … [line truncated: 650 more bytes on this line] +"graph_ambiguous":3637,"graph_unresolved":20080,"graph_unindexed":311,"counts_floor":true},"tests_to_run":[{"p":"test/verify_radix.cpp","hops":1,"run":"bash test/greptiercheck.sh"}, {"p":"test/adaptivecutshapefix/adaptive_cut_shape_test.cpp","hops":2,"run":"bash test/adaptivecutshapecheck.sh"}, +{"p":"test/connectcore_harness.cpp","hops":2,"run":"bash test/connectcorecheck.sh"}, {"p":"test/forrowfeatures_unit.cpp","hops":2,"run":"bash test/forrowfeaturescheck.sh"}, +{"p":"test/fuzz/readers/readers_domain.cpp","hops":2,"run_unknown":true}, {"p":"test/verify_csr.cpp","hops":2,"run":"bash test/a9disclosurecheck.sh"}, +{"p":"test/cloneband_harness.cpp","hops":3,"run":"bash test/clonebandcheck.sh"}, +{"p":"test/shstatus_harness.cpp","hops":3,"run":"bash test/gateexitcheck.sh"}, +{"p":"test/type3clone_harness.cpp","hops":3,"run":"bash test/type3clonecheck.sh"}, {"p":"test/includeprecise_unit.cpp","hops":4,"run":"bash test/includeprecisecheck.sh"}, -{"p":"test/rustimport_unit.cpp","hops":4,"run":"bash test/rustimportprecisecheck.sh"}], -"order":"evidence","partners":0,"run_first":1,"tests":6,"script_gates_unmodelled":941,"graph_ambiguous":3646,"graph_unresolved":19925,"graph_unindexed":310,"counts_floor":true,"next":"bash test/greptiercheck.sh"} +{"p":"test/rustimport_unit.cpp","hops":4,"run":"bash test/rustimportprecisecheck.sh"}, +{"p":"test/fuzz/readers/readers_light.cpp","hops":5,"run_unknown":true}], +... [1 more line(s); run it to see the whole thing] ``` **Caveats (stated by the binary):** @@ -3283,17 +3299,21 @@ _Insert BEFORE, with --edit-target-file pinning which same-named definition (her ``` $ ./build/ripwire . --insert-before-symbol=nonNegativeFloatDescKey --edit-payload=/aux/payload_note.h --edit-target-file=src/infra/sortutil.h -{"applied":"insert_before_symbol","symbol":"nonNegativeFloatDescKey","file":"src/infra/sortutil.h","span":{"start":3161,"end":3249},"lines":{"start":77,"end":78},"replaced_bytes":0,"old_file_bytes":8855,"new_file_bytes":8943,"file_eol":"lf","eol_normalized":false,"trailing_newline_folded":false,"sep … [line truncated: 753 more bytes on this line] +{"applied":"insert_before_symbol","symbol":"nonNegativeFloatDescKey","file":"src/infra/sortutil.h","span":{"start":3656,"end":3744},"lines":{"start":87,"end":88},"replaced_bytes":0,"old_file_bytes":9350,"new_file_bytes":9438,"file_eol":"lf","eol_normalized":false,"trailing_newline_folded":false,"sep … [line truncated: 753 more bytes on this line] {"n":"benchAdaptive","p":"bench/bench_radix_ab.cpp:157","l":[162]}, -{"n":"radixSortNonNegativeFloatsDesc","p":"src/infra/sortutil.h:108","l":[117]}, -{"n":"radixSortByScoreDescId","p":"src/infra/sortutil.h:123","l":[183]}], -"graph_ambiguous":3646,"graph_unresolved":19925,"graph_unindexed":310,"counts_floor":true},"tests_to_run":[{"p":"test/verify_radix.cpp","hops":1,"run":"bash test/greptiercheck.sh"}, +{"n":"radixSortNonNegativeFloatsDesc","p":"src/infra/sortutil.h:118","l":[127]}, +{"n":"radixSortByScoreDescId","p":"src/infra/sortutil.h:133","l":[193]}], +"graph_ambiguous":3637,"graph_unresolved":20080,"graph_unindexed":311,"counts_floor":true},"tests_to_run":[{"p":"test/verify_radix.cpp","hops":1,"run":"bash test/greptiercheck.sh"}, {"p":"test/adaptivecutshapefix/adaptive_cut_shape_test.cpp","hops":2,"run":"bash test/adaptivecutshapecheck.sh"}, +{"p":"test/connectcore_harness.cpp","hops":2,"run":"bash test/connectcorecheck.sh"}, {"p":"test/forrowfeatures_unit.cpp","hops":2,"run":"bash test/forrowfeaturescheck.sh"}, +{"p":"test/fuzz/readers/readers_domain.cpp","hops":2,"run_unknown":true}, {"p":"test/verify_csr.cpp","hops":2,"run":"bash test/a9disclosurecheck.sh"}, +{"p":"test/cloneband_harness.cpp","hops":3,"run":"bash test/clonebandcheck.sh"}, +{"p":"test/shstatus_harness.cpp","hops":3,"run":"bash test/gateexitcheck.sh"}, +{"p":"test/type3clone_harness.cpp","hops":3,"run":"bash test/type3clonecheck.sh"}, {"p":"test/includeprecise_unit.cpp","hops":4,"run":"bash test/includeprecisecheck.sh"}, -{"p":"test/rustimport_unit.cpp","hops":4,"run":"bash test/rustimportprecisecheck.sh"}], -"order":"evidence","partners":0,"run_first":1,"tests":6,"script_gates_unmodelled":941,"graph_ambiguous":3646,"graph_unresolved":19925,"graph_unindexed":310,"counts_floor":true,"next":"--uses=src/infra/sortutil.h:nonNegativeFloatDescKey"} +... [3 more line(s); run it to see the whole thing] ``` **Shaped by:** `--insert-after-symbol` @@ -3316,7 +3336,7 @@ _The opt-out: the same insert with the folded verification skipped — lines= st ``` $ ./build/ripwire . --insert-after-symbol=lessByScoreDescId --edit-payload=/aux/payload_note.h --no-post-check -{"applied":"insert_after_symbol","symbol":"lessByScoreDescId","file":"src/infra/sortutil.h","span":{"start":2641,"end":2729},"lines":{"start":59,"end":61},"replaced_bytes":0,"old_file_bytes":8767,"new_file_bytes":8855,"file_eol":"lf","eol_normalized":false,"trailing_newline_folded":true,"separator_p … [line truncated: 570 more bytes on this line] +{"applied":"insert_after_symbol","symbol":"lessByScoreDescId","file":"src/infra/sortutil.h","span":{"start":3136,"end":3224},"lines":{"start":69,"end":71},"replaced_bytes":0,"old_file_bytes":9262,"new_file_bytes":9350,"file_eol":"lf","eol_normalized":false,"trailing_newline_folded":true,"separator_p … [line truncated: 570 more bytes on this line] ``` **Shaped by:** `--edit-target-file` @@ -3352,11 +3372,11 @@ _The same plan committed: per-file locks, re-verify-before-write, atomic rename, ``` $ ./build/ripwire . --edit-plan=/aux/edit_plan.json --apply -{"schema":"ripwire.edit-plan/v1","mode":"apply","edits":1,"files":1,"callers_union":4,"graph_ambiguous":3646,"graph_unresolved":19925,"graph_unindexed":310,"counts_floor":true,"applied":1,"atomic_files":1,"atomic_scope":"per-file","rollback_on_write_error":true,"recheck_before_each_write":true,"mult … [line truncated: 584 more bytes on this line] +{"schema":"ripwire.edit-plan/v1","mode":"apply","edits":1,"files":1,"callers_union":4,"graph_ambiguous":3637,"graph_unresolved":20080,"graph_unindexed":311,"counts_floor":true,"applied":1,"atomic_files":1,"atomic_scope":"per-file","rollback_on_write_error":true,"recheck_before_each_write":true,"mult … [line truncated: 584 more bytes on this line] {"n":"benchAdaptive","p":"bench/bench_radix_ab.cpp:157","l":[162]}, -{"n":"radixSortNonNegativeFloatsDesc","p":"src/infra/sortutil.h:110","l":[119]}, -{"n":"radixSortByScoreDescId","p":"src/infra/sortutil.h:125","l":[185]}], -"graph_ambiguous":3646,"graph_unresolved":19925,"graph_unindexed":310,"counts_floor":true}}]} +{"n":"radixSortNonNegativeFloatsDesc","p":"src/infra/sortutil.h:120","l":[129]}, +{"n":"radixSortByScoreDescId","p":"src/infra/sortutil.h:135","l":[195]}], +"graph_ambiguous":3637,"graph_unresolved":20080,"graph_unindexed":311,"counts_floor":true}}]} ``` **Shaped by:** `--edit-check` @@ -3402,19 +3422,19 @@ _Bare --slice=SYM: the INVENTORY of sliceable locals (), so a calle ``` $ ./build/ripwire . --slice=rankGraphTeleport - - - - - - - - - - - - - + + + + + + + + + + + + + ... [3 more line(s); run it to see the whole thing] ``` @@ -3439,17 +3459,17 @@ _Forward flow: which statements the seed's value reaches, at the default depth b ``` $ ./build/ripwire . --slice=rankGraphTeleport:teleport --slice-flow=fwd - - + + - + teleport( pw.begin(), pw.end() );]]> - + - + ... [22 more line(s); run it to see the whole thing] @@ -3493,10 +3513,10 @@ $ ./build/ripwire . --slice-depth=3 _Hold a LOCATION, not a name: the enclosing-definition chain at FILE:LINE (a compiler error, a diff hunk, a stack frame), outermost -> innermost._ ``` -$ ./build/ripwire . --at=src/graph.h:14281 +$ ./build/ripwire . --at=src/graph.h:14272 - - + + ``` @@ -3520,7 +3540,7 @@ _No-LLM review-evidence bundle for the working-tree diff (clean tree = empty)._ ``` $ ./build/ripwire . --pr-context - ``` @@ -3546,11 +3566,11 @@ _Pairwise cross-arm conflict sites + suggested landing order (any committish sha ``` $ ./build/ripwire . --merge-scout=HEAD~2,HEAD~1 - - + + - + @@ -3625,7 +3645,7 @@ _A second selection, the `fix/` ref family, picked at capture time from the refs ``` $ ./build/ripwire . --stray-content=fix/ - + ``` @@ -3650,19 +3670,19 @@ _Select the genuinely-unmerged refs of the `lane/` ref family and feed them to m ``` $ ./build/ripwire . --stray-content=lane/ --plan - + - - - - + + + + - - + + ... [17 more line(s); run it to see the whole thing] ``` @@ -3686,9 +3706,9 @@ _Cross-branch ABI-break gate over the `lane/` ref family: struct byte-contract d ``` $ ./build/ripwire . --stray-content=lane/ --abi - - + + @@ -3696,7 +3716,7 @@ $ ./build/ripwire . --stray-content=lane/ --abi - + ... [17 more line(s); run it to see the whole thing] @@ -3721,10 +3741,10 @@ _Which ref's tree defines or mentions SYM — HEAD first, then every local branc ``` $ ./build/ripwire . --whereis=rankGraphTeleport - + - + - + + + - + - + @@ -3895,8 +3915,8 @@ _The cache-locality lens over every aggregate: fields READ TOGETHER but declared ``` $ ./build/ripwire . --field-affinity - + @@ -3930,16 +3950,16 @@ _Which of this repo's doc claims are now false. CHANGED: row attribute at= renam ``` $ ./build/ripwire . --doc-drift - + - - - - - - - + + + + + + + ... [20 more line(s); run it to see the whole thing] ``` @@ -3964,16 +3984,16 @@ _Which of this repo's doc claims are now false. CHANGED: row attribute at= renam ``` $ ./build/ripwire . --doc-drift - + - - - - - - - + + + + + + + ... [20 more line(s); run it to see the whole thing] ``` @@ -3997,16 +4017,16 @@ _Same report, with git history splitting stale mentions into deleted-by-commit v ``` $ ./build/ripwire . --doc-drift --with-history - - + + - - - - - - + + + + + + ... [20 more line(s); run it to see the whole thing] ``` @@ -4031,7 +4051,7 @@ _The house PLAN/DESIGN format's STRUCTURE check — never semantics; exit 2 when ``` $ ./build/ripwire . --plan-lint=test/planlintfix/wave.md - + @@ -4066,10 +4086,10 @@ $ ./build/ripwire . --from-trace=- AddressSanitizer:DEADLYSIGNAL ================================================================= ==41337==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000018 (pc 0x000102f4a1c8 bp 0x00016d2f1a40 sp 0x00016d2f19e0 T0) - #0 0x102f4a1c8 in rw::rankGraphTeleport(Graph const&, std::vector const&, float) src/graph.h:14281 - #1 0x102f3e884 in rw::rankGraph(Graph const&, float) src/graph.h:14324 - #2 0x102e11f30 in runDefaultMap(MainDispatch const&) src/main.cpp:1763 - #3 0x102e01a44 in main src/main.cpp:4515 + #0 0x102f4a1c8 in rw::rankGraphTeleport(Graph const&, std::vector const&, float) src/graph.h:14272 + #1 0x102f3e884 in rw::rankGraph(Graph const&, float) src/graph.h:14315 + #2 0x102e11f30 in runDefaultMap(MainDispatch const&) src/main.cpp:1760 + #3 0x102e01a44 in main src/main.cpp:4511 #4 0x1a2b3c0dc in start+0x9dc (dyld:arm64e+0x60dc) ==41337==ABORTING ``` @@ -4096,7 +4116,7 @@ _A command that exits 0: a minimal success record (exit, measured duration, disc $ ./build/ripwire . --run-trace="true" - + ``` @@ -4186,7 +4206,7 @@ _ONE budget-shared bundle: ranking + top bodies + caller sigs + notes + tests_to ``` $ ./build/ripwire . --pack-task="add a new output format flag to the CLI" - + - + Print the authoritative CLI usage and flag catalog to the caller-provided output streaminline void printUsage( std::FILE* out ) noexcept claude's `mcp add … -- ripwire --mcp`: the flag goes on the end of that command line, ahead of its newlineinline std::string wrapCliAddPost( const AgentTarget& row, std::string_view toolsArg ) @@ -4223,13 +4243,13 @@ _Fan-out form: one shared core + 3 per-agent slices carved along call-graph comm ``` $ ./build/ripwire . --pack-task="add a new output format flag to the CLI" --partition=3 - wraps a ; bundle role=core|partition i= symbols= modules= bytes= tokens=: one agent's ctx, symbols= ids assigned, bytes= its size; tokens= = est_tokens= = bytes/2.36 (flat, the densest rate; the inner ctx est_tokens= is language-weighted). Inner ctx task= root= budget_tokens= dropped_positive=: the task, p= base, the slice's token target, ranked candidates its budget cut. of_top=: rows ranked (far) / bodies (callers); s rel=caller|callee shared=: 1-hop edge, bodies reached (absent at 1). window: shown= total= capped= (capped=1 cut). run_unknown=1: no runner derivable (a guess would be worse). est_tokens=: price as emitted (an upper bound under compact). : rank N in this ranking, rows in r= order. : cyclomatic/cognitive complexity. : N callers in the index (absent: not measured). route=: the ranker: name-exact(X) = the task names symbol X (anchors: its evidence), subtoken+body = conceptual BM25 (:broad = 1-2 plain words, plain rg may also win; :declined(...) = a name hit refused as a common name). sc=: enclosing scope; the full id is p::sc::n (p= of the row or its ) and selectors take it. next=: the one pasteable follow-up. pure=1: const/constexpr signature (Swift: non-mutating) and no transitive side effect found; a hint. partitions=/requested=: partitions carved / asked for. modules=/split=: call-graph groups found / cuts forced to split one. core_symbols=/surface=: ids in the shared core / core plus the assignable remainder. budget_per_agent_tokens=: one agent's budget, core_budget_tokens= plus partition_budget_tokens=. total_bytes=N: bytes of all bundles together. overlap_mean=/overlap_max=: pairwise Jaccard over the ids partitions name, before trimming. shared_symbols=/union_symbols=: ids two or more partitions name / ids any partition names. core_overlap=: share of the core surface a partition reaches anyway. layer=: built-in arch layer (game|infra|render|math|audio|ai|test) from a dir name in p=; absent if none. c p=: the file a body callee's l= is in, printed when it is not the b row's own (no p=: the b's file). --> - + - + Print the authoritative CLI usage and flag catalog to the caller-provided output streaminline void printUsage( std::FILE* out ) noexcept claude's `mcp add … -- ripwire --mcp`: the flag goes on the end of that command line, ahead of…inline std::string wrapCliAddPost( const AgentTarget& row, std::string_view toolsArg ) @@ -4256,7 +4276,7 @@ _Task lens + a compact Mermaid flowchart of the top anchors' 1-hop edges._ ``` $ ./build/ripwire . --for="pagerank power iteration" --with-graph - + @@ -4334,14 +4354,14 @@ _Environment self-check: binary staleness, grammars, cache dir, git, tracked-bin ``` $ ./build/ripwire . --doctor - - + - - + + - - + @@ -4368,14 +4388,14 @@ _--doctor plus a LIVE integration inspection for one agent: PATH binary, install ``` $ ./build/ripwire . --doctor --agent=claude - - + - - + + - - + @@ -4404,7 +4424,7 @@ $ ./build/ripwire . --skipped - @@ -4493,10 +4513,10 @@ $ ./build/ripwire . --rank-by=churn --top-k=5 - - + + - + @@ -4524,22 +4544,22 @@ a trailing slash is ignored; absolute paths and '..' are refused). The global block stays byte-identical, a second page follows it — n=/of= are its counts (of= IS the total, so the paging half carries no total=), capped="1" has_more="1" next_offset= offset= limit= page it, and next= replays THIS run's own corpus flags (--since/--exclude) so the page it names is a page of the same answer. The symbol map collapses to a disclosed stub — the map was not asked for and was not ranked at all, which is why the header carries no pr_iters=. merge_bombs_skipped= stays on the global block: it counts the window's skipped commits, not the directory's._ ``` -$ ./build/ripwire . --rank-by=churn-decay --since=HEAD~9 --exclude=test --exclude=docs --exclude=skills --exclude=changelog.d --in=src --limit=3 +$ ./build/ripwire . --rank-by=churn-decay --since=HEAD~4 --exclude=test --exclude=docs --exclude=skills --exclude=changelog.d --in=src --limit=3 - - - - - - - + + + + + + + + + + - - - -... [4 more line(s); run it to see the whole thing] +... [7 more line(s); run it to see the whole thing] ``` **Shaped by:** `--external-surface`, `--doctor`, `--legend`, `--max-memory` @@ -4600,14 +4620,14 @@ _The same gating report under --legend=full — same rows, same exit 2; the defa ``` $ ./build/ripwire . --quality-delta --legend=full - - - - - - - + + + + + + + ... [23 more line(s); run it to see the whole thing] ``` @@ -4631,7 +4651,7 @@ _The session legend dictionary the MCP server serves as ripwire://legend-dict/fu ``` $ ./build/ripwire . --legend-dict -ripwire legend dictionary ripwire.dict/v1 dictv=7138c98f32671fec entries=1167 +ripwire legend dictionary ripwire.dict/v1 dictv=ff6a8ec8438b7fe0 entries=1176 : this LAST child is only the legend pointer; the root keeps every attribute it carries inline, unchanged (schema=, each count, cut and floor); rows follow it; legend="ref": a definition is sent once per session (this dictionary's core, or the first answer that needs … [line truncated: 80 more bytes on this line] schema=ripwire.KEY/v1: the line ripwire.KEY/v1 below reads the answer's rows window: shown= total= capped= has_more= next_offset= offset= limit= page a list (capped=1 cut; next_offset= pastes as offset=) @@ -4696,12 +4716,12 @@ _The family join: per function, which of four orthogonal evidence families fire, ``` $ ./build/ripwire . --ensemble --limit=8 - + - + @@ -4734,14 +4754,14 @@ $ ./build/ripwire . --exclude=present --exclude=bench --top-k=5 - - + + - - + + ... [17 more line(s); run it to see the whole thing] @@ -4765,17 +4785,17 @@ $ ./build/ripwire . --map-diff --top-k=5 - - + + - - + + -... [13 more line(s); run it to see the whole thing] +... [14 more line(s); run it to see the whole thing] ``` **Shaped by:** `--json`, `--limit` @@ -4799,14 +4819,14 @@ $ ./build/ripwire . --cache=/aux/warm2.ripwirecache --top-k=3 - - + + - - + + ... [17 more line(s); run it to see the whole thing] @@ -4849,14 +4869,14 @@ $ ./build/ripwire . --no-cache --top-k=3 - - + + - - + + ... [17 more line(s); run it to see the whole thing] @@ -4880,14 +4900,14 @@ $ ./build/ripwire . --no-ignore --top-k=3 - - + + - - + + ... [17 more line(s); run it to see the whole thing] @@ -4916,7 +4936,7 @@ $ ./build/ripwire . --max-file-size=8K --top-k=3 - + @@ -4996,14 +5016,14 @@ $ ./build/ripwire . --pin-census=/aux/pin_census.tsv --top-k=3 - - + + - - + + ... [17 more line(s); run it to see the whole thing] @@ -5021,7 +5041,7 @@ _initialize + tools/list: the manifest an agent host loads at session start — ``` $ ./build/ripwire '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize"}' '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | ./build/ripwire --mcp -{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-11-25","serverInfo":{"name":"ripwire","version":"0.6.10-dev.99+gb1fdfdb4e"},"capabilities":{"tools":{},"resources":{}},"instructions":"Map before reading files. Start a new task with explore; use from_trace for an error; use impact plus uses … [line truncated: 759 more bytes on this line] +{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-11-25","serverInfo":{"name":"ripwire","version":"0.6.10-dev.130+gb0cb13d8d"},"capabilities":{"tools":{},"resources":{}},"instructions":"Map before reading files. Start a new task with explore; use from_trace for an error; use impact plus uses … [line truncated: 760 more bytes on this line] {"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"analyze","description":"Architecture map for a directory: signatures and the call graph for the top symbols. Use when landing cold in a repo or subdir, before reading files; for a task-scoped inventory use 'for', for one symbol's neighborhood find_ … [line truncated: 742 more bytes on this line] {"name":"rank_by","description":"The SAME architecture map 'analyze' serves, ranked by a different signal instead of plain PageRank. rank_by = pagerank (default, omit it — the CLI's own unbiased --rank-by=pagerank; 'analyze' can rank differently on a tree with uncommitted changes, where it biases … [line truncated: 1077 more bytes on this line] {"name":"find_symbol","description":"A symbol's 1-hop neighborhood: the symbol (with a fetch_body handle) plus direct callers (calledBy) and callees (calls). Full transitive reach: 'impact'. Read/write/import sites, not just calls: 'uses'. JSON {symbol, calledBy, calls, defs, count, hop_tested, hop_ … [line truncated: 1181 more bytes on this line] @@ -5047,11 +5067,11 @@ _--mcp-legend=inline: every answer of the stdio session carries its own legend ( ``` $ ./build/ripwire '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize"}' '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"whereis","arguments":{"path":".","symbol":"rankGraphTeleport"}}}' '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"whereis","arguments":{"path":".","symbol":"computeOnePairOverlap"}}}' | ./build/ripwire --mcp --mcp-legend=inline -{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-11-25","serverInfo":{"name":"ripwire","version":"0.6.10-dev.99+gb1fdfdb4e"},"capabilities":{"tools":{},"resources":{}},"instructions":"Map before reading files. Start a new task with explore; use from_trace for an error; use impact plus uses … [line truncated: 756 more bytes on this line] +{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-11-25","serverInfo":{"name":"ripwire","version":"0.6.10-dev.130+gb0cb13d8d"},"capabilities":{"tools":{},"resources":{}},"instructions":"Map before reading files. Start a new task with explore; use from_trace for an error; use impact plus uses … [line truncated: 757 more bytes on this line] {"jsonrpc":"2.0","id":2,"result":{"content":[{"type":"text","text":" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [759 more display lines; full output is 26013 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --top-k=5` + +*Same map, capped to the 5 highest-ranked symbols.* + +**wall time: 1.38s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [89 more display lines; full output is 10199 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --top-k=5 --no-inventory` + +*The same capped map without its inventory tier: --top-k=5 leaves files out, so the default map appends (program entries, and the files the ranked rows left out) after its rows; --no-inventory drops that tier, and the ranked rows are the same.* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + +````` + +## `./build/ripwire . --top-k=0 --expand=rankGraphTeleport` + +*NEW since the last capture: --top-k=0 means PAYLOAD-ONLY — no ranked map rides along with the body you asked for.* + +**wall time: 1.67s** + +````` + + + + + + + + + + + + +````` + +## `./build/ripwire . --token-budget=100` + +*GATE form: exit 3 if the map's own est_tokens exceeds the budget (over-budget failure shape).* + +**exit code: 3** — **wall time: 2.17s** + +````` + + +````` + +stderr: + +````` +ripwire: --token-budget exceeded: withheld_est_tokens=10482 > budget=100 +````` + +## `./build/ripwire . --for="incremental cache invalidation when a file content hash changes"` + +*The task lens: ranked signatures + quality metrics framed for the task.* + +**wall time: 9.33s** + +````` + + + + +incremental cache (--cache): per-file content hash + raw facts so a re-run re-parses ONLY c…constexpr std::uint32_t kCacheMagic = 0x4b505443 + +and every file whose content hash differs is re-parsed — so a stale or foreign blob self-heals…constexpr std::uint32_t kHeadSnapCacheScheme = 1 +inline McpRebuildBaseline mcpRebuildBaseline( const McpIndex& ix, bool isIncrementalPass ) +inline void noteFactlessMiss( ParsePoolShared& sh, std::size_t fileId, bool nestRefused ) noexcept +inline CachedRecordVerdict probeCachedRecord( const PrewarmMissPass& pass, std::size_t fi, const CachedRecordHead& record, std::string& bytes ) +inline void setTreeKey( Session& s, const std::vector<std::string>& files, std::string_view rootDir, const std::vector<std::uint64_t>& hashes, cons … [line truncated: 20 more bytes on this line] +inline bool ingestCommitTree( const std::string& root, const std::string& sha, const std::vector<std::string>& excludes, std::size_t maxFileBytes, IngestResult& ou … [line truncated: 7 more bytes on this line] +inline constexpr std::uint64_t kFnv1aLegacySeed64 = 1469598103934665603ull + +persistent in-memory index (parse once, reuse across MCP calls) ---- The MCP server is long-live…struct McpIndex +inline const McpIndex& getIndex( const std::string& root ) + + + + + + + + +inline std::uint64_t indexContentHash( const std::vector<std::string>& files, const std::vector<long long>& fileMtime, const std::vector<std::uint64_t> … [line truncated: 25 more bytes on this line] + +struct IngestFileScan + +inline std::uint64_t byteHash( const char* data, std::size_t n ) noexcept +… [217 more display lines; full output is 24497 bytes on 8 raw line(s)] +````` + +## `./build/ripwire . --for="rankGraphTeleport"` + +*Name-shaped query: the router picks name-exact BM25 (header says which/why).* + +**wall time: 6.64s** + +````` + + + + + +PageRank with an explicit teleport / personalization vector p (Σp = 1). The prior is name-quality-biased through biasPrior() so all rank modes share one weighting seam; the transition matrix (edgesinline RankedGraph rankGraphTeleport( const Graph& g, const std::vector<float>&am … [line truncated: 31 more bytes on this line] +#### The convergence disclosure contract +### Wave-2 adversarial verification (2026-08-19) — six probes against `aa97c9e` + + + + + + + + + + + + + + + + + + + + + +& p, float alpha = 0.85f ) +… [28 more display lines; full output is 6611 bytes on 29 raw line(s)] +````` + +## `./build/ripwire . --for="rankGraphTeleport" --no-route` + +*Same query with routing forced OFF (plain subtoken+body BM25) — contrast with the routed run.* + +**wall time: 7.20s** + +````` + + + + + +PageRank with an explicit teleport / personalization vector p (Σp = 1). The prior is name-quali…inline RankedGraph rankGraphTeleport( const Graph& g, const std::vector<float>& p, float alpha = 0.85f ) + +uniform-teleport PageRank (the default). A kRankFlagNotNamed unit (model.h) has no edge and a 0 …inline RankedGraph rankGraph( const Graph& g, float alpha = 0.85f ) + +The default map's PageRank — uniform teleport, the one rank that is a function of the Graph al…inline std::optional<RankedGraph>& storedDefaultRank() noexcept +inline ChurnRanking churnRankedGraph( const MainDispatch& d ) +inline constexpr const char* kChurnRankLegend = "<!-- rank_by=churn: k= is PageRank re-run with the teleport BIASED by git CHANGE-FREQUENCY over window= " "(a c… +struct RankedGraph +inline std::vector<float> takeRank( RankedGraph ranked, RankDisclosure& disclosureOut ) +inline std::vector<float> biasPrior( const Graph& g, const std::vector<float>& p ) +inline std::vector<float> churnTeleportWorkspace( const std::vector<std::string>& rootDirs, const IngestResult& ing, const char* since = "18 months ago … [line truncated: 21 more bytes on this line] +inline ChurnRanking churnDecayRanking( const MainDispatch& d, const rw::SinceScope& sinceScope, bool isScoped, const char* verbLabel ) +PageRankRun pageRankDouble( const sparseCsr<float>& inEdges, std::span<const double> weightedOutDegree, std::span<const double> teleport, std::span<double> rank… +inline std::string rankByText( const std::string& root, std::string_view mode, int topK, bool stable = false ) + + +PageRankRun pageRankDouble( const sparseCsr<float>& inEdges, std::span<const double> weightedOutDegree, std::span<const double> teleport, std::span< … [line truncated: 45 more bytes on this line] +inline std::string didYouMean( const IngestResult& ing, std::string_view name ) + +inline const McpIndex& getIndex( const std::string& root ) + +inline RankedGraph defaultRank( const Graph& g ) +#### The convergence disclosure contract +### Wave-2 adversarial verification (2026-08-19) — six probes against `aa97c9e` + +… [276 more display lines; full output is 30315 bytes on 77 raw line(s)] +````` + +## `./build/ripwire . --for="rankGraphTeleport" --signatures-only` + +*T3 opt-out: the signatures-only lens (no auto bodies, no bundle="auto" attribute) — contrast with the terminal default above.* + +**wall time: 6.92s** + +````` + + + + + +PageRank with an explicit teleport / personalization vector p (Σp = 1). The prior is name-quality-biased through biasPrior() so all rank modes share one weighting seam; the transition matrix (edgesinline RankedGraph rankGraphTeleport( const Graph& g, const std::vector<float>&am … [line truncated: 31 more bytes on this line] +#### The convergence disclosure contract +### Wave-2 adversarial verification (2026-08-19) — six probes against `aa97c9e` + + + + + + + + + + + + + +````` + +## `./build/ripwire . --for="tree-sitter parse of a source file" --adaptive` + +*Cut the result at the relevance cliff (Adaptive-k) — on a flat ranking nothing is cut and the header says so ([adaptive: kept N of N]).* + +**wall time: 7.11s** + +````` + + + + +inline bool topLevelEvidence( std::string_view source, const TSLanguage* language, const Predicate& predicate ) +The crawl's per-file byte ceiling. A text file larger than this is skipped: at this size it is o…constexpr std::size_t kDefaultMaxFileBytes = 4u * 1024u * 1024u +TSTree* parseTree( TSParser* parser, std::string_view src ) + +Exercise every registered grammar and its embedded query, reporting loaded and expected totalsinline DoctorGrammarProbe doctorProbeGrammars() +class SourceReader +constexpr std::array<LangEntry, 58> kLangTable = +struct FileHealth +struct SliceScan +explicit ParsedFile( std::string bytes ) : m_bytes( std::move( bytes ) ) +class ParsedFile + + + +inline RevSide sliceAtRev( const std::string& root, const std::string& sha, const std::string& rel, const Symbol& sym, SliceFam fam, const ::TSLanguage* grammar, st … [line truncated: 77 more bytes on this line] +std::vector<LocalNameFact> collectGatedLocalNames( std::string_view defBytes, std::uint32_t defStartLine, Lang lang ) +inline ModuleScan scanModule( std::string_view source, std::string_view path ) + +inline bool hasMainGuard( std::string_view source ) +inline bool hasPhantomScopeSeparator( TSNode qualified ) noexcept + + + + +inline void runParseWorker( ParsePoolShared& sh, unsigned t ) +… [242 more display lines; full output is 26630 bytes on 44 raw line(s)] +````` + +## `./build/ripwire . --for="why does src/lexical.h chooseForRanker pick name-exact BM25"` + +*Mention anchoring (default-on): a path and a Symbol literally named in the task get lifted; the header says what anchored.* + +**wall time: 6.53s** + +````` + + + + +The name-exact ranker AS THE RETRIEVAL LENS SERVES IT: whole-name BM25 plus the definition-over-…inline std::vector<float> lexicalScoresNameExactRanked( const IngestResult& ing, std::string_view query, const std::vector<float>* symbolScoreMul ) + +P11.12: the interpretive footer for --eval's ranker table, pulled into its own function so the 9…inline void printEvalRankerNote() + +calling agent knows to reformulate rather than trust the ranking. Calibrated empirically (2026-0…inline constexpr float kWeakLexicalScoreThreshold = 1.0f +inline RouteChoice chooseForRanker( const IngestResult& ing, std::string_view query ) +inline int runEvalRetrieval( const IngestResult& ing, const Graph& g ) +inline SubjectRoute chooseSubjectRouteUnchecked( const IngestResult& ing, const Graph& g, std::string_view task, bool servesBodiesAndCallers ) +inline std::string candidatesRootTag( std::size_t keep, std::size_t corpusCount, const CandidateProvenance& prov ) +inline std::vector<float> lexicalScoresNameExactTiered( const IngestResult& ing, std::string_view query, const std::vector<float>* symbolScoreMul ) +struct NameCorpusStats +inline SubjectRoute chooseSubjectRoute( const IngestResult& ing, const Graph& g, std::string_view task, bool servesBodiesAndCallers ) + + +inline int runEvalMined( const std::string& root, const IngestResult& ing, const Graph& g, const std::string& path ) +struct LensRanking +inline bool hasIdentifierShape( std::string_view w ) noexcept +inline int runEvalSkills( const std::string& root, const IngestResult& ing, const Graph& g, const std::string& labelsPath ) +inline std::vector<SourceSyntaxAnchor> applyAnchorHonesty( const IngestResult& ing, std::string_view task, SubjectRoute& out ) + + +inline int runEval( const std::string& root, const IngestResult& ing, const Graph& g, const std::vector<char>& currentDiff ) +inline constexpr int kLexWeightDoc = 2 +inline std::vector<float> lexicalScoresNameExact( const IngestResult& ing, std::string_view query ) +inline void hedgeOffTaskPick( const IngestResult& ing, ExemplarPick& pick ) +… [275 more display lines; full output is 31818 bytes on 18 raw line(s)] +````` + +## `./build/ripwire . --for="why does src/lexical.h chooseForRanker pick name-exact BM25" --no-mention-boost` + +*Same task with the anchor disabled — the contrast the flag exists for.* + +**wall time: 7.45s** + +````` + + + + +The name-exact ranker AS THE RETRIEVAL LENS SERVES IT: whole-name BM25 plus the definition-over-…inline std::vector<float> lexicalScoresNameExactRanked( const IngestResult& ing, std::string_view query, const std::vector<float>* symbolScoreMul ) + +P11.12: the interpretive footer for --eval's ranker table, pulled into its own function so the 9…inline void printEvalRankerNote() +inline int runEvalRetrieval( const IngestResult& ing, const Graph& g ) + +The route the subject reading picks, before the CONFIDENCE-ANCHOR check. `servesBodiesAndCallers…inline SubjectRoute chooseSubjectRouteUnchecked( const IngestResult& ing, const Graph& g, std::string_view task, bool servesBodiesAndCallers ) +inline constexpr float kWeakLexicalScoreThreshold = 1.0f +inline std::string candidatesRootTag( std::size_t keep, std::size_t corpusCount, const CandidateProvenance& prov ) +inline std::vector<float> lexicalScoresNameExactTiered( const IngestResult& ing, std::string_view query, const std::vector<float>* symbolScoreMul ) +struct NameCorpusStats +inline SubjectRoute chooseSubjectRoute( const IngestResult& ing, const Graph& g, std::string_view task, bool servesBodiesAndCallers ) +inline RouteChoice routeAnchorFallThrough( std::string_view query, const RouteChoice& anchored ) +inline int runEvalMined( const std::string& root, const IngestResult& ing, const Graph& g, const std::string& path ) +struct LensRanking +inline bool hasIdentifierShape( std::string_view w ) noexcept +inline int runEvalSkills( const std::string& root, const IngestResult& ing, const Graph& g, const std::string& labelsPath ) +inline std::vector<SourceSyntaxAnchor> applyAnchorHonesty( const IngestResult& ing, std::string_view task, SubjectRoute& out ) + + + +inline RouteChoice chooseForRanker( const IngestResult& ing, std::string_view query ) +inline int runEval( const std::string& root, const IngestResult& ing, const Graph& g, const std::vector<char>& currentDiff ) +inline constexpr int kLexWeightDoc = 2 +inline std::vector<float> lexicalScoresNameExact( const IngestResult& ing, std::string_view query ) +inline void hedgeOffTaskPick( const IngestResult& ing, ExemplarPick& pick ) +… [274 more display lines; full output is 31401 bytes on 18 raw line(s)] +````` + +## `./build/ripwire . --lego=Vehicle` + +*Interface -> implementors view: every existing impl of the named interface; the method contract is extracted for the C-family/Java/TS/Python tiers — for a Rust trait (this fixture) it discloses caveat="not-extracted-for-lang" rather than an empty list.* + +````` + + + + + + + + + +````` + +## `./build/ripwire . --exemplar="format byte sizes for humans"` + +*The repo's best-in-class instance to imitate before writing new code (picked by ROLE).* + +**wall time: 1.04s** + +````` + + + + +ripwire '.' --verify='calls(runDefaultMap, rankGraphTeleport)' + + +````` + +## `./build/ripwire . --help-task="write a cheerful release announcement"` + +*The honest half of the contract: a task with no ripwire-shaped evidence ABSTAINS with zero commands rather than guessing.* + +**wall time: 5.74s** + +````` + + + + +````` + +## `./build/ripwire . --recall="quality delta gating exit codes"` + +*Most relevant DOCS' full bodies (markdown only) — recall what is already written down.* + +````` +ripwire recall — "quality delta gating exit codes" — 139 relevant of 346 document files, best-first — total=139 shown=6 capped=1 truncated=5 generated_demoted=2 generated_demoted_paths="docs/TUNING.md,docs/LIMITS.md" max_tokens=8000 share_bytes=2792 est_tokens=5385 + +━━ docs/REFERENCE_GUIDE.md (relevance 21.975) ━━ [sections: 2 of 12 selected (27 in doc), section-granular; whole doc 43914 B; lines="405-417,418-425"; dropped_by_budget=10] +#### 6.2 Exit codes + +This is the part to wire into a script. + +| Code | Meaning | +| --- | --- | +| 0 | The command completed. | +| 1 | The command refused the request. A refusal names the reason on stderr. When `--callers`, `--callees`, `--uses`, `--impact` or `--path` refuse a selector that matches no indexed definition, they also print an answer on stdout: the verb's element with `found="0"` and the name to retry with. | +| 2 | A policy gate fired: `--arch` found a layering violation, `--scan-skill` found a CRITICAL, `--quality-delta` found new debt. | +| 3 | The output exceeded the token budget that you set. | +| 4 | `--test-gate` found an open obligation. | +| 5 | The memory guard stopped the run: over `--max-memory` (default 65% of the machine's memory) with no partial answer possible, or a verb other than the default map facing a partial index. One stderr line names the limit and the override. | + +#### 6.3 JSON output + +`--json` emits JSON instead of XML, with keys mirroring the XML attribute names one to one. It is an +allow-list: the default map, `--for`, `--pack-task`, `--callers`, `--callees`, `--impact`, +`--quality-delta`, `--test-gate`, `--metrics`, `--flags`, and `--plan-lanes`, which is JSON-native. Every other +verb refuses on stderr with exit 1 rather than silently falling back to XML, so a verb added tomorrow +refuses by default. + + + +━━ CHANGELOG.md (relevance 21.060) ━━ [sections: 1 of 129 selected (611 in doc), section-granular; whole doc 1298822 B; lines="2552-2576"; dropped_by_budget=128] [truncated: 2557 of 3826 bytes] +### Changed — `--quality-delta=A..B` answers the kinds it can under memory pressure, and exits 6 when that answer has no gating row (#387 follow-up) + +A tripped memory guard in the range form used to give exit 5 and nothing, so on a large repository a four-file change +… [141 more lines, 13749 bytes total] +````` + +stderr: + +````` +ripwire: redacted 1 secret from emitted context (keyword-gated-secret=1) — pass --no-redact to disable +````` + +## `./build/ripwire /aux/kbcorpus --recall="field affinity cache line data layout which fields are read together" --top-k=3 --max-tokens=1200` + +*The directory-as-knowledge-base pattern: --recall pointed at a 1560501-byte scratch dir of DUMPED TOOL OUTPUT (a git log, this repo's own generated command reference, --help text, an architecture doc, a fabricated JSON access log) instead of a source repo — no index to build, no daemon.* + +````` +ripwire recall — "field affinity cache line data layout which fields are read together" — 2 relevant of 2 document files, best-first — total=2 shown=1 capped=1 truncated=1 max_tokens=1200 share_bytes=2040 est_tokens=952 + +━━ commands.md (relevance 36.154) ━━ [sections: 1 of 166 selected (196 in doc), section-granular; whole doc 637312 B; lines="567-592"; dropped_by_budget=165] [truncated: 1854 of 4284 bytes] +#### Pattern: a directory of dumped tool output as a knowledge base + +**Answers:** can `--recall` serve as a zero-setup knowledge base over dumped tool output — a +`git log`, an API response dump, a fetched doc, ` --help` text — sitting in a scratch +directory, instead of a source repo? + +Yes, unmodified. `--recall` never distinguishes "a codebase" from any other directory it can +walk: point it at the scratch dir and query it. No index to build, no daemon, no mutable store +between runs — the whole cost is one cold parse. Two conditions decide whether it works at all, +and both are yours, because the file you write is the only thing that sets them: + +1. **Dump to `.md`.** `--recall` ranks DOCUMENT files: `.md`, plus the docparse'd + `.ipynb`/`.html`/`.csv` (and Office/PDF through the optional markitdown bridge). `.txt`, + `.log`, `.json` and extensionless files are **not** documents to it. A directory of those + answers `0 relevant of 0 document files` and exits 0 — which reads like "nothing matched + your terms" when what happened is "nothing was indexed at all". Redirect to `notes.md`, + never `notes.txt`. The recorded run below is that rule's own demonstration: its scratch dir + holds five dumps, and the header says `2 relevant of 2 document files` because only the two + `.md` ones are documents — the `git log`, the `--help` text and the JSON access log are not + in the population at all. + +2. **Keep `##` headings in the dump.** A headed document is served as whole ranked SECTIONS, so + an answer buried mid-file arrives at a small `--max-tokens`, and — while the served document + SET stays fixed — a larger ceiling returns a strict superset of it; the `[sections: S of R + selected (N in doc) … lines="…"; dropped_by_budget=D]` note names the ranges you actually got + and what the ceiling cost. … + +(capped: 1 of 2 relevant document files omitted — raise --max-tokens/budget_tokens or narrow the query for 1 more (~2548-byte budget)) +````` + +stderr: + +````` +ripwire: redacted 1 secret from emitted context (keyword-gated-secret=1) — pass --no-redact to disable +````` + +## `./build/ripwire . --tree` + +*File-by-file orientation map (top symbols per file).* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [365 more display lines; full output is 10973 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --html=/aux/map2.html` + +*Self-contained HTML force-directed call graph.* + +**wall time: 8.53s** + +````` +(empty) +````` + +Artifact written: + +````` + 155369 /aux/map2.html +````` + +## `./build/ripwire . --order=stable --top-k=5` + +*Stable (path/id) emit order — provider KV-cache hits across re-runs.* + +**wall time: 1.85s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [89 more display lines; full output is 10206 bytes on 1 raw line(s)] +````` + + +--- + +# navigate / answer a question + +## `./build/ripwire . --around=rankGraphTeleport` + +*Ego graph around one symbol — depth 1 BY DEFAULT now (the root's depth= says so): ~6 KB where the 2-hop neighbourhood is ~64 KB on this repo.* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [170 more display lines; full output is 8460 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --around=rankGraphTeleport --around-depth=2` + +*The restoring knob: --around-depth=2 brings back the whole 2-hop neighbourhood (depth="2" on the root) — pay for it only when the 1-hop view was not enough.* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [2437 more display lines; full output is 73649 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --around=rankGraphTeleport --around-fanout=4` + +*The other knob: --around-fanout=4 keeps only the 4 strongest edges per node (default 32) — the same 1-hop depth, a quarter of the rows.* + +**wall time: 1.68s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [14 more display lines; full output is 4254 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --callers=rankGraphTeleport` + +*Who calls SYM (1-hop in-edges).* + +**wall time: 1.24s** + +````` + + + + + + + + + + +````` + +## `./build/ripwire . --callers=rankGraphTeleport --legend=full` + +*The same rows under --legend=full: the default is the compact dialect (one compact comment plus schema="ripwire.callers/v1" on the root), and --legend=full restores the prose legend — every row byte and every completeness attribute (counts_floor=, graph_ambiguous=, next=) identical, ~3 KB more legend. Works on EVERY XML verb.* + +````` + + + + + + + + + + + +````` + +## `./build/ripwire . --callers=DoesNotExist` + +*Unknown-symbol REFUSAL shape (exit 1) with a did-you-mean from real edit distance.* + +**exit code: 1** — **wall time: 4.14s** + +````` + + +````` + +stderr: + +````` +ripwire: --callers symbol not found: DoesNotExist (note: the lexical definition scan stopped at its budget, 4096 files or 16 MiB, before reading every file, so this miss is not proof the bytes define nothing; --grep=DoesNotExist lists its text uses) +````` + +## `./build/ripwire . --callees=rankGraphTeleport` + +*What SYM calls (1-hop out-edges).* + +````` + + + + + + + + + + + + + + +````` + +## `./build/ripwire . --uses=rankGraphTeleport` + +*The resolvable use-sites (call/read/write/import/extends) with file:line; count= is a floor.* + +````` + + + + + + + + + + + + +````` + +## `./build/ripwire . --graph-query='and(callers(name("rankGraphTeleport"),2),kind(all,fn))'` + +*Composable node-set query: functions within 2 caller-hops of rankGraphTeleport.* + +**wall time: 1.91s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [32 more display lines; full output is 3884 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --external-surface` + +*Names referenced but never defined in-corpus (stdlib/third-party surface). The root carries names/shown/capped; the default is a 100-row window now, so total= and a pasteable next= join them when it bites (the explicit --limit form carries the same quintet). The sh BUILTINS (cd/echo/set…) are dropped and COUNTED as builtins_excluded= — grep/sed/git stay, they ARE the surface.* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [73 more display lines; full output is 5636 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --external-surface --include-builtins` + +*The restoring knob: --include-builtins keeps the shell builtins in the same 100-row window (they now compete for rows, so the window's tail differs).* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [73 more display lines; full output is 5512 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --path=main,rankGraphTeleport` + +*Shortest directed call-path SRC -> DST. CHANGED: now reports from_p/to_p/from_defs and resolves the right `main` (was reachable="0").* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + +````` + +## `./build/ripwire . --defs=main,rankGraphTeleport` + +*Which definitions each name binds, one row per definition group with sel= (the spelling that picks it alone in any verb), class=source|test and in= callers; source first.* + +**wall time: 1.02s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + +````` + +## `./build/ripwire . --connect=rankGraphTeleport,runEval,getIndex` + +*Minimal connecting subgraph over 3 symbols (finds shared-caller joins).* + +**wall time: 1.48s** + +````` + + + + + + + + + + +````` + +## `./build/ripwire . --impact=rankGraphTeleport` + +*Transitive blast radius — everything that reaches SYM. NOW carries shown/capped.* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [73 more display lines; full output is 7439 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --mentions=rankGraphTeleport` + +*Markdown docs that name SYM in a backtick (doc<->code edges).* + +````` + + + + + + + + + + +````` + +## `./build/ripwire . --affected=src/graph.h` + +*Test files that transitively reach the changed file.* + +**wall time: 1.87s** + +````` + + + + + + + + + + + + + +````` + +## `./build/ripwire . --situ` + +*Mid-task situational report for the current git diff — recorded against a CLEAN tree (contrast with the sandbox run below).* + +**wall time: 5.59s** + +````` +ripwire situational-awareness — 0 changed file(s), 0 symbols in them +root: . +at: b0cb13d8d + (0 changed files — working tree is clean, nothing to analyze) +````` + +## `./build/ripwire . --test-gate` + +*Pre-PR gate on a CLEAN tree: no obligations, exit 0.* + +**wall time: 11.20s** + +````` + + +````` + +## `./build/ripwire . --grep=DISCLOSE` + +*Literal trigram-indexed search. Each hit carries its MATCHED line as the element's own CDATA (the wrapper is gone), plus shown/capped/hits_capped and a pasteable next= on the root.* + +**wall time: 1.07s** + +````` + +if data.get( "schema" ) != SCHEMA: raise SystemExit( f"{path}: unexpected schema {data.get('schema')!r} (expecte +if not str( data.get( "tasks_lock_content_sha256", "" ) ).startswith( "questions:" ): train_repos = select_tasks +if train_repos: raise SystemExit( f"{path}: records from repo(s) that re-derive to LocBench +if base and ctx and base["status"] == "ok" and ctx["status"] == "ok": paired.append( ( instance_id, base["re +if not repos: return 0.0, [] +if base["localization_hit"] is None or ctx["localization_hit"] is None: return 0.0 +if bv: ratios.append( cv / bv - 1 ) +if not ratios: return None, None +if rw is None or native is None: return None +if not paired: out["note"] = "zero complete paired (baseline,ripwire_cli) runs — nothing to analyze yet" +if contaminated: print( f" ** {contaminated} baseline run(s) invoked ripwire despite the no-ripwire contract " +if "note" in out: print( f" {out['note']}" ); return +if out["n_pairs"] != 27: failures.append( f"expected 27 paired runs, got {out['n_pairs']}" ) +if out["n_incomplete"] != 2: failures.append( f"expected 2 incomplete pairs (the orphan + the contaminated-basel +if out["n_repos"] != 3: failures.append( f"expected 3 repos, got {out['n_repos']}" ) +if out.get( "n_contaminated_baseline" ) != 1: failures.append( f"expected exactly 1 contaminated baseline run co +if not ( out["resolved_delta_mean"] > 0 ): failures.append( "expected a positive resolved-rate delta" ) +if not ( out["resolved_delta_bootstrap_95_lower"] > 0 ): failures.append( "expected a POSITIVE bootstrap 95% low +if out["tokens_out_ratio_p50"] is None or abs( out["tokens_out_ratio_p50"] - 0.08 ) > 1e-6: failures.append( f"e +if out.get( "n_resolved_pairs" ) != 27: failures.append( f"expected all 27 pairs resolution-scored, got {out.get +if out.get( "substitution_rate_baseline" ) != 0.0: failures.append( f"expected baseline substitution rate 0.0 (n +if out.get( "substitution_rate_ripwire" ) is None or abs( out["substitution_rate_ripwire"] - 0.75 ) > 1e-9: fail +if out.get( "n_substitution_ripwire" ) != 27: failures.append( f"expected 27 substitution-scored ripwire runs, g +if out3.get( "substitution_rate_ripwire" ) is not None or out3.get( "n_substitution_ripwire" ) != 0: failures.ap +if out2["n_pairs"] != 27: failures.append( f"evaluator-none: expected 27 pairs, got {out2['n_pairs']}" ) +if out2["n_resolved_pairs"] != 0: failures.append( f"evaluator-none: expected 0 resolution-scored pairs, got {ou +if out2["resolved_delta_mean"] is not None or out2["resolved_delta_bootstrap_95_lower"] is not None: failures.ap +if out2["tokens_out_ratio_p50"] is None or abs( out2["tokens_out_ratio_p50"] - 0.08 ) > 1e-6: failures.append( " +… [73 more display lines; full output is 17045 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --match='(if_statement) @i'` + +*The same shape query WITH an explicit capture — identical hits, no auto_captured= attribute.* + +**wall time: 2.42s** + +````` + +if data.get( "schema" ) != SCHEMA: raise SystemExit( f"{path}: unexpected schema {data.get('schema')!r} (expecte +if not str( data.get( "tasks_lock_content_sha256", "" ) ).startswith( "questions:" ): train_repos = select_tasks +if train_repos: raise SystemExit( f"{path}: records from repo(s) that re-derive to LocBench +if base and ctx and base["status"] == "ok" and ctx["status"] == "ok": paired.append( ( instance_id, base["re +if not repos: return 0.0, [] +if base["localization_hit"] is None or ctx["localization_hit"] is None: return 0.0 +if bv: ratios.append( cv / bv - 1 ) +if not ratios: return None, None +if rw is None or native is None: return None +if not paired: out["note"] = "zero complete paired (baseline,ripwire_cli) runs — nothing to analyze yet" +if contaminated: print( f" ** {contaminated} baseline run(s) invoked ripwire despite the no-ripwire contract " +if "note" in out: print( f" {out['note']}" ); return +if out["n_pairs"] != 27: failures.append( f"expected 27 paired runs, got {out['n_pairs']}" ) +if out["n_incomplete"] != 2: failures.append( f"expected 2 incomplete pairs (the orphan + the contaminated-basel +if out["n_repos"] != 3: failures.append( f"expected 3 repos, got {out['n_repos']}" ) +if out.get( "n_contaminated_baseline" ) != 1: failures.append( f"expected exactly 1 contaminated baseline run co +if not ( out["resolved_delta_mean"] > 0 ): failures.append( "expected a positive resolved-rate delta" ) +if not ( out["resolved_delta_bootstrap_95_lower"] > 0 ): failures.append( "expected a POSITIVE bootstrap 95% low +if out["tokens_out_ratio_p50"] is None or abs( out["tokens_out_ratio_p50"] - 0.08 ) > 1e-6: failures.append( f"e +if out.get( "n_resolved_pairs" ) != 27: failures.append( f"expected all 27 pairs resolution-scored, got {out.get +if out.get( "substitution_rate_baseline" ) != 0.0: failures.append( f"expected baseline substitution rate 0.0 (n +if out.get( "substitution_rate_ripwire" ) is None or abs( out["substitution_rate_ripwire"] - 0.75 ) > 1e-9: fail +if out.get( "n_substitution_ripwire" ) != 27: failures.append( f"expected 27 substitution-scored ripwire runs, g +if out3.get( "substitution_rate_ripwire" ) is not None or out3.get( "n_substitution_ripwire" ) != 0: failures.ap +if out2["n_pairs"] != 27: failures.append( f"evaluator-none: expected 27 pairs, got {out2['n_pairs']}" ) +if out2["n_resolved_pairs"] != 0: failures.append( f"evaluator-none: expected 0 resolution-scored pairs, got {ou +if out2["resolved_delta_mean"] is not None or out2["resolved_delta_bootstrap_95_lower"] is not None: failures.ap +if out2["tokens_out_ratio_p50"] is None or abs( out2["tokens_out_ratio_p50"] - 0.08 ) > 1e-6: failures.append( " +… [73 more display lines; full output is 16929 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --query="teleport pagerank" --top-k=5` + +*Raw BM25 ranking (debug lens; --for is the real verb).* + +**wall time: 2.51s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [23 more display lines; full output is 3783 bytes on 1 raw line(s)] +````` + + +--- + +# zoom the detail ladder + +## `./build/ripwire . --for="pagerank power iteration" --detail=2` + +*Importance-weighted detail: FULL bodies for top-2, signatures for the rest.* + +**wall time: 8.04s** + +````` + + + + + +NodeId order. Renumbering an otherwise-identical graph (the exact "same probe file, different so…inline constexpr float kScoreTieAbsEps = 1e-6f + +What a ranked document discloses about the power iteration that ordered it. `isPageRank == false…struct RankDisclosure + +The PageRank power iteration itself — the numeric kernel every ranked document's order comes f…PageRankRun pageRankDouble( const sparseCsr<float>& inEdges, std::span<const double> weightedOutDegree, std::span<const double> teleport, std::span<double> r … [line truncated: 10 more bytes on this line] +inline std::string rankByText( const std::string& root, std::string_view mode, int topK, bool stable = false ) +struct RankedGraph +inline constexpr const char* kChurnRankLegend = "<!-- rank_by=churn: k= is PageRank re-run with the teleport BIASED by git CHANGE-FREQUENCY over window= " "(a c… +inline std::uint32_t sliceRdIterationCeiling() noexcept +struct PageRankRun + +Render one form of the disclosure. Empty string whenever there is nothing to say — no power it…inline std::string renderDisclosure( const RankDisclosure& d, DiscloseAs as ) +inline std::uint32_t navRelevanceWeight( const Graph& g, NodeId n ) noexcept +inline RankedGraph rankGraphTeleport( const Graph& g, const std::vector<float>& p, float alpha = 0.85f ) +inline constexpr std::string_view kPowerShellPathPrependScope = "in PowerShell, for this window + + +inline std::string path_prepend_hint( std::string_view dir ) + +HOT_FILES = ( "src/pagerank.cpp", # the power-iteration loop — G2's no-allocation scope "src/infra/radixSort.h", # LSD radix entry points "src/infra/radixSort.inl", # the counting … [line truncated: 76 more bytes on this line] +handle_t leftmost_leaf() const +inline std::string doctorPathPrependLine( const std::string& selfPath ) + + + +… [130 more display lines; full output is 19059 bytes on 6 raw line(s)] +````` + +## `./build/ripwire . --pack-signatures --top-k=10` + +*Body-elided decl skeletons — recounted on this corpus. Measured as element bytes: the signature+doc elements --pack-signatures emits, against the SAME symbols' full bodies from --expand, with the CORPUS-ROOT PREFIX SUBTRACTED FROM BOTH SIDES. That subtraction is the whole methodology and the figure is meaningless without it: the root repeats inside every element's id= and p=, it is not what this verb elides, and counting it makes the headline a function of how deep the checkout happens to sit on disk — on one corpus, three spellings of the same root read 18.6 points apart before the subtraction and agree exactly after it. Root-neutralised on THIS repo: 89.7% fewer bytes at top-10, 88.0% at top-50, 87.8% at top-100 (re-derived 2026-10-10 when the C++ standard-member gate stopped std::vector/std::string calls such as out.push_back() and s.empty() from binding to in-tree namesakes by name: the ranked top-10/50 lost one-line container accessors (svector::push_back, WidePath::c_str, every empty) and gained one-line forwarding helpers and macros (kindIs, ASSUME, formatTo, emitTo) whose signature is nearly the whole body, so less of the set is elidable, from 92.7/88.7/87.6; before that, re-derived 2026-09-20 when the native Windows port landed: src/infra/os_win32.cpp and os_win32_logic.h are ~3,900 lines of new, heavily commented infra that the ranked top-10/50/100 now reach, and their bodies are this ratio's DENOMINATOR, so the figure rises without --pack-signatures eliding anything new, from top-50 87.1. Measured by test/showcasecapturecheck.sh's own recount arm on the combined tree, which is the gate that would otherwise report the drift; before that, re-derived 2026-09-17 at the self-check macro vocabulary rename: VERIFY/VERIFY_TEXT/VERIFY_DEBUG_ONLY/VERIFY_NOT_REACHED/VERIFY_SAME_THREAD/VERIFY_NO_ALIAS*/DYNMAP_VERIFY/DEGRADED_PATH_ALERT renamed to ASSUME/EXPECTS/ENSURES/DASSERT/UNREACHABLE/ASSUME_SAME_THREAD*/ASSUME_NO_ALIAS*/DYNMAP_ASSUME/DISCLOSE (plus new VALIDATE sites) across 839 identifier renames in 179 files, and a hand-written Diagnostics.h/diagnostics.cpp replacing the old ones outright: this moves both WHICH symbols the ranked top-10/50/100 hold and how large their bodies are, from top-50 85.2. A real re-derivation of a corpus that changed, not a tolerance edit; previously re-derived 2026-09-12 when the rows dropped the path-repeating id= for the short sc= scope: the signature side shrank, the bodies did not; before that, 89.5% / 81.8% / 84.3% re-derived 2026-09-10 at the sibs= cap raise: kMaxExpandSibs went 8 -> 100, so --expand's bodies now carry the file context the old cap hid — 89.3% of all sibling names — and the body side is this ratio's DENOMINATOR, so the figure rises without --pack-signatures eliding anything new. Measured on a fixed tree with the top-50 membership and the signature side unchanged: top-50 from 71.0. A real re-derivation of a corpus that changed, not a tolerance edit; previously re-derived 2026-09-09 at the printf-family -> std::print conversion: converting ~1,500 emitter call sites to rw::emitTo/emitRaw/formatTo across 93 files changes how large the ranked symbols' BODIES are, and the body side is this ratio's denominator — top-50 from 72.3. A real re-derivation of a corpus that changed, not a tolerance edit; previously re-derived 2026-09-08 at the confident-zero round, issues #62/#63/#66: that change adds symbols to src/graphlegend.h and the new src/preprocdead.h and re-homes two long comment blocks from call sites onto the helpers they explain, which moves both WHICH symbols the ranked top-50 holds and how large their bodies are — top-50 from 74.0. A real re-derivation of a corpus that changed, not a tolerance edit; previously re-derived 2026-09-06 at the stranger-audit fix round: the doctor, cache-sweep and html-provenance bodies grew this corpus's BODY side, moving top-50 from 75.6 — a real re-derivation, not a tolerance edit; before that, re-derived 2026-09-05 at the capture-audit close: lane L7's P16 caps --expand's sibs= at 8 names, which SHRINKS the body side of this ratio and moved the figure down from 84.5/80.2/80.6 — the V1 2026-08-15 re-center, when sibs=/inc= first grew the body side from 70.0/61.0/63.8, in reverse; both were real re-derivations, not tolerance edits). top-50 is the number to quote, because the sigs payload is top-50 regardless of --top-k and is therefore what THIS command emits. A single small/trivial body can still invert it (signature+doc bigger than the body), like the --format=columnar sibling below. test/showcasecapturecheck.sh (C) re-derives all three from this repo every run, in the same quantity, and fails if the caption and the recount drift apart.* + +**wall time: 1.90s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [143 more display lines; full output is 14928 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --outline=rankGraphTeleport --top-k=0` + +*Control-flow skeleton of one symbol, payload-only via the new --top-k=0.* + +````` + + + + +& p, float alpha = 0.85f ) +{ + PROFILE_SCOPE_DESCRIBE( "rankGraph: PageRank (power iteration)" ); + const std::vector pw = biasPrior( g, p ); + const std::size_t N = pw.size(); + std::vector teleport( pw.begin(), pw.end() ); + std::vector rankDouble( N, 0.0 ); + PageRankRun run{}; // an N == 0 graph never enters the kernel: { 0, converged } — see PageRankRun + if( N ) + { + ... + } + std::vector r( N, 0.f ); + std::transform( rankDouble.begin(), rankDouble.end(), r.begin(), []( double value ) { return float( value ); } ); + return { std::move( r ), run.iterationCount, run.hasConverged }; +} +]]> +````` + +## `./build/ripwire . --outline=rankGraphTeleport:1-10 --top-k=0` + +*CHANGED: a line range on --outline is now STRIPPED with a stderr note (it used to refuse).* + +````` + + + + +& p, float alpha = 0.85f ) +{ + PROFILE_SCOPE_DESCRIBE( "rankGraph: PageRank (power iteration)" ); + const std::vector pw = biasPrior( g, p ); + const std::size_t N = pw.size(); + std::vector teleport( pw.begin(), pw.end() ); + std::vector rankDouble( N, 0.0 ); + PageRankRun run{}; // an N == 0 graph never enters the kernel: { 0, converged } — see PageRankRun + if( N ) + { + ... + } + std::vector r( N, 0.f ); + std::transform( rankDouble.begin(), rankDouble.end(), r.begin(), []( double value ) { return float( value ); } ); + return { std::move( r ), run.iterationCount, run.hasConverged }; +} +]]> +````` + +stderr: + +````` +ripwire: --outline=rankGraphTeleport:1-10: --outline has no line-range form — outlining the whole symbol (use --expand=rankGraphTeleport:1-10 for a body slice) +````` + +## `./build/ripwire . --expand=rankGraphTeleport --top-k=0` + +*Full body + inline callee signatures.* + +**wall time: 1.25s** + +````` + + + + +: files the ranked rows show / do not (sum = files=), each named or counted below. : a program entry by its language's convention (C/Go/Rust main, Java/C# static main, a script main its module scope calls, __main__.py), callees as c rows; manifest entries not read. : n= unshown files under dir p=; f= names its code files, the rest (tests, docs, config, test/doc/example dirs) counted. declined=K: K call sites without edges, including inert Elixir quote sites after unquote/unquote_splicing re-entry. external=K: K calls proven outside the tree, no edge. locality_pinned=K: K calls pinned by locality alone (a guess). extent_suspect_syms=K: K defs failed containment, corpus-wide. macro_blanked_files=K: K files indexed from a macro-blanked re-parse. prov=scip|binding|import|split|final-segment: how that edge bound (absent: one unique name); split = one arm of an amb= pick; final-segment = a qualified type matched by last name only. files=/symbols=: files and symbols indexed; edges= distinct call edges; shown= symbols printed, a merged row counting each def; ambiguous= calls split over several defs, corpus-wide; unresolved= calls with in-tree evidence and no edge (every def language-filtered or unreachable, or binding refused); order= rows by rank (important-first, important-last; (auto:fill) = flipped past a size threshold) or by path (stable). skipped_oversize=K: K files over a size ceiling, not indexed. unindexed=ext:N: N text files of that extension no grammar reads (6 extensions at most). unindexed_exts=E: E such extensions in all, the list cut. : a non-test row an indexed test transitively reaches (absent otherwise, never 0). : that callee matched by name alone (receiver unproven); it does NOT mean the edge is false. sc=: enclosing scope; the full id is p::sc::n (p= of the row or its ) and selectors take it. amb=K: K calls split over several defs. locals_floor=1: locals= is a floor. role=hub: in= is 8 or more. s in= out= cx= ccx= loc= params= nest= cbo= lcom4= amp=: callers, callees, cyclomatic/cognitive complexity, lines, parameters, nesting depth, coupled types, class cohesion, callers + co-changed files. ev=/ev_why=: essential complexity (2+: jumps block extract-method; absent: 1) / the jumps behind it, tag:count. ev_floor=1: ev= is a FLOOR; noreturn calls, macro-hidden exits and unresolved gotos are unseen. layer=: built-in arch layer (game|infra|render|math|audio|ai|test) from a dir name in p=; absent if none. l=N: start line; only on a same-name overload's row, one row per body (bodyless decls fold into overloads=). f p=: a file; s t= n=: kind, name; c n=: a resolved callee. s k=: rank. --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [108 more display lines; full output is 12764 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --deps` + +*File->file dependency graph (god-files, cycles).* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [913 more display lines; full output is 26182 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --hotspots` + +*Complexity x recent git churn (maintenance pain).* + +**wall time: 10.47s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [14 more display lines; full output is 5824 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --clones` + +*Token-normalized duplicate bodies.* + +**wall time: 2.58s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [309 more display lines; full output is 16373 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --cochange` + +*Files that change together in git (hidden coupling).* + +**wall time: 8.57s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +````` + +## `./build/ripwire . --hotspots --since="2 weeks ago"` + +*Hotspots scoped to RECENT churn (the regression lens).* + +**wall time: 11.08s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [13 more display lines; full output is 5179 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --arch=test/archfix/rules.txt` + +*Enforce layering rules (exit 2 on violation) — run against the repo's own test fixture rules.* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [1380 more display lines; full output is 192589 bytes on 1 raw line(s)] +````` + +stderr: + +````` +ripwire arch: 407 file(s) in go,swift,java,cs,php,dart,kt,gd,clj: this build resolves almost none of their imports to files, so an edge through one was mostly never judged: violations= is a floor +````` + +## `./build/ripwire . --lint` + +*Built-in AST checks (c-cast, goto, unsafe-c-fn, ...).* + +**wall time: 5.12s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [679 more display lines; full output is 70957 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --lint-rules=test/lintrulesfix/rules` + +*User lint rules (YAML, ast-grep style) from a directory.* + +**wall time: 2.29s** + +````` + + + + +use LOG() instead of printf +use LOG() instead of printf +use LOG() instead of printf +use LOG() instead of printf +use LOG() instead of printf + +````` + +stderr: + +````` +ripwire: lint-rules: test/lintrulesfix/rules/malformed.yaml:5: expected 'key: value' — file skipped +[math degraded] lint-rules: malformed rule file skipped (lintrules.h:494, auto rw::parseLintRuleFile(const std::string &, std::string_view, std::vector &)::(anonymous class)::operator()(std::size_t, const char *) const — logged once per site) +ripwire: AST query did not compile for any grammar: (this_is_not_a_real_node @x @@@ ((( ) +````` + +## `./build/ripwire . --lint --with-profile=report.txt` + +*Join MEASURED heat onto --lint findings — runs in a tiny fabricated demo corpus (one cache-pointer-chase-loop finding under a PROFILE_SCOPE site) because a real report needs a RIPWIRE_PROFILE build; the finding inside the profiled scope gains heat_* columns from the report's #PROF_TSV row.* + +**wall time: 1.12s** + +Input file: + +````` +#PROF_TSV_BEGIN one row per scope, aggregated across threads; counters are RAW integers +scope file line calls total_ms l1d_mpki +walk: chase pass x.cpp 9 12 48.500 7.250 +#PROF_TSV_END +````` + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [13 more display lines; full output is 3428 bytes on 1 raw line(s)] +````` + +The joined finding — past the display cut above, extracted so the join is visible: + +````` +p = p->next +````` + +## `./build/ripwire . --communities` + +*Cluster the call graph into cohesive modules.* + +**wall time: 1.28s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [190 more display lines; full output is 16651 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --zoom` + +*Nested module hierarchy (multi-level Louvain) + cross-module bridges — shown_levels="2" of levels= BY DEFAULT over the 40 largest top modules (~8 KB, where the whole tree is ~220 KB); a module AT the cut carries children=.* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [139 more display lines; full output is 7687 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --zoom --zoom-levels=3` + +*The restoring knob: --zoom-levels=N prints N levels (0 = the whole tree); here three, ~11 KB.* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [319 more display lines; full output is 14364 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --report` + +*Architecture summary (modules, god-files, cycles) as markdown.* + +````` + + +# ripwire architecture report + +4779 files · 44046 symbols · 43830 edges · 5053 modules (20765 call-graph isolated) + +Root: `.` + +Call-graph isolate provenance: 5724 declaration, 3481 header, 4519 source, 7041 document; 0 connected Louvain singletons + +## Modules (call-graph clusters; showing 12 of 5053) +- **src::emitTo@infra/emit.h:53:2760 [write,run,emit]** — 1880 symbols +- **src::kindIs@infra/nodekind.h:46:3271 [push,emit,read]** — 697 symbols +- **src::DISCLOSE@infra/Diagnostics.h:622:43913 [read,check,collect]** — 252 symbols +- **docs::`--top-k=N`@COMMANDS.md:59:9303 [pack,allow,insert]** — 185 symbols +- **src::str@infra/internedtext.h:323:16987 [resolve,write,find]** — 160 symbols +- **test/ownerhopfix/py/pkg::big_handler_001@broadcast.py:3:72** — 106 symbols +- **src/infra::fail@os_win32.cpp:63:2553 [open,get,close]** — 103 symbols +- **src::text@ingest_valuerefs.h:804:41690 [emit,open,mark]** — 91 symbols +- **src::sortUnique@infra/sortutil.h:55:2725 [connect,compute,collect]** — 87 symbols +- **src::tokIs@defectshape.h:170:8137 [scan,match,run]** — 83 symbols +- **src::unq@shstatus.h:164:6384 [visit,call,bind]** — 76 symbols +- **src::shSingleQuote@infra/shquote.h:19:960 [resolve,run,read]** — 75 symbols + +Not measured: 407 files in go,swift,java,cs,php,dart,kt,gd,clj (imports almost never resolved to files), so the god files and cycles below cover the resolved edges only. + +## God files (most depended-on; showing 10 of 310) +- `src/model.h` — 143 dependents +- `src/infra/emit.h` — 101 dependents +- `src/infra/sortutil.h` — 88 dependents +… [38 more lines, 4354 bytes total] +````` + +## `./build/ripwire . --seams` + +*Cross-module call seams no test reaches. NOW carries seam_pairs/shown/capped.* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [90 more display lines; full output is 12759 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --mermaid` + +*Module (directory) dependency graph as a Mermaid diagram.* + +**wall time: 1.23s** + +````` +%% ripwire --mermaid: module (directory) dependency graph — node = dir (symbol count), edge = inter-module calls (>= 3). Render at mermaid.live. +flowchart LR + subgraph sg0 ["src"] + n105["src
14596"] + n106["src/infra
1684"] + end + subgraph sg1 ["test"] + n107["test
6966"] + n750["test/legochargefix
546"] + n472["test/fixtures/recallpassage
314"] + n491["test/fnslotcpp2
285"] + n913["test/lib
253"] + n712["test/ifacepeelfix/cpp
206"] + n1252["test/slotjoinfix
182"] + n1017["test/ownerhopfix/py/pkg
158"] + n408["test/expandmodefix
151"] + n410["test/expandsibsfix
149"] + n1222["test/rubyschemafix
99"] + n527["test/forbodyfoldfix/py
98"] + end + n77["docs
1265"] + subgraph sg3 ["bench"] + n63["bench/sectionfront
1033"] + n4["bench
558"] + n5["bench/agentloop
331"] + n50["bench/locbench/results/r5_pooling
237"] + n51["bench/locbench/results/r6_expansion
187"] + n60["bench/recalleval
113"] + n44["bench/locbench
107"] + n38["bench/headtohead/r3-headroom-2026-08-03
102"] +… [23 more lines, 1626 bytes total] +````` + +## `./build/ripwire . --owners` + +*Bus-factor: recency-weighted author ownership per file.* + +**wall time: 7.36s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [1060 more display lines; full output is 118617 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --dead-code=src` + +*Internal functions with no caller found in the index — a name-based graph reading, not a confidence score. NOTE the filter is a path-COMPONENT match: 'src' matches any .../src/... segment; use ./src to pin the root directory.* + +**wall time: 2.69s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [61 more display lines; full output is 16552 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --exercises=test/regression.sh` + +*Which symbols a TEST FILE exercises — the reverse direction of --affected.* + +**wall time: 1.20s** + +````` + + + +````` + +## `./build/ripwire . --community=0` + +*Drill into ONE call-graph community by id — the drill= the --communities output itself advertises.* + +````` + + + +````` + +## `./build/ripwire . --quality-delta` + +*The regression-free answer on a clone whose ledger holds stale acknowledgements (its HEAD's own history plus one demo row keyed to a finding that no longer measures as worse): the verdict-only document, every stale row collapsed to stale= and stale_by_kind=, with stale_next= naming the call below. Recorded in a throwaway clean clone so the contrast is structural — not a race with the release checkout's drift — and every regeneration on every machine sees the same pair.* + +**wall time: 54.98s** + +````` + + +````` + +stderr: + +````` +ripwire: no ./.ripwire_quality_baseline — auto-comparing the working tree vs git HEAD (commit the baseline with --quality-baseline to pin it) +````` + +## `./build/ripwire . --quality-delta --show-stale` + +*The same run, the same clone, the folded rows printed back: each stale acknowledgement as an row under the full header — the demo row included, and no quarter of the bytes saved by silence. Refused without --quality-delta.* + +**wall time: 39.51s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [167 more display lines; full output is 18592 bytes on 1 raw line(s)] +````` + +stderr: + +````` +ripwire: no ./.ripwire_quality_baseline — auto-comparing the working tree vs git HEAD (commit the baseline with --quality-baseline to pin it) +````` + +## `./build/ripwire . --edit-check=rankGraphTeleport` + +*Fast per-symbol post-edit contract check vs git HEAD (unchanged on a clean tree).* + +**wall time: 25.94s** + +````` + + + + + + + + + +````` + +stderr: + +````` +ripwire: cache : over its 2048 MiB budget — evicted 139 blob(s) of other roots or other ripwire builds (this build's blobs for this root are kept) +````` + +## `./build/ripwire . --pr-context` + +*No-LLM review-evidence bundle for the working-tree diff (clean tree = empty).* + +**wall time: 4.07s** + +````` + + + +````` + +## `./build/ripwire . --pr-context=HEAD~1` + +*The BASEREF form: diffed against merge-base(BASEREF, HEAD), never the ref tip — here the previous commit on the current line (a ref with NO merge base falls back to a disclosed two-dot diff: anchor="ref-tip-two-dot").* + +**wall time: 9.71s** + +````` + + + + +````` + +## `./build/ripwire . --merge-scout=HEAD~2,HEAD~1` + +*Pairwise cross-arm conflict sites + suggested landing order (any committish sharing a merge base with HEAD works as an arm; one that does not is reported ok="0", never compared).* + +**wall time: 33.54s** + +````` + + + + + + + + + + + +````` + +## `./build/ripwire . --stray-content=lane/` + +*Which refs of the `lane/` ref family still hold divergent authored work vs HEAD, with verdicts.* + +**wall time: 14.72s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [855 more display lines; full output is 97265 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --stray-content=fix/` + +*A second selection, the `fix/` ref family, picked at capture time from the refs this checkout really has and never the selection above: merged refs are OMITTED from the rows and counted in merged=; refs sharing no merge base with HEAD (a shallow clone, or a pre-rewrite history) land in unknown= with ok="0" — the counters always reconcile against refs=.* + +**wall time: 9.43s** + +````` + + + +````` + +## `./build/ripwire . --stray-content=lane/ --plan` + +*Select the genuinely-unmerged refs of the `lane/` ref family and feed them to merge-scout for a landing order (a fully merged selection yields an empty landing set — still a measurement, disclosed on the root).* + +**wall time: 50.18s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [282 more display lines; full output is 30962 bytes on 1 raw line(s)] +````` + +stderr: + +````` +ripwire: warning: --plan scouted 1 of 66 unmerged branches for conflicts and landing order (limit: 12 arms, and 8192 indexed files across the arms); pass --detail=1 to scout every unmerged branch +````` + +## `./build/ripwire . --stray-content=zzzz-no-such-ref --plan` + +*A --plan filter that selects NO ref REFUSES (exit 1) naming the substring — before the wave-3 close this fell through to the '>512 refs match' sentence, and --abi under the same filter answered an empty measurement at exit 0.* + +**exit code: 1** — **wall time: 10.37s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --plan: --stray-content=zzzz-no-such-ref matches no local ref — a zero here would be a failure, not a measurement + (the filter is a substring match against refs/heads names; run bare --stray-content to list them, e.g. --stray-content=feat/) +````` + +## `./build/ripwire . --stray-content=lane/ --abi` + +*Cross-branch ABI-break gate over the `lane/` ref family: struct byte-contract drift on each ref's AUTHORED paths — exit 2 when any drift row is found (the only kind that gates), 0 when the compared refs are clean, and exit 1 if the --stray-content filter matches no ref at all.* + +**exit code: 2** — **wall time: 56.42s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [565 more display lines; full output is 43815 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --whereis=rankGraphTeleport` + +*Which ref's tree defines or mentions SYM — HEAD first, then every local branch. The default lists the kind="def" rows (here the first 60, most on branches, each carrying tip= and date=) and counts the references in : on this symbol HEAD's references would fill the 60-row cap before the branch definitions arrive, so the whole list (below) shows fewer definitions, and the default serves the page that shows more of them, whatever its bytes.* + +**wall time: 30.23s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [36 more display lines; full output is 13459 bytes on 1 raw line(s)] +````` + +stderr: + +````` +ripwire: warning: --whereis read the newest 378 of 639 local branches; 261 older were not read (limit: 2097152 tree entries across all refs, 379 refs with HEAD at this tree's size); pass --detail=1 to read every branch, or narrow the branches with a ref-name filter +ripwire: warning: --whereis left 407 branch blobs unparsed, their rows kind=text (limit: 256 blobs or 64 MB per answer); pass --detail=1 to parse every one +````` + +## `./build/ripwire . --whereis=rankGraphTeleport --whereis-listing=all` + +*The whole hit list asked for by name: under the same 60-row cap HEAD's references fill the list, so it shows far fewer definitions (here HEAD's one) than the default above (here 60). The default serves the all page only when it shows the same definitions as the defs page in strictly fewer bytes (a tie serves it too).* + +**wall time: 25.16s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [36 more display lines; full output is 13481 bytes on 1 raw line(s)] +````` + +stderr: + +````` +ripwire: warning: --whereis read the newest 378 of 639 local branches; 261 older were not read (limit: 2097152 tree entries across all refs, 379 refs with HEAD at this tree's size); pass --detail=1 to read every branch, or narrow the branches with a ref-name filter +ripwire: warning: --whereis left 407 branch blobs unparsed, their rows kind=text (limit: 256 blobs or 64 MB per answer); pass --detail=1 to parse every one +````` + +## `./build/ripwire . --quality-delta=HEAD~1..HEAD --quality-kinds=complexity,dead-code` + +*A ref range run for two of the thirteen kinds only: the named kinds' rows are exactly their rows in the full answer, the header names the others (kinds_skipped=, skipped_why="selector"), and a pass no named kind needs does not run. The replay a memory-stopped range answer hands back (kinds_next=) is this flag. Refused without --quality-delta=A..B.* + +**wall time: 33.24s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [35 more display lines; full output is 13988 bytes on 1 raw line(s)] +````` + +stderr: + +````` +ripwire: warning: --whereis read the newest 378 of 639 local branches; 261 older were not read (limit: 2097152 tree entries across all refs, 379 refs with HEAD at this tree's size); pass --detail=1 to read every branch, or narrow the branches with a ref-name filter +ripwire: warning: --whereis left 407 branch blobs unparsed, their rows kind=text (limit: 256 blobs or 64 MB per answer); pass --detail=1 to parse every one +````` + +## `./build/ripwire . --whereis=computeOnePairOverlap --with-history` + +*Same, plus a git-history row (never / removed-by-commit) for names no tree carries.* + +**wall time: 41.75s** + +````` + + + + + + + +````` + +stderr: + +````` +ripwire: warning: --whereis read the newest 378 of 639 local branches; 261 older were not read (limit: 2097152 tree entries across all refs, 379 refs with HEAD at this tree's size); pass --detail=1 to read every branch, or narrow the branches with a ref-name filter +````` + +## `./build/ripwire . --flags` + +*The dark-content dashboard: gates BUILT but OFF. CHANGED: no longer invents gates from comments/heredocs, so the count only reflects real ifndef/define, CMake option(), and getenv gates.* + +**wall time: 2.02s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [2400 more display lines; full output is 151078 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --flags --flip=RIPWIRE_ASAN` + +*Blast radius of turning ONE gate on: live code, symbols, transitive reach, covering tests.* + +**wall time: 2.05s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +````` + +## `./build/ripwire . --flags --flip=RIPWIRE_ASA` + +*Unknown-gate refusal (exit 1) with a did-you-mean from a real edit distance (one character off RIPWIRE_ASAN).* + +**exit code: 1** — **wall time: 1.71s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --flip: no gate named 'RIPWIRE_ASA' in . (did you mean 'RIPWIRE_ASAN', 'RIPWIRE_ASAN_BIN', 'RIPWIRE_ASAN_PROBE_SEC', 'RIPWIRE_ASAN_PROBE_WHY'?) +ripwire: run `ripwire . --flags` for the gate table +````` + +## `./build/ripwire . --plan-lanes=3 --task="add a --since filter to the doc-drift verb and cover it with tests"` + +*NEW VERB: pre-hoc lane plan — which of 3 parallel worktrees would COLLIDE, before a line is written. JSON on stdout.* + +**wall time: 4.70s** + +````` +{"v":1,"verb":"plan-lanes","at":"b0cb13d8d","root":".","task":"add a --since filter to the doc-drift verb and cover it with tests","source":"partition","requested":3,"lane_count":3,"claim_key":"path+scope+name","on_conflict":"producing-lane-rebases","corpus":{"files":4779,"symbols":44046,"edges":438 … [line truncated: 338 more bytes on this line] +"symbols":[{"p":"./src/docdrift.h","n":"DriftResult","scope":"DriftResult","l":286,"id":"./src/docdrift.h::DriftResult::DriftResult"}, +{"p":"./src/docdrift.h","n":"computeDocDrift","scope":"docdrift","l":2441,"id":"./src/docdrift.h::docdrift::computeDocDrift"}, +{"p":"./src/docdrift.h","n":"kDocDriftLegend","scope":"docdrift","l":2739,"id":"./src/docdrift.h::docdrift::kDocDriftLegend"}, +{"p":"./src/docdrift.h","n":"writeDocDriftPage","scope":"docdrift","l":2909,"id":"./src/docdrift.h::docdrift::writeDocDriftPage"}, +{"p":"./src/mcpverbs.h","n":"docDriftText","scope":"rw","l":689,"id":"./src/mcpverbs.h::rw::docDriftText"}, +{"p":"./src/verbs_change.h","n":"runDocDrift","scope":"","l":1687,"id":null}]},"lanes":[{"id":"lane-0","task":"add a --since filter to the doc-drift verb and cover it with tests","claims":{"symbols":[{"p":"./src/editcheck.h","n":"editCheckPriceRoot","scope":"rw","key":"33219bb04158a6a8","id":"./src/ … [line truncated: 158 more bytes on this line] +{"p":"./src/docdrift.h","n":"writeGateability","scope":"docdrift","key":"42c456dfb55faee4","id":"./src/docdrift.h::docdrift::writeGateability","id_addressable":true,"id_collides_with":0,"l":2685,"ord":0,"overloads":1,"amb":2,"cx":6,"ccx":6,"churn":37,"tested":0}, +{"p":"./src/darkflags.h","n":"writeFlags","scope":"darkflags","key":"5c2c4a2b311b8dba","id":"./src/darkflags.h::darkflags::writeFlags","id_addressable":true,"id_collides_with":0,"l":3199,"ord":0,"overloads":1,"amb":1,"cx":9,"ccx":8,"churn":48,"tested":0}, +{"p":"./src/docdrift.h","n":"docDriftNextAttr","scope":"docdrift","key":"7723ed789a1c9c09","id":"./src/docdrift.h::docdrift::docDriftNextAttr","id_addressable":true,"id_collides_with":0,"l":2864,"ord":0,"overloads":1,"amb":0,"cx":6,"ccx":5,"churn":37,"tested":0}, +{"p":"./src/docdrift.h","n":"writeWeakDisclosures","scope":"docdrift","key":"7d760d428aab46d1","id":"./src/docdrift.h::docdrift::writeWeakDisclosures","id_addressable":true,"id_collides_with":0,"l":2839,"ord":0,"overloads":1,"amb":2,"cx":4,"ccx":5,"churn":37,"tested":0}, +{"p":"./src/docdrift.h","n":"recordWeakDisclosures","scope":"docdrift","key":"972779210e49c0cf","id":"./src/docdrift.h::docdrift::recordWeakDisclosures","id_addressable":true,"id_collides_with":0,"l":2430,"ord":0,"overloads":1,"amb":0,"cx":2,"ccx":1,"churn":37,"tested":0}, +{"p":"./src/testmap.h","n":"scriptGatesUnmodelledCount","scope":"rw","key":"98c4487e2e9e08bc","id":"./src/testmap.h::rw::scriptGatesUnmodelledCount","id_addressable":true,"id_collides_with":0,"l":2016,"ord":0,"overloads":1,"amb":0,"cx":4,"ccx":4,"churn":77,"tested":0}, +{"p":"./src/main.cpp","n":"scanReportVerbPrecedence","scope":"","key":"9ab981e987e8108e","id":null,"id_addressable":false,"id_collides_with":0,"l":3038,"ord":0,"overloads":1,"amb":0,"cx":8,"ccx":11,"churn":509,"tested":0}, +{"p":"./src/graphlegend.h","n":"impactTestedPartitionLegend","scope":"rw","key":"9ca0ff23a3b8620e","id":"./src/graphlegend.h::rw::impactTestedPartitionLegend","id_addressable":true,"id_collides_with":0,"l":567,"ord":0,"overloads":1,"amb":0,"cx":4,"ccx":4,"churn":241,"tested":0}, +{"p":"./src/pageview.h","n":"secondaryCutAttrs","scope":"rw","key":"a10ea8d3bdca1dfb","id":"./src/pageview.h::rw::secondaryCutAttrs","id_addressable":true,"id_collides_with":0,"l":404,"ord":0,"overloads":1,"amb":0,"cx":3,"ccx":2,"churn":29,"tested":0}, +{"p":"./src/main.cpp","n":"emitNoteAddUnprovenDefs","scope":"","key":"a950332ccfce6b8d","id":null,"id_addressable":false,"id_collides_with":0,"l":695,"ord":0,"overloads":1,"amb":1,"cx":2,"ccx":1,"churn":509,"tested":0}, +{"p":"./src/docdrift.h","n":"sortDocsByLiveDrift","scope":"docdrift","key":"d5de682411b9a9a9","id":"./src/docdrift.h::docdrift::sortDocsByLiveDrift","id_addressable":true,"id_collides_with":0,"l":2390,"ord":0,"overloads":1,"amb":0,"cx":2,"ccx":2,"churn":37,"tested":0}, +{"p":"./src/mcpverbs.h","n":"unknownSubVerbRefusal","scope":"rw","key":"e336d39b0a6addea","id":"./src/mcpverbs.h::rw::unknownSubVerbRefusal","id_addressable":true,"id_collides_with":0,"l":6305,"ord":0,"overloads":1,"amb":0,"cx":3,"ccx":2,"churn":673,"tested":0}], +"files":[{"p":"./src/darkflags.h","symbols":1,"churn":48,"ccx":8,"hotspot_rank":31}, +{"p":"./src/docdrift.h","symbols":5,"churn":37,"ccx":19,"hotspot_rank":51}, +{"p":"./src/editcheck.h","symbols":1,"churn":70,"ccx":10,"hotspot_rank":53}, +{"p":"./src/graphlegend.h","symbols":1,"churn":241,"ccx":4,"hotspot_rank":34}, +{"p":"./src/main.cpp","symbols":2,"churn":509,"ccx":12,"hotspot_rank":5}, +{"p":"./src/mcpverbs.h","symbols":1,"churn":673,"ccx":2,"hotspot_rank":4}, +{"p":"./src/pageview.h","symbols":1,"churn":29,"ccx":2,"hotspot_rank":173}, +{"p":"./src/testmap.h","symbols":1,"churn":77,"ccx":4,"hotspot_rank":36}]},"blast_radius":{"reaches":52,"files_total":17,"capped":false,"files":["./src/darkflags.h","./src/docdrift.h","./src/editcheck.h","./src/editplan.h","./src/editpreview.h","./src/flipimpact.h","./src/main.cpp","./src/mcp.h","./ … [line truncated: 202 more bytes on this line] +"tests_total":0,"tests_capped":false,"tests_granularity":"claimed-symbols","untested":52,"module_span":1,"notes":[], +"execution":{"policy":"codex-lane/v1","model":"gpt-5.6-sol","reasoning":"high","rule":"complex-or-wide","basis":"structural-only","signals":{"claims":13,"files":8,"module_span":1,"max_ccx":11,"sum_ccx":61,"ambiguous_calls":6,"blast_reaches":52,"contract_touches":0,"conflicts":0,"untested":52,"tests_ … [line truncated: 134 more bytes on this line] +{"id":"lane-1","task":"add a --since filter to the doc-drift verb and cover it with tests","claims":{"symbols":[{"p":"./src/taskroute.h","n":"classifyRoutesUncapped","scope":"rw::taskroute","key":"0c5e6053e914484d","id":"./src/taskroute.h::rw::taskroute::classifyRoutesUncapped","id_addressable":true … [line truncated: 101 more bytes on this line] +… [71 more display lines; full output is 20762 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --plan-lanes --brief=/aux/lanes_brief.txt` + +*NEW VERB, explicit form: one line per lane, lane boundaries are the ones you wrote (the defensible mode).* + +**wall time: 9.60s** + +Input file: + +````` +add a --since filter to the doc-drift verb +add the CLI parse arm and help text for the new filter +write regression tests for the new filter +````` + +````` +{"v":1,"verb":"plan-lanes","at":"b0cb13d8d","root":".","task":null,"source":"brief","requested":3,"lane_count":3,"claim_key":"path+scope+name","on_conflict":"producing-lane-rebases","corpus":{"files":4779,"symbols":44046,"edges":43830,"ambiguous":3637,"unresolved":20080},"carve":null,"core":{"files" … [line truncated: 4 more bytes on this line] +"symbols":[]},"lanes":[{"id":"lane-0","task":"add a --since filter to the doc-drift verb","claims":{"symbols":[{"p":"./src/docdrift.h","n":"recordUnchecked","scope":"docdrift","key":"12641dab14abc8fd","id":"./src/docdrift.h::docdrift::recordUnchecked","id_addressable":true,"id_collides_with":0,"l":2 … [line truncated: 72 more bytes on this line] +{"p":"./src/docdrift.h","n":"sortWeakGroupsByPath","scope":"docdrift","key":"1944ba506280ff80","id":"./src/docdrift.h::docdrift::sortWeakGroupsByPath","id_addressable":true,"id_collides_with":0,"l":2401,"ord":0,"overloads":1,"amb":0,"cx":1,"ccx":0,"churn":37,"tested":0}, +{"p":"./src/mcpverbs.h","n":"docDriftText","scope":"rw","key":"1fa68e8d93c05a59","id":"./src/mcpverbs.h::rw::docDriftText","id_addressable":true,"id_collides_with":0,"l":689,"ord":0,"overloads":1,"amb":0,"cx":1,"ccx":0,"churn":673,"tested":0}, +{"p":"./src/recall.h","n":"docFileMask","scope":"rw","key":"3149a219f599664c","id":"./src/recall.h::rw::docFileMask","id_addressable":true,"id_collides_with":0,"l":113,"ord":0,"overloads":1,"amb":0,"cx":4,"ccx":4,"churn":49,"tested":0}, +{"p":"./src/docdrift.h","n":"writeDocDriftPage","scope":"docdrift","key":"380b7de5df1cfd73","id":"./src/docdrift.h::docdrift::writeDocDriftPage","id_addressable":true,"id_collides_with":0,"l":2909,"ord":0,"overloads":1,"amb":10,"cx":14,"ccx":15,"churn":37,"tested":0}, +{"p":"./src/docdrift.h","n":"computeDocDrift","scope":"docdrift","key":"3b19cc3d8996c3b2","id":"./src/docdrift.h::docdrift::computeDocDrift","id_addressable":true,"id_collides_with":0,"l":2441,"ord":0,"overloads":1,"amb":1,"cx":26,"ccx":38,"churn":37,"tested":0}, +{"p":"./src/docdrift.h","n":"DriftResult","scope":"DriftResult","key":"422ab39546b6e0bd","id":"./src/docdrift.h::DriftResult::DriftResult","id_addressable":true,"id_collides_with":0,"l":286,"ord":0,"overloads":1,"amb":0,"cx":0,"ccx":0,"churn":37,"tested":0}, +{"p":"./src/docdrift.h","n":"writeGateability","scope":"docdrift","key":"42c456dfb55faee4","id":"./src/docdrift.h::docdrift::writeGateability","id_addressable":true,"id_collides_with":0,"l":2685,"ord":0,"overloads":1,"amb":2,"cx":6,"ccx":6,"churn":37,"tested":0}, +{"p":"./src/verbs_change.h","n":"runDocDrift","scope":"","key":"904831e5c0f66b39","id":null,"id_addressable":false,"id_collides_with":0,"l":1687,"ord":0,"overloads":1,"amb":1,"cx":5,"ccx":4,"churn":91,"tested":0}, +{"p":"./src/ensemble.h","n":"kEnsembleChurnSince","scope":"ensemble","key":"a34fc78c05bf56a8","id":"./src/ensemble.h::ensemble::kEnsembleChurnSince","id_addressable":true,"id_collides_with":0,"l":121,"ord":0,"overloads":1,"amb":0,"cx":0,"ccx":0,"churn":24,"tested":0}, +{"p":"./src/mcpverbs.h","n":"unknownSubVerbRefusal","scope":"rw","key":"e336d39b0a6addea","id":"./src/mcpverbs.h::rw::unknownSubVerbRefusal","id_addressable":true,"id_collides_with":0,"l":6305,"ord":0,"overloads":1,"amb":0,"cx":3,"ccx":2,"churn":673,"tested":0}, +{"p":"./src/docdrift.h","n":"kDocDriftLegend","scope":"docdrift","key":"ff2ba74637bbbebf","id":"./src/docdrift.h::docdrift::kDocDriftLegend","id_addressable":true,"id_collides_with":0,"l":2739,"ord":0,"overloads":1,"amb":0,"cx":0,"ccx":0,"churn":37,"tested":0}], +"files":[{"p":"./src/docdrift.h","symbols":7,"churn":37,"ccx":60,"hotspot_rank":51}, +{"p":"./src/ensemble.h","symbols":1,"churn":24,"ccx":0,"hotspot_rank":131}, +{"p":"./src/mcpverbs.h","symbols":2,"churn":673,"ccx":2,"hotspot_rank":4}, +{"p":"./src/recall.h","symbols":1,"churn":49,"ccx":4,"hotspot_rank":48}, +{"p":"./src/verbs_change.h","symbols":1,"churn":91,"ccx":4,"hotspot_rank":35}], +"symbols_total":4253,"symbols_capped":true},"blast_radius":{"reaches":27,"files_total":8,"capped":false,"files":["./src/docdrift.h","./src/fordocbody.h","./src/main.cpp","./src/mcp.h","./src/mcpserver.h","./src/mcpverbs.h","./src/recall.h","./src/verbs_for.h"]},"tests_to_run":[], +"tests_total":0,"tests_capped":false,"tests_granularity":"claimed-symbols","untested":27,"module_span":5,"notes":[], +"execution":{"policy":"codex-lane/v1","model":"gpt-5.6-sol","reasoning":"xhigh","rule":"wide-contract-work","basis":"structural-only","signals":{"claims":12,"files":5,"module_span":5,"max_ccx":38,"sum_ccx":70,"ambiguous_calls":14,"blast_reaches":27,"contract_touches":1,"conflicts":0,"untested":27,"t … [line truncated: 139 more bytes on this line] +{"id":"lane-1","task":"add the CLI parse arm and help text for the new filter","claims":{"symbols":[{"p":"./scripts/optremarks.py","n":"main","scope":"","key":"01b3b880f77d1512","id":null,"id_addressable":false,"id_collides_with":188,"l":285,"ord":0,"overloads":1,"amb":0,"cx":23,"ccx":31,"churn":18, … [line truncated: 12 more bytes on this line] +{"p":"./scripts/merge_resolve.py","n":"main","scope":"","key":"0618162fab697309","id":null,"id_addressable":false,"id_collides_with":188,"l":208,"ord":0,"overloads":1,"amb":0,"cx":17,"ccx":34,"churn":4,"tested":0}, +{"p":"./src/cli.h","n":"HelpLine","scope":"rw","key":"1489844dbc310b82","id":"./src/cli.h::rw::HelpLine","id_addressable":true,"id_collides_with":0,"l":3144,"ord":0,"overloads":1,"amb":0,"cx":0,"ccx":0,"churn":648,"tested":0}, +{"p":"./src/cli.h","n":"HelpFilter","scope":"HelpFilter","key":"3103a5e8bfc33d38","id":"./src/cli.h::HelpFilter::HelpFilter","id_addressable":true,"id_collides_with":0,"l":3223,"ord":0,"overloads":1,"amb":0,"cx":0,"ccx":0,"churn":648,"tested":0}, +{"p":"./docs/docs_commands_build.py","n":"main","scope":"","key":"4015853681ded3bc","id":null,"id_addressable":false,"id_collides_with":188,"l":900,"ord":0,"overloads":1,"amb":0,"cx":19,"ccx":28,"churn":19,"tested":0}, +{"p":"./src/mcprefusal.h","n":"kMcpValueFields","scope":"rw::mcprefuse","key":"4a7106e488a2aa80","id":"./src/mcprefusal.h::rw::mcprefuse::kMcpValueFields","id_addressable":true,"id_collides_with":0,"l":304,"ord":0,"overloads":1,"amb":0,"cx":0,"ccx":0,"churn":51,"tested":0}, +{"p":"./src/query.h","n":"tryParsePredicateOnAll","scope":"query","key":"786acc4dbfec612b","id":"./src/query.h::query::tryParsePredicateOnAll","id_addressable":false,"id_collides_with":1,"l":114,"ord":0,"overloads":2,"amb":0,"cx":1,"ccx":0,"churn":22,"tested":0}, +{"p":"./src/cli.h","n":"printUsageTier","scope":"rw","key":"82b7af67acdca479","id":"./src/cli.h::rw::printUsageTier","id_addressable":true,"id_collides_with":0,"l":3274,"ord":0,"overloads":1,"amb":0,"cx":2,"ccx":1,"churn":648,"tested":0}, +{"p":"./src/crossref.h","n":"writeWhereisTextCut","scope":"crossref","key":"9a3ef6403f53ce21","id":"./src/crossref.h::crossref::writeWhereisTextCut","id_addressable":true,"id_collides_with":0,"l":5162,"ord":0,"overloads":1,"amb":1,"cx":3,"ccx":3,"churn":110,"tested":0}, +… [59 more display lines; full output is 18377 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --plan-lanes=99 --task=x` + +*Out-of-range refusal shape for the lane count.* + +**exit code: 1** — **wall time: 1.48s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --plan-lanes=99 is out of range — N must be 2..16 (1 is not a fan-out) +````` + +## `./build/ripwire . --layout=Symbol` + +*CPU/GPU contract view of one struct: computed offsets/sizes/padding + mirror check.* + +**wall time: 1.50s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + +… [262 more display lines; full output is 25845 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --doc-drift --gateability` + +*The finishable to-do list: docs whose LIVE failing anchors a date-stamp would reclassify.* + +**wall time: 3.02s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [293 more display lines; full output is 27272 bytes on 1 raw line(s)] +````` + +Tail of the same output — the `` section: + +````` + + + + + + + + + + + + + + + + + + + + + + + + + +````` + +## `./build/ripwire . --doc-drift --with-history` + +*Same report, with git history splitting stale mentions into deleted-by-commit vs never-existed.* + +**wall time: 5.50s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [238 more display lines; full output is 25895 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --from-trace=-` + +*Map a pasted stack trace onto indexed symbols. CHANGED: in_corpus= now reports the real count (was 0).* + +Input file: + +````` +AddressSanitizer:DEADLYSIGNAL +================================================================= +==41337==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000018 (pc 0x000102f4a1c8 bp 0x00016d2f1a40 sp 0x00016d2f19e0 T0) + #0 0x102f4a1c8 in rw::rankGraphTeleport(Graph const&, std::vector const&, float) src/graph.h:14272 + #1 0x102f3e884 in rw::rankGraph(Graph const&, float) src/graph.h:14315 + #2 0x102e11f30 in runDefaultMap(MainDispatch const&) src/main.cpp:1760 + #3 0x102e01a44 in main src/main.cpp:4511 + #4 0x1a2b3c0dc in start+0x9dc (dyld:arm64e+0x60dc) +==41337==ABORTING +````` + +````` + + + + + + + + + + + +PageRank with an explicit teleport / personalization vector p (Σp = 1). The prior is name-quality-biased through biasPrior() so all rank modes share one weighting seam; the transition matrix (edgesinline RankedGraph rankGraphTeleport( const Graph& g, const std::vector<float>&am … [line truncated: 31 more bytes on this line] + +uniform-teleport PageRank (the default). A kRankFlagNotNamed unit (model.h) has no edge and a 0 prior weight, so the uniform share is over the ranked nodes: every other node's teleport is the value itinline RankedGraph rankGraph( const Graph& g, float alpha = 0.85f ) +int runDefaultMap( const MainDispatch& d ) +int main( int argc, char** argv ) + + + +& p, float alpha = 0.85f ) +{ + PROFILE_SCOPE_DESCRIBE( "rankGraph: PageRank (power iteration)" ); + const std::vector pw = biasPrior( g, p ); + const std::size_t N = pw.size(); + std::vector teleport( pw.begin(), pw.end() ); + std::vector rankDouble( N, 0.0 ); + PageRankRun run{}; // an N == 0 graph never enters the kernel: { 0, converged } — see PageRankRun + if( N ) + { + double teleportMass = 0.0; +… [18 more display lines; full output is 5279 bytes on 29 raw line(s)] +````` + +## `./build/ripwire . --notes` + +*List all field notes (write-side memory) — the committed .ripwire_notes at the repo root, each with the sha/branch it was recorded at.* + +````` + + + + + + + + + + + gate scripts' claim (~line 1305) is NOT enforced — the derived-vs-stated sibling loop here covers docs/EVALS.md only. It drifted 407→451 unnoticed (fixed 2026-08-23). To close: grep both files ('file:line:' parsing) in the gateCountClaims arm.]]> + + + + +````` + +## `./build/ripwire . --pack-task="add a new output format flag to the CLI"` + +*ONE budget-shared bundle: ranking + top bodies + caller sigs + notes + tests_to_run. CHANGED: rows now carry n=/id=.* + +**wall time: 3.18s** + +````` + + + + +Print the authoritative CLI usage and flag catalog to the caller-provided output streaminline void printUsage( std::FILE* out ) noexcept + +claude's `mcp add … -- ripwire --mcp`: the flag goes on the end of that command line, ahead of its newlineinline std::string wrapCliAddPost( const AgentTarget& row, std::string_view toolsArg ) +struct AgentTarget + +ONE recipe path for every agent that can shell out, and the point is that the RECOMMENDATION does not vary by agent — only the MCP alternative does. Before this there were four near-identical CLI-fiinline void wrapEmitCliFirst( const AgentTarget& row, const std::string& token, c … [line truncated: 83 more bytes on this line] + +mcp-tools pass-through. Written into the server command only where its argument shape is known to be one more plain argument: the JSON args arrays (cursor/windsurf/gemini), opencode's command arrayinline bool wrapWritesToolsArg( const AgentTarget& row ) noexcept +inline std::string classNewGroupXml( const IngestResult& ing, std::span<const ClassNewRow> rows, std::string_view rootPrefix, EscapeFn ex ) + + + + + + + + + + +… [84 more display lines; full output is 12334 bytes on 77 raw line(s)] +````` + +## `./build/ripwire . --pack-task="add a new output format flag to the CLI" --partition=3` + +*Fan-out form: one shared core + 3 per-agent slices carved along call-graph communities.* + +**wall time: 2.38s** + +````` + wraps a ; bundle role=core|partition i= symbols= modules= bytes= tokens=: one agent's ctx, symbols= ids assigned, bytes= its size; tokens= = est_tokens= = bytes/2.36 (flat, the densest rate; the inner ctx est_tokens= is language-weighted). Inner ctx task= root= budget_tokens= dropped_positive=: the task, p= base, the slice's token target, ranked candidates its budget cut. of_top=: rows ranked (far) / bodies (callers); s rel=caller|callee shared=: 1-hop edge, bodies reached (absent at 1). window: shown= total= capped= (capped=1 cut). run_unknown=1: no runner derivable (a guess would be worse). est_tokens=: price as emitted (an upper bound under compact). : rank N in this ranking, rows in r= order. : cyclomatic/cognitive complexity. : N callers in the index (absent: not measured). route=: the ranker: name-exact(X) = the task names symbol X (anchors: its evidence), subtoken+body = conceptual BM25 (:broad = 1-2 plain words, plain rg may also win; :declined(...) = a name hit refused as a common name). sc=: enclosing scope; the full id is p::sc::n (p= of the row or its ) and selectors take it. next=: the one pasteable follow-up. pure=1: const/constexpr signature (Swift: non-mutating) and no transitive side effect found; a hint. partitions=/requested=: partitions carved / asked for. modules=/split=: call-graph groups found / cuts forced to split one. core_symbols=/surface=: ids in the shared core / core plus the assignable remainder. budget_per_agent_tokens=: one agent's budget, core_budget_tokens= plus partition_budget_tokens=. total_bytes=N: bytes of all bundles together. overlap_mean=/overlap_max=: pairwise Jaccard over the ids partitions name, before trimming. shared_symbols=/union_symbols=: ids two or more partitions name / ids any partition names. core_overlap=: share of the core surface a partition reaches anyway. layer=: built-in arch layer (game|infra|render|math|audio|ai|test) from a dir name in p=; absent if none. c p=: the file a body callee's l= is in, printed when it is not the b row's own (no p=: the b's file). --> + + + + + +Print the authoritative CLI usage and flag catalog to the caller-provided output streaminline void printUsage( std::FILE* out ) noexcept + +claude's `mcp add … -- ripwire --mcp`: the flag goes on the end of that command line, ahead of…inline std::string wrapCliAddPost( const AgentTarget& row, std::string_view toolsArg ) +struct AgentTarget + +ONE recipe path for every agent that can shell out, and the point is that the RECOMMENDATION doe…inline void wrapEmitCliFirst( const AgentTarget& row, const std::string& token, const std::string_view executablePath, const WrapListing& listing ) noexcept + + + + + +inline bool printUsageTier( std::FILE* out, HelpTier tier, std::string_view want ) noexcept + + + + + + + + +NodeId order. Renumbering an otherwise-identical graph (the exact "same probe file, different so…inline constexpr float kScoreTieAbsEps = 1e-6f + +What a ranked document discloses about the power iteration that ordered it. `isPageRank == false…struct RankDisclosure + +The PageRank power iteration itself — the numeric kernel every ranked document's order comes f…PageRankRun pageRankDouble( const sparseCsr<float>& inEdges, std::span<const double> weightedOutDegree, std::span<const double> teleport, std::span<double> r … [line truncated: 10 more bytes on this line] +inline std::string rankByText( const std::string& root, std::string_view mode, int topK, bool stable = false ) +struct RankedGraph +inline constexpr const char* kChurnRankLegend = "<!-- rank_by=churn: k= is PageRank re-run with the teleport BIASED by git CHANGE-FREQUENCY over window= " "(a c… +inline std::uint32_t sliceRdIterationCeiling() noexcept +struct PageRankRun + +Render one form of the disclosure. Empty string whenever there is nothing to say — no power it…inline std::string renderDisclosure( const RankDisclosure& d, DiscloseAs as ) +inline std::uint32_t navRelevanceWeight( const Graph& g, NodeId n ) noexcept +inline RankedGraph rankGraphTeleport( const Graph& g, const std::vector<float>& p, float alpha = 0.85f ) +inline constexpr std::string_view kPowerShellPathPrependScope = "in PowerShell, for this window + + +inline std::string path_prepend_hint( std::string_view dir ) + +HOT_FILES = ( "src/pagerank.cpp", # the power-iteration loop — G2's no-allocation scope "src/infra/radixSort.h", # LSD radix entry points "src/infra/radixSort.inl", # the counting … [line truncated: 76 more bytes on this line] +handle_t leftmost_leaf() const +inline std::string doctorPathPrependLine( const std::string& selfPath ) + + + +… [166 more display lines; full output is 20878 bytes on 15 raw line(s)] +````` + +## `./build/ripwire . --export=cc.json:/aux/ripwire2.cc.json` + +*Per-file metrics as CodeCharta cc.json.* + +**wall time: 3.85s** + +````` +(empty) +````` + +Artifact written: + +````` + 731441 /aux/ripwire2.cc.json +{"projectName":"project","apiVersion":"1.3","attributeDescriptors":{"loc":{"title":"Lines of Code","description":"Physical line count","direction":-1},"symbols":{"title":"Symbols","description":"Definitions in the file","direction":-1},"cx":{"title":"Cyclomatic Complexity","description":"Sum of per-symbol cyclomatic complexity","direction":-1},"cognitive_cx":{"title":"Cognitive Complexity","descri +````` + +## `./build/ripwire . --batch=/aux/batch2.txt` + +*One-turn sweep: 4 newline-delimited verb:arg sub-queries answered in ONE deduped .* + +**wall time: 11.34s** + +Input file: + +````` +for:incremental cache invalidation +callers:rankGraphTeleport +grep:DISCLOSE +lego:Vehicle +````` + +````` + + + + + + + + + +incremental cache (--cache): per-file content hash + raw facts so a re-run re-parses ONLY c…constexpr std::uint32_t kCacheMagic = 0x4b505443 + +Composed exactly the way every OTHER blob family is (quality.h): one fixed-width identity hex pe…inline std::string spanTierMemoPath( const std::string& diskPath ) + +P1-15 — the `_reingest` envelope field for a response whose handling ran an INCREMENTAL pass, …inline bool mcpRefreshedThisRequest( std::uint64_t passesAtEntry ) + +Ingest the tree at `sha`, materialized out of `root`'s object store. The HEAD side reuses the SA…inline bool ingestCommitTree( const std::string& root, const std::string& sha, const std::vector<std::string>& excludes, std::size_t maxFileBytes, IngestResult&… … [line truncated: 4 more bytes on this line] +struct FileHealth +inline std::vector<std::vector<NodeId>> legoImplementorsOnSurface( const IngestResult& ing, const std::vector<std::vector<NodeId>>& implementors, const std:: … [line truncated: 10 more bytes on this line] +inline std::pair<Snapshot, bool> computeHeadSnapshot( const std::string& root, const std::string_view* cacheNever = nullptr, std::size_t maxFileBytes = kDefault… +inline RawFacts runParsePool( IngestResult& result, const char* rootDir, std::string_view cacheFile, bool captureValueUses, CacheRecords& cache, const CacheLoadStats& cacheStats, IngestFileScan … [line truncated: 62 more bytes on this line] +inline McpRebuildBaseline mcpRebuildBaseline( const McpIndex& ix, bool isIncrementalPass ) +inline std::string mcpFreshFields( std::uint64_t passesAtEntry ) + + + +inline std::string receiptNextFor( const std::string& fileIdentity, const std::string& symbolName, const std::string& foldJson, const std::string& firstTestRun ) +AncestorCacheScope( TSNode root, bool enabled ) : previous( tAncestorCache ) + +const char* cacheArtifactVerdict( const std::string& path, bool captureValueUses ) +inline bool parentCacheOn() +… [236 more display lines; full output is 60648 bytes on 1 raw line(s)] +````` + + +--- + +# self-diagnosis + +## `./build/ripwire . --doctor` + +*Environment self-check: binary staleness, grammars, cache dir, git, tracked-binary staleness — exit 1 when any check fails (here: the PATH install is older than ./build).* + +**exit code: 1** — **wall time: 40.75s** + +````` + + + + + + + + + + +````` + + +--- + +# security + +## `./build/ripwire --scan-skill=skills/ripwire-orient/SKILL.md` + +*Scan a single skill file for injection/exfiltration patterns before installing.* + +````` + + + +````` + +stderr: + +````` +ripwire scan: 0 finding(s) in skills/ripwire-orient/SKILL.md +````` + +## `./build/ripwire --scan-skills=skills` + +*Scan a whole skills directory (exit 2 = CRITICAL, 1 = WARN). Explicit-DIR form only.* + +**wall time: 1.31s** + +````` + + + +````` + +stderr: + +````` +ripwire scan: 0 finding(s) total (26 skill file(s) scanned, 0 unscannable file(s) skipped, 0 denylisted subtree(s) not descended) +````` + + +--- + +# knobs / modes + +## `./build/ripwire . --rank-by=churn --top-k=5` + +*Rank by git change-frequency prior instead of PageRank.* + +**wall time: 11.19s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + +````` + +## `./build/ripwire . --rank-by=churn-decay --since=HEAD~4 --exclude=test --exclude=docs --exclude=skills --exclude=changelog.d --in=src --limit=3` + +*Scope the recent-changes answer to ONE directory. The global block stays byte-identical, a second page follows it — n=/of= are its counts (of= IS the total, so the paging half carries no total=), capped="1" has_more="1" next_offset= offset= limit= page it, and next= replays THIS run's own corpus flags (--since/--exclude) so the page it names is a page of the same answer. The symbol map collapses to a disclosed stub — the map was not asked for and was not ranked at all, which is why the header carries no pr_iters=. merge_bombs_skipped= stays on the global block: it counts the window's skipped commits, not the directory's.* + +**wall time: 8.25s** + +````` + + + + + + + + + + + + + + + + + + + + + +````` + +## `./build/ripwire . --rank-by=bogus --top-k=5` + +*An unknown value REFUSES (exit 1), NAMED, with the supported set listed.* + +**exit code: 1** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --rank-by: unknown value 'bogus' (supported: pagerank|authority|hub|rrf|churn|churn-decay) +````` + +## `./build/ripwire . --callers=rankGraphTeleport --format=columnar` + +*Columnar output: paths table + parallel arrays, ~15-60% fewer tokens on MANY-row lists — small results can be LARGER (the columnar legend is a fixed cost).* + +````` + + +0=src/mcpindex.h 1=src/graph.h 2=src/eval.h 3=src/main.cpp + +0,1,1,2,3,3,3 +getIndex,rankGraph,anchoredLexicalRank,runEval,churnDecayRanking,churnRankedGraph,runDefaultMap +1224,14313,14982,171,1432,1471,1758 +fn,fn,fn,fn,fn,fn,fn +0,0,0,0,0,0,0 +1340,14317,15033,328,1446,1485 1486 1500,1878 + + +````` + +## `./build/ripwire . --for="cache invalidation" --format=candidates --top-k=5` + +*Flat top-K export for an external reranker.* + +**wall time: 4.69s** + +````` + + + +inline std::string spanTierMemoPath( const std::string& diskPath ) + + +inline std::vector<std::vector<NodeId>> legoImplementorsOnSurface( const IngestResult& ing, const std::vector<std::vector<NodeId>>& implementors, const std::vector<NodeId>& surfaceIds ) + + +### See the map — not just the numbers + + +inline std::string receiptNextFor( const std::string& fileIdentity, const std::string& symbolName, const std::string& foldJson, const std::string& firstTestRun ) + + +AncestorCacheScope( TSNode root, bool enabled ) : previous( tAncestorCache ) + + +````` + +## `./build/ripwire . --callers=rankGraphTeleport --format=bogus` + +*An unknown --format value REFUSES (exit 1), named, with the supported set listed.* + +**exit code: 1** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --format: unknown value 'bogus' (supported: xml|columnar|rows|candidates) +````` + +## `./build/ripwire . --callers=rankGraphTeleport --json` + +*Machine-parseable JSON, same content, keys mirror the XML attrs.* + +````` +{"of":"rankGraphTeleport","defs":1,"count":7,"root":".","hop_tested":0,"hop_untested":7,"graph_ambiguous":3637,"graph_unresolved":20080,"graph_unindexed":311,"counts_floor":true,"callers":[{"t":"fn","n":"getIndex","p":"src/mcpindex.h:1224","sites_at":["1340"]}, +{"t":"fn","n":"rankGraph","p":"src/graph.h:14313","sites_at":["14317"]}, +{"t":"fn","n":"anchoredLexicalRank","p":"src/graph.h:14982","sites_at":["15033"]}, +{"t":"fn","n":"runEval","p":"src/eval.h:171","sites_at":["328"]}, +{"t":"fn","n":"churnDecayRanking","p":"src/main.cpp:1432","sites_at":["1446"]}, +{"t":"fn","n":"churnRankedGraph","p":"src/main.cpp:1471","sites_at":["1485","1486","1500"]}, +{"t":"fn","n":"runDefaultMap","p":"src/main.cpp:1758","sites_at":["1878"]}]} +````` + +## `./build/ripwire . --hotspots --json` + +*JSON refusal shape: an unsupported verb refuses loudly instead of silently falling back to XML.* + +**exit code: 1** — **wall time: 1.02s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --json is not yet supported for --hotspots — supported: the default map, --for, --pack-task, --callers/--callees, --impact, --quality-delta, --test-gate, --metrics, --defs, --flags, and --plan-lanes which is JSON-native (e.g. ripwire

--callers=SYM --json) +````` + +## `./build/ripwire . --hotspots --limit=3 --offset=3` + +*Pagination: 3 items, skipping the first 3 (deterministic seams).* + +**wall time: 9.00s** + +````` + + + + + + + +````` + +## `./build/ripwire . --ignore-tests --top-k=5` + +*Drop test paths from the corpus before ranking.* + +**wall time: 2.19s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [86 more display lines; full output is 9788 bytes on 1 raw line(s)] +````` + +stderr: + +````` +[validate] symbolCount == N && fileCount == ing.files.size() && referenceCount == ing.references.size() is false — warmsnap: the graph section describes another model (warmsnap_graph.h:274, std::optional rw::warmsnap::readGraph(Session &, const IngestResult &) — logged once per site) +````` + +## `./build/ripwire . --exclude=present --exclude=bench --top-k=5` + +*Drop matching paths (repeatable) before ranking.* + +**wall time: 4.46s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [87 more display lines; full output is 10042 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --map-diff --top-k=5` + +*Full map re-ranked with teleport toward git-changed files — clean tree, so changed=0 and it degrades to the plain map.* + +**wall time: 5.68s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + +````` + +stderr: + +````` +[validate] symbolCount == N && fileCount == ing.files.size() && referenceCount == ing.references.size() is false — warmsnap: the graph section describes another model (warmsnap_graph.h:274, std::optional rw::warmsnap::readGraph(Session &, const IngestResult &) — logged once per site) +````` + +## `./build/ripwire . --no-cache --top-k=3` + +*Force a cold parse (bypass the warm TMPDIR cache) — shows the cold-vs-warm cost.* + +**wall time: 6.90s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [80 more display lines; full output is 10040 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --cache=/aux/warm2.ripwirecache --top-k=3` + +*Explicit incremental cache at a path OUTSIDE the repo (first call writes it).* + +**wall time: 5.55s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [80 more display lines; full output is 10040 bytes on 1 raw line(s)] +````` + +stderr: + +````` +ripwire: cache : over its 2048 MiB budget — evicted 205 blob(s) of other roots or other ripwire builds (this build's blobs for this root are kept) +````` + +Artifact written: + +````` + 40244008 /aux/warm2.ripwirecache +````` + +## `./build/ripwire . --max-file-size=8K --top-k=3` + +*Skip files above a size bound before parsing (note the corpus shrink in the header).* + +**wall time: 2.64s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [20 more display lines; full output is 4949 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --scip=does_not_exist.scip --callers=rankGraphTeleport` + +*SCIP overlay with a missing index REFUSES (exit 1) naming the file — never silently serves the name-based map you named a precision index to improve on (it used to degrade in silence).* + +**exit code: 1** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --scip=does_not_exist.scip: cannot open the index — refusing rather than serving the name-based map you named a precision index to improve on (generate one with scip-clang/scip-python, or drop --scip) +````` + +## `./build/ripwire src test --top-k=5` + +*Multi-root workspace: ONE merged graph over two roots, paths labeled /.* + +**wall time: 9.06s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + +````` + +## `./build/ripwire . --eval` + +*Self-eval: co-change recall vs BM25.* + +**wall time: 52.91s** + +````` +ripwire --eval (co-change recovery, averaged over 80 historical commits) + ranker recall@5 recall@10 recall@20 + ripwire 8.5% 9.4% 16.3% + BM25 8.7% 9.8% 11.9% + BM25sub 7.4% 10.1% 13.5% + BM25body 10.9% 12.7% 22.6% + fused 5.7% 7.4% 14.7% + anchored 10.9% 12.7% 21.6% + same-dir 0.3% 0.9% 2.0% + random 0.1% 0.2% 0.4% <- floor (random ranking over F=4779 files) + note: `ripwire` here is the DEFAULT MAP's structural-only PageRank (importance, not + relatedness) — it is NOT what a --for/--query retrieval call ranks with. BM25 / + BM25sub / BM25body are QUERY-TIME lexical rankers (whole-name / subtoken / + subtoken+body); fused = RRF(ripwire, BM25sub); anchored = BM25body + anchored PPR + expansion (--for --anchor, EXPERIMENTAL). The SHIPPED default for --for/--query is + the subtoken+body lexical family (routed to name-exact only for an identifier-shaped + query — lexical.h chooseForRanker), so a gap between the ripwire and BM25* rows here + is structural-importance-vs-lexical-relatedness on a co-change task, not the shipped + retrieval path losing to an alternative it was never running. +````` + +## `./build/ripwire . --eval-retrieval` + +*Known-item retrieval eval: MRR + recall@k per ranker per query mode.* + +**wall time: 288.35s** + +````` +ripwire --eval-retrieval (known-item, 4000 doc-commented symbols; gold is in-corpus by construction) + sample: population=11893 scored=4000 rule=smallest-key CAPPED — a SUBSET, not the population + (smallest fnv1a64(scope::name) over the population, cut on the key so an identity is never split; + path- and order-independent, but a corpus this size is NOT graded exhaustively — say so when citing it) + ingest: lex=rich (persisted subtoken stats; no per-query corpus re-tokenize) + ranker query-mode MRR recall@1 recall@5 recall@10 + subtoken name 0.660 52.7% 82.1% 87.3% + subtoken doc-phrase 0.881 85.8% 90.2% 91.3% + name-exact name 0.875 79.4% 93.7% 96.4% + name-exact doc-phrase 0.008 0.3% 1.1% 1.7% + anchored name 0.665 53.9% 81.0% 86.0% + anchored doc-phrase 0.874 84.9% 89.9% 90.5% + routed name 0.877 79.6% 93.9% 96.5% + routed doc-phrase 0.879 85.7% 90.0% 91.0% + note: routing chose name-exact on 3989/4000 NAME queries (a NAME query is always identifier-shaped); + the confidence gate routes doc-phrase queries to name-exact ONLY when EVERY content word names a symbol + (or an explicit camel/snake token appears) AND every matched name is specific enough to anchor on — + a common name (many definitions, or a subtoken carried by many symbol names) declines the route — so + conceptual prose falls back to subtoken+body; routed tracks the better ranker on BOTH modes + (routed==name-exact on name, ~=subtoken+body on doc-phrase). +````` + +## `./build/ripwire . --eval-stray=/aux/stray_labels2.tsv` + +*Labelled verdict-accuracy eval for --stray-content — three labels over REAL local refs (names resolved at capture time); exit 3 when accuracy is under the floor. Read got= against v= in the stray-content run: a ref the verb could not analyse (unknown) must never be credited as a merged hit.* + +**exit code: 3** — **wall time: 20.97s** + +Input file: + +````` +# refverdict labels for --eval-stray (the first three local branches, resolved at capture time; a missing branch is padded with a nonexistent name on purpose) +arm/for-howitworks-067-f2add merged +arm/for-howitworks-067-placebo unmerged +arm/orient-map-067-narrow merged +````` + +````` + + + + + + +````` + +stderr: + +````` +ripwire: warning: --stray-content read the newest 512 of 639 local branches; 127 older were not read (limit: 512 refs); pass --detail=1 to read every branch, or narrow the branches with a ref-name filter +````` + +## `./build/ripwire skills --eval-skills=/aux/skills_labels2.tsv` + +*Labelled skill-ROUTING eval over the repo's own skills/ directory (4 hand-labelled prompts).* + +**wall time: 2.12s** + +Input file: + +````` +orient in an unfamiliar codebase fast ripwire-orient judged +who calls this function and what is the blast radius ripwire-navigate judged +plan parallel worktrees so the lanes do not collide ripwire-change-check judged +what is the weather in Paris none neg +````` + +````` +ripwire --eval-skills (skill routing over K=16 candidate skills [ripwire-router excluded]; 3 positive + 1 negative prompts; corpus '/aux/skills_labels2.tsv'; split test=4 … [line truncated: 7 more bytes on this line] + arm hit@1 hit@2 mrr sep-auc fire/abstain@ORACLE-th (upper bound) + overlap 66.7% 66.7% 0.689 0.000 50.0% (th=-1.000) + name 33.3% 66.7% 0.537 0.667 50.0% (th=0.000) + bm25-desc 66.7% 66.7% 0.689 0.667 75.0% (th=2.867) + bm25-full 33.3% 66.7% 0.611 1.000 50.0% (th=0.427) + for-routed 33.3% 33.3% 0.556 1.000 50.0% (th=0.703) + random 6.2% 12.5% 0.211 0.500 <- floor (uniform-random ranking; auc 0.5 by definition) + provenance hit@1 (bm25-desc): router 0/0, desc 0/0, judged 2/3 (desc rows quote the descriptions - expect them easiest; judged is the honest number) + judged-only hit@1 per arm: overlap 2/3, name 1/3, bm25-desc 2/3, bm25-full 1/3, for-routed 1/3 + router-magnet: with ripwire-router ADMITTED as a candidate it takes top-1 on 1/3 positive prompts (bm25-desc arm) - why it is excluded above + per-skill (bm25-desc): name / permitted-rows / won / pos-fires / false-fires / neg-fires + ripwire-before-you-build 0 0 1 1 0 + ripwire-change-check 1 0 0 0 0 + ripwire-find-bug 0 0 0 0 0 + ripwire-fresh-eyes 0 0 0 0 1 + ripwire-graph-query 0 0 0 0 0 + ripwire-handoff 0 0 0 0 0 + ripwire-layers 0 0 0 0 0 + ripwire-mcp 0 0 0 0 0 + ripwire-navigate 1 1 1 0 0 + ripwire-opt-remarks 0 0 0 0 0 + ripwire-orient 1 1 1 0 0 + ripwire-perf-target 0 0 0 0 0 + ripwire-quality-bar 0 0 0 0 0 + ripwire-reuse-first 0 0 0 0 0 + ripwire-security-scan 0 0 0 0 0 + ripwire-write-tests 0 0 0 0 0 + misses (overlap): + line 3 want=ripwire-change-check got=ripwire-before-you-build "plan parallel worktrees so the lanes do not collide" +… [19 more lines, 3720 bytes total] +````` + +## `./build/ripwire wrap claude` + +*Print the recipe to wire ripwire into Claude Code as an MCP server.* + +````` +# ripwire -> Claude Code (CLI-first) +# RECOMMENDED — this agent can run shell commands, so call the CLI directly. It costs +# nothing until you invoke it, and it reads CLAUDE.md, so the paste block below IS the wiring: +ripwire . --for="" +# +# ...every follow-up call answers with the compact legend by default (terse definitions of only the +# attributes the answer carries; the payload is byte-identical either way). Add --legend=full when a +# definition's reasoning is needed -- `ripwire --help` carries the measured saving (one place, +# gate-held) -- this line does not repeat it, because two copies of a number is one that goes stale: +# ripwire . --callers=SYM --legend=full +# +# ALTERNATIVE — register the MCP server instead, for a warm index across calls: +claude mcp add ripwire -- ripwire --mcp --mcp-tools=no-edit +# verbs the agent can then call mid-task (30 total): +# read: analyze, rank_by, find_symbol, find_referencing_symbols, grep, cochange, memory_recall, situational_awareness, mentions, for, lego, owners, fetch_body, batch, flags, doc_drift, slice +# flagship reflex: exemplar, quality_delta, quality_baseline, impact, uses, affected, path_between, connect, explore, from_trace, edit_check, whereis, stray_content +bash skills/install.sh # deploy to ${CLAUDE_CONFIG_DIR:-~/.claude}/skills (drift-gated) +bash skills/install.sh --hook # RECOMMENDED: advisory Read/Grep -> ripwire CLI nudge + session primer (opt-in, never blocks) +# +# context wiring — a binary on PATH is invisible to an agent until its rules file says when +# to reach for it. Paste the block below into CLAUDE.md: +# --- paste into CLAUDE.md --- +## ripwire — deterministic codebase maps (on PATH as `ripwire`) +Reach for it BEFORE blind grep + whole-file reads. First call ~1s cold; after that warm, ~0.1s. +- Orient on a task: `ripwire --for=""` — ranked, quality-annotated + signatures. Paste symbol/file names from the issue verbatim; named mentions get anchored. +- One task: `--pack-task="" --legend=compact`; before parallel agents: `--plan-lanes=N --task=""`, then read `lanes[].execution`. +- Have a stack trace / build error: `ripwire --from-trace=FILE --legend=compact` (`-` = stdin) — + paste the error, don't paraphrase it into a query. +- Who calls X: `--callers=SYM --legend=compact`. "Is it safe to change X?" needs the full blast radius: +… [13 more lines, 4536 bytes total] +````` + +## `./build/ripwire --version` + +*Version + short build info.* + +````` +ripwire 0.6.10-dev.130+gb0cb13d8d (dev, AppleClang 21.0.0.21000101, emit=std::print, built_from=b0cb13d8d) +````` + + +--- + +# navigate — seeds, claims, slices, shapes + +## `./build/ripwire . --at=src/graph.h:14272` + +*Hold a LOCATION, not a name: the enclosing-definition chain at FILE:LINE (a compiler error, a diff hunk, a stack frame), outermost -> innermost.* + +````` + + + + +````` + +## `./build/ripwire . --callers=@src/graph.h:14272` + +*The same seed in a SELECTOR position: @FILE:LINE resolves to the innermost enclosing definition, then --callers runs on it.* + +````` + + + + + + + + + + +````` + +## `./build/ripwire . --at=src/graph.h:999999` + +*A seed past the end of the file — the refusal shape for a faulted location.* + +**exit code: 1** + +````` +(empty) +````` + +stderr: + +````` +ripwire: the at flag's seed 'src/graph.h:999999' named no location (./src/graph.h has only 20696 lines — the seed asked for line 999999) +````` + +## `./build/ripwire . --verify="calls(runDefaultMap, rankGraphTeleport)"` + +*VERIFY a closed claim in one call: three-valued verdict (confirmed / refuted / not-established) with the evidence rows inline.* + +````` + + + + + +````` + +## `./build/ripwire . --verify="unused(rankGraphTeleport)"` + +*A claim that is FALSE — the refuted shape, with the references that refute it.* + +**wall time: 1.07s** + +````` + + + + + + + + + + + + +````` + +## `./build/ripwire . --verify="contains(src/graph.h, \"no such literal anywhere\")"` + +*A literal-scan absence: refuted only with complete= evidence, never on a partial scan.* + +````` + + + +````` + +## `./build/ripwire . --verify="frobnicate(x)"` + +*An unparseable claim — the refusal names the accepted shapes.* + +**exit code: 1** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --verify claim not recognized: 'frobnicate(x)' — unknown shape word. The claim language is CLOSED; the shapes are: calls(A, B) does A transitively call B · uses(SYM) is SYM referenced anywhere · unused(SYM) is SYM referenced nowhere · contains(FILE, "LITERAL") do FILE's bytes contain t … [line truncated: 218 more bytes on this line] +````` + +## `./build/ripwire . --slice=rankGraphTeleport` + +*Bare --slice=SYM: the INVENTORY of sliceable locals (), so a caller can pick VAR.* + +**wall time: 3.07s** + +````` + + + + + + + + + + + + + + + + + +````` + +## `./build/ripwire . --slice=rankGraphTeleport:teleport` + +*Intra-procedural def-use slice of ONE variable: one row per line touching it, k=def|use|both, reaching definitions flow-sensitive (reach=cfg).* + +**wall time: 2.68s** + +````` + + + + + + + teleport( pw.begin(), pw.end() );]]> + + + + + + + + +````` + +## `./build/ripwire . --slice=rankGraphTeleport:teleport --slice-flow=back --slice-depth=3` + +*TRANSITIVE backward value-flow from the seed variable, bounded BFS (depth= disclosed; a cut frontier says flow_truncated=1).* + +**wall time: 3.05s** + +````` + + + + + + + teleport( pw.begin(), pw.end() );]]> + + + + + + + + + pw = biasPrior( g, p );]]> + + +& p, float alpha = 0.85f )]]> + + +& p, float alpha = 0.85f )]]> + + +````` + +## `./build/ripwire . --slice=rankGraphTeleport:teleport --slice-flow=fwd` + +*Forward flow: which statements the seed's value reaches, at the default depth bound.* + +**wall time: 3.44s** + +````` + + + + + + + teleport( pw.begin(), pw.end() );]]> + + + + + + + + + + + + + + + + + + + + + 0.0 )]]> + + + + + + + + +````` + +## `./build/ripwire . --slice=rankGraphTeleport:nosuchvar` + +*A variable the definition does not bind — the refusal shape, naming the inventory.* + +**exit code: 1** — **wall time: 1.15s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --slice: no occurrence of 'nosuchvar' in rankGraphTeleport — sliceable locals: alpha, g, p, pw, N, teleport, rankDouble, run, teleportMass, value, inverseMass, r (bare --slice=rankGraphTeleport lists them with first-def lines) +````` + +## `./build/ripwire . --slice-depth=3` + +*--slice-depth without --slice-flow is refused loudly rather than silently ignored.* + +**exit code: 1** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --slice-depth bounds the --slice-flow BFS — pass both (e.g. ripwire --slice=parseArgs:argIndex --slice-flow=fwd --slice-depth=4) +````` + +## `./build/ripwire . --slice=rankGraphTeleport:teleport --legend=compact` + +*The compact legend posture: rows byte-identical, a versioned schema id replaces the repeated explanatory prose — for a many-small-calls loop.* + +**wall time: 3.14s** + +````` + + + + + + + teleport( pw.begin(), pw.end() );]]> + + + + + + + + +````` + +## `./build/ripwire . --pattern='rankGraphTeleport($A, $B, $C)'` + +*Structural search written in CODE: $NAME binds one node; grammars=/shapes= disclose what the pattern became per grammar (a 3-argument call shape — the 2-argument spelling has no call site in this repo and correctly reports hits=0).* + +**wall time: 3.47s** + +````` + +rankGraphTeleport( g, std::vector<float>( N, ranked ? 1.0f / float( ranked ) : 0.f ), alpha ) + +````` + +## `./build/ripwire . --pattern='DISCLOSE(...)'` + +*The ellipsis form over a macro-shaped call site; unsupported= names the families this verb does not serve.* + +**wall time: 2.29s** + +````` + +DISCLOSE( result, AbiResult::DisclosureWhy::NoMergeBase, "abi: no merge-base for a ref (unrelated history?) — that ref +DISCLOSE( Diagnostics::answerRefused, "--arch exits 1 with path:line and the reason on stderr; no report is printed", +DISCLOSE( baseline, ArchBaselineRead::DisclosureWhy::SymlinkRefused, "arch: refusing to read the arch baseline sidecar t +DISCLOSE( Diagnostics::answerRefused, "--baseline exits 1: pathguard names the refused link on stderr and the verb says +DISCLOSE( ex, Exclusions::DisclosureWhy::ForHeaderSaturated, "atoms: the for-header exclusion stream spent its whole bud +DISCLOSE( ex, Exclusions::DisclosureWhy::StmtCrementSaturated, "atoms: the statement-crement exclusion stream spent its +DISCLOSE( ex, Exclusions::DisclosureWhy::StmtAssignSaturated, "atoms: the statement-assign exclusion stream spent its wh +DISCLOSE( ex, Exclusions::DisclosureWhy::InnerCommaSaturated, "atoms: the inner-comma exclusion stream spent its whole b +DISCLOSE( st_, Type3Stats::DisclosureWhy::PairCapHit, "clones: Type-3 pair cap hit — first N compared (both-gate-survi +DISCLOSE( scan, CommentCoherenceScan::DisclosureWhy::UnreadableFile, "comment-coherence: an indexed file could not be re +DISCLOSE( st, StreamBlobStats::DisclosureWhy::StreamEndedMidBlob, "crossref: git cat-file stream ended +DISCLOSE( st, StreamBlobStats::DisclosureWhy::ListUnwritable, "crossref: cannot write the blob-batch list — cross-bran +DISCLOSE( st, StreamBlobStats::DisclosureWhy::BatchNotStarted, "crossref: git cat-file --batch failed to start — cross +DISCLOSE( st, StreamBlobStats::DisclosureWhy::StreamEndedMidBlob, "crossref: git cat-file stream e +DISCLOSE( sink, RefEnumeration::DisclosureWhy::DateUnreadable, "crossref: for-each-ref yielded a ref with no readable co +DISCLOSE( dropSink, RefEnumeration::DisclosureWhy::TipNotObjectName, "crossref: for-each-ref yielded a ref whose tip is +DISCLOSE( "crossref: refusing a diff whose revision arguments are not resolved object names" ) +DISCLOSE( sweep, ParallelSweep::DisclosureWhy::WorkerThrew, "crossref: a git worker threw — this shard of the sweep is +DISCLOSE( stats, StreamBlobStats::DisclosureWhy::BatchNotStarted, "crossref: a blob-stream slice was never read — comp +DISCLOSE( plumb, RefPlumbing::DisclosureWhy::RevisionNotObjectName, "crossref: ref tip or HEAD is not a resolved object +DISCLOSE( plumb, RefPlumbing::DisclosureWhy::MergeBaseNotObjectName, "crossref: merge-base returned something that is no +DISCLOSE( plumb, RefPlumbing::DisclosureWhy::NoMergeBase, "crossref: no merge-base for ref (shallow clone or unrelated h +DISCLOSE( plumbing[ i ], RefPlumbing::DisclosureWhy::NoMergeBase, "crossref: no merge-base for ref (shallow clone or unr +DISCLOSE( "crossref: refusing to list a tree whose revision argument is not a resolved object name" ) +DISCLOSE( "whereis: the index's def sites match no HEAD row (working tree drifted from HEAD?) — keeping the lexical la +DISCLOSE( reads[ k ], BranchBlobReadBack::DisclosureWhy::NotReadBackWhole, "whereis: a blob the pa +DISCLOSE( scan, WorktreeScan::DisclosureWhy::ListingFailed, "whereis: git could not list the working tree's changes — +DISCLOSE( scan, WorktreeScan::DisclosureWhy::OverPathCap, "whereis: more changed paths than the overlay reads — the re +… [73 more display lines; full output is 18272 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --pattern='x'` + +*A pattern that collapses to a bare token is REFUSED — never reported as hits=0.* + +**exit code: 1** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --pattern: this pattern collapses to a single bare token, which is a TEXT search, not a structural one — a clean parse is not enough (a bare word parses fine in most grammars and means nothing structural). Give it a shape (foo($X), $A + $B, if ($C) { ... }) or use the grep flag for litera … [line truncated: 176 more bytes on this line] +````` + +## `./build/ripwire . --grep=DISCLOSE --and=cache` + +*Boolean grep: hits where BOTH literals share the matched line (--grep-scope=line is the default).* + +````` + + + +inline bool topLevelEvidence( std::string_view source, const TSLanguage* language, const Predicate& predicate ) +The crawl's per-file byte ceiling. A text file larger than this is skipped: at this size it is o…constexpr std::size_t kDefaultMaxFileBytes = 4u * 1024u * 1024u +TSTree* parseTree( TSParser* parser, std::string_view src ) + +Exercise every registered grammar and its embedded query, reporting loaded and expected totalsinline DoctorGrammarProbe doctorProbeGrammars() +class SourceReader +constexpr std::array<LangEntry, 58> kLangTable = +struct FileHealth +struct SliceScan +explicit ParsedFile( std::string bytes ) : m_bytes( std::move( bytes ) ) +class ParsedFile + + + +inline RevSide sliceAtRev( const std::string& root, const std::string& sha, const std::string& rel, const Symbol& sym, SliceFam fam, const ::TSLanguage* grammar, st … [line truncated: 77 more bytes on this line] +std::vector<LocalNameFact> collectGatedLocalNames( std::string_view defBytes, std::uint32_t defStartLine, Lang lang ) +inline ModuleScan scanModule( std::string_view source, std::string_view path ) + +inline bool hasMainGuard( std::string_view source ) +inline bool hasPhantomScopeSeparator( TSNode qualified ) noexcept + + + + +inline void runParseWorker( ParsePoolShared& sh, unsigned t ) +… [242 more display lines; full output is 26515 bytes on 44 raw line(s)] +````` + +## `./build/ripwire . --for="tree-sitter parse of a source file" --sections=lego,compose` + +*Restore the / sections the --for bundle collapses to a counted stub by default (this is the stub's own next= spelling).* + +**wall time: 4.16s** + +````` + + + + +inline bool topLevelEvidence( std::string_view source, const TSLanguage* language, const Predicate& predicate ) +The crawl's per-file byte ceiling. A text file larger than this is skipped: at this size it is o…constexpr std::size_t kDefaultMaxFileBytes = 4u * 1024u * 1024u +TSTree* parseTree( TSParser* parser, std::string_view src ) + +Exercise every registered grammar and its embedded query, reporting loaded and expected totalsinline DoctorGrammarProbe doctorProbeGrammars() +class SourceReader +constexpr std::array<LangEntry, 58> kLangTable = +struct FileHealth +struct SliceScan +explicit ParsedFile( std::string bytes ) : m_bytes( std::move( bytes ) ) +class ParsedFile + + + +inline RevSide sliceAtRev( const std::string& root, const std::string& sha, const std::string& rel, const Symbol& sym, SliceFam fam, const ::TSLanguage* grammar, st … [line truncated: 77 more bytes on this line] +std::vector<LocalNameFact> collectGatedLocalNames( std::string_view defBytes, std::uint32_t defStartLine, Lang lang ) +inline ModuleScan scanModule( std::string_view source, std::string_view path ) + +inline bool hasMainGuard( std::string_view source ) +inline bool hasPhantomScopeSeparator( TSNode qualified ) noexcept + + + + +inline void runParseWorker( ParsePoolShared& sh, unsigned t ) +… [264 more display lines; full output is 27885 bytes on 44 raw line(s)] +````` + +## `./build/ripwire . --for="tree-sitter parse of a source file" --auto-bodies` + +*Opt OUT of compact conceptual serving: restore the rank-first auto walk (bundle="auto").* + +**wall time: 5.63s** + +````` + + + + +inline bool topLevelEvidence( std::string_view source, const TSLanguage* language, const Predicate& predicate ) +The crawl's per-file byte ceiling. A text file larger than this is skipped: at this size it is o…constexpr std::size_t kDefaultMaxFileBytes = 4u * 1024u * 1024u +TSTree* parseTree( TSParser* parser, std::string_view src ) + +Exercise every registered grammar and its embedded query, reporting loaded and expected totalsinline DoctorGrammarProbe doctorProbeGrammars() +class SourceReader +constexpr std::array<LangEntry, 58> kLangTable = +struct FileHealth +struct SliceScan +explicit ParsedFile( std::string bytes ) : m_bytes( std::move( bytes ) ) +class ParsedFile + + + +inline RevSide sliceAtRev( const std::string& root, const std::string& sha, const std::string& rel, const Symbol& sym, SliceFam fam, const ::TSLanguage* grammar, st … [line truncated: 77 more bytes on this line] +std::vector<LocalNameFact> collectGatedLocalNames( std::string_view defBytes, std::uint32_t defStartLine, Lang lang ) +inline ModuleScan scanModule( std::string_view source, std::string_view path ) + +inline bool hasMainGuard( std::string_view source ) +inline bool hasPhantomScopeSeparator( TSNode qualified ) noexcept + + + + +inline void runParseWorker( ParsePoolShared& sh, unsigned t ) +… [272 more display lines; full output is 28301 bytes on 96 raw line(s)] +````` + +## `./build/ripwire . --for="quality delta acks ledger rubber stamp"` + +*Doc-mention surfacing (default ON): a markdown doc naming a top-resolved symbol in a backtick rides in below that symbol — the legend's [doc mentions: …] clause says it fired.* + +**wall time: 4.04s** + +````` + + + + + +L2 stale acks in the range form. A changed-files answer holds no whole target tree to check the …std::vector<rw::quality::StaleAck> refPairStaleAcks( const gtl::btree_map<std::string, rw::quality::AckRecord>& acks, const RefPairDelta& refs ) +inline QualityDeltaOutcome computeQualityDelta( const std::string& root ) +inline std::string staleByKindValue( const std::vector<StaleAck>& staleAcks ) +inline constexpr const char* kAtStampLegend = "<!-- at= is the git commit these numbers were computed at +std::optional<int> runForLensPosture( const MainDispatch& d, rw::ForAnswerLedger* ledger ) +inline Result computeDmm( const std::string& root, std::string_view spec, const IngestResult& wo… +inline const char* kNotesFile = ".ripwire_notes" +inline rw::pathguard::NoFollowRead openRegularFileStream( std::string_view what, const std::stri… + +The REF-PAIR floor's comparison, once loadRefPairDelta has both sides: the base snapshot is the …void refPairBasis( const rw::Config& cfg, const std::string& root, RefPairDelta& refs, DeltaBasis& out ) +std::optional<int> refuseForeignAckSelection( const rw::Config& cfg, const rw::quality::Scope& scope, const std::vector<rw::quality::Regression>& out … [line truncated: 18 more bytes on this line] +std::optional<int> runQualityDelta( const MainDispatch& d ) +int ackNothingToAccept( const std::string& acksFile, const gtl::btree_map<std::string, rw::quality::AckRecord>& acks, const rw::quality::Scope& scope, std::size… … [line truncated: 4 more bytes on this line] + + + + + +inline bool writeAckRecords( const std::string& path, const gtl::btree_map<std::string, AckRecord>& acks ) +inline std::pair<std::string, std::string> qualityDeltaJson( const std::string& root, bool showStale = false ) +inline std::string qualityAcksPath( const std::string& root ) +inline std::string staleAcksXml( const std::vector<StaleAck>& staleAcks, EscapeFn esc ) + +inline std::string gitHeadSha( const std::string& root ) + +… [321 more display lines; full output is 31603 bytes on 48 raw line(s)] +````` + +## `./build/ripwire . --for="quality delta acks ledger rubber stamp" --no-doc-mention` + +*The same task with doc-mention surfacing OFF — the contrast the flag exists for (no [doc mentions] clause, one fewer row).* + +**wall time: 4.98s** + +````` + + + + + +L2 stale acks in the range form. A changed-files answer holds no whole target tree to check the …std::vector<rw::quality::StaleAck> refPairStaleAcks( const gtl::btree_map<std::string, rw::quality::AckRecord>& acks, const RefPairDelta& refs ) +inline QualityDeltaOutcome computeQualityDelta( const std::string& root ) +inline std::string staleByKindValue( const std::vector<StaleAck>& staleAcks ) +inline constexpr const char* kAtStampLegend = "<!-- at= is the git commit these numbers were computed at +std::optional<int> runForLensPosture( const MainDispatch& d, rw::ForAnswerLedger* ledger ) +inline Result computeDmm( const std::string& root, std::string_view spec, const IngestResult& wo… +inline const char* kNotesFile = ".ripwire_notes" +inline rw::pathguard::NoFollowRead openRegularFileStream( std::string_view what, const std::stri… + +The REF-PAIR floor's comparison, once loadRefPairDelta has both sides: the base snapshot is the …void refPairBasis( const rw::Config& cfg, const std::string& root, RefPairDelta& refs, DeltaBasis& out ) +std::optional<int> refuseForeignAckSelection( const rw::Config& cfg, const rw::quality::Scope& scope, const std::vector<rw::quality::Regression>& out … [line truncated: 18 more bytes on this line] +std::optional<int> runQualityDelta( const MainDispatch& d ) +int ackNothingToAccept( const std::string& acksFile, const gtl::btree_map<std::string, rw::quality::AckRecord>& acks, const rw::quality::Scope& scope, std::size… … [line truncated: 4 more bytes on this line] + + + + + +inline bool writeAckRecords( const std::string& path, const gtl::btree_map<std::string, AckRecord>& acks ) +inline std::pair<std::string, std::string> qualityDeltaJson( const std::string& root, bool showStale = false ) +inline std::string qualityAcksPath( const std::string& root ) +inline std::string staleAcksXml( const std::vector<StaleAck>& staleAcks, EscapeFn esc ) + +inline std::string gitHeadSha( const std::string& root ) + +… [321 more display lines; full output is 31333 bytes on 48 raw line(s)] +````` + +## `./build/ripwire . --safe-delete=rankGraphTeleport` + +*"Can I delete this?" — callers + transitive impact + every use site + how much of the radius is tested, composed in ONE call; risk= names what was found, never a verdict.* + +**wall time: 1.12s** + +````` + + + + + + + + + +````` + +## `./build/ripwire . --safe-delete=DoesNotExist` + +*Unknown-symbol refusal shape for --safe-delete.* + +**exit code: 1** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --safe-delete symbol not found: DoesNotExist (note: the lexical definition scan stopped at its budget, 4096 files or 16 MiB, before reading every file, so this miss is not proof the bytes define nothing; --grep=DoesNotExist lists its text uses) +````` + +## `./build/ripwire . --handoff` + +*The continuation packet for the NEXT session: disk truth (branch/sha, changed symbols, blast radius, tests) + labeled suggestions. Recorded against a CLEAN tree.* + +**wall time: 5.84s** + +````` + + + + + + + + + + + + + +````` + +## `./build/ripwire . --handoff --token-budget=1200` + +*The same packet under a hard ceiling: heuristic rows drop tail-first (withheld= disclosed), verified rows never drop.* + +**wall time: 8.50s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [561 more display lines; full output is 59467 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --no-ignore --top-k=3` + +*Crawl paths the repo's own .gitignore covers (default honours it and discloses ignored_files=/ignored_dirs= only when it dropped anything — this repo's crawl drops nothing, so the header is identical to the default map's; --skipped's ignore_mode= says which rule applied).* + +**wall time: 2.75s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [80 more display lines; full output is 10040 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --no-stable --top-k=3` + +*--no-stable outside --mcp: what the flag does (or says) when there is no stable-by-default ordering to opt out of.* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [80 more display lines; full output is 10040 bytes on 1 raw line(s)] +````` + +stderr: + +````` +ripwire: --no-stable is read only by --mcp/--listen (it opts out of the stable ordering the server turns on) — it changed nothing here; the CLI map orders important-first unless you pass --order=stable +````` + +## `./build/ripwire . --run-trace="cat /aux/asan_trace_now.txt; exit 1"` + +*EXEC-MODE --from-trace: run a command, and on a non-zero exit map its captured output onto indexed symbols in the same call — the whole fix-loop entry. ripwire exits 4 here because the wrapped command failed, which is the signal, not an incident.* + +**exit code: 4** — **wall time: 1.32s** + +````` + + + + + + const&, float) src/graph.h:14272 + #1 0x102f3e884 in rw::rankGraph(Graph const&, float) src/graph.h:14315 + #2 0x102e11f30 in runDefaultMap(MainDispatch const&) src/main.cpp:1760 + #3 0x102e01a44 in main src/main.cpp:4511 + #4 0x1a2b3c0dc in start+0x9dc (dyld:arm64e+0x60dc)]]> pw = biasPrior( g, p ); + const std::size_t N = pw.size(); + std::vector teleport( pw.begin(), pw.end() ); + std::vector rankDouble( N, 0.0 ); + PageRankRun run{}; // an N == 0 graph never enters the kernel: { 0, converged } — see PageRankRun + if( N ) + { + double teleportMass = 0.0; + for( const double value : teleport ) + { + teleportMass += value; + } + if( teleportMass > 0.0 ) + { + const double inverseMass = 1.0 / teleportMass; + for( double& value : teleport ) + { + value *= inverseMass; + } + } + run = pageRankDouble( g.inEdges, g.wOutDeg, teleport, rankDouble, PageRankConfig{ .alpha = double( alpha ) } ); + } + std::vector r( N, 0.f ); + std::transform( rankDouble.begin(), rankDouble.end(), r.begin(), []( double value ) { return float( value ); } ); + return { std::move( r ), run.iterationCount, run.hasConverged }; +}]]>inline std::vector<float> biasPrior( const Graph& g, const std::vector<float>& p )#define PROFILE_SCOPE_DESCRIBE( desc ) + + + +````` + +## `./build/ripwire . --run-trace="sleep 30" --run-timeout=2` + +*A command still running at the cap: its process group is killed and the run reports timed_out=1 — an honest timeout, never an empty success.* + +**exit code: 4** — **wall time: 2.40s** + +````` + + + + +````` + +stderr: + +````` +ripwire: --run-trace: TIMEOUT — the command exceeded the 2 s cap; its process group was killed +````` + +## `./build/ripwire . --run-timeout=5` + +*--run-timeout alone is refused loudly (it only modifies --run-trace).* + +**exit code: 1** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --run-timeout=SECONDS modifies --run-trace — pass it too (e.g. ripwire --run-trace="make -j" --run-timeout=60) +````` + + +--- + +# assess quality — the wider lens family + +## `./build/ripwire . --quality-panel` + +*THE single wide-angle quality read: six families in one pass, an eligible/ranked shortlist rather than a firehose.* + +**wall time: 9.72s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [190 more display lines; full output is 15658 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --biggest-first --limit=8` + +*Per-function size ranking, largest Halstead volume/token entropy/lines first — a size proxy, not a readability order (withdrawn, docs/EVALS.md §8) — a RANKING lens, not a grade.* + +**wall time: 2.09s** + +````` + + + + + + + + + + + +````` + +## `./build/ripwire . --comment-coherence --limit=8` + +*Functions WITH a doc comment, most name-restating first: c_coeff (high = the comment repeats the name) and cic (Jaccard of comment vs identifier vocabulary), both reported, never collapsed.* + +**wall time: 1.01s** + +````` + + + + + + + + + + + +````` + +## `./build/ripwire . --context-ratio --limit=8` + +*The local-reasoning lens: to understand this symbol, how much must you know that is NOT in front of you (ent_ratio= edge share, read_ratio= token-weighted).* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [21 more display lines; full output is 11236 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --nonlocal-state --limit=8` + +*Per function, the non-local MUTABLE state it can reach (transitively), most writes first — unsound by construction, and the legend says where.* + +**wall time: 3.02s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [53 more display lines; full output is 8279 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --ensemble --limit=8` + +*The family join: per function, which of four orthogonal evidence families fire, ranked by how many agree.* + +**wall time: 6.52s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [36 more display lines; full output is 7516 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --field-affinity` + +*The cache-locality lens over every aggregate: fields READ TOGETHER but declared FAR APART (split-line / straddle findings, Chilimbi separation weight) — advice only, never a rewrite.* + +**wall time: 3.69s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [1639 more display lines; full output is 154933 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --field-affinity=Symbol` + +*The same lens narrowed to ONE struct — the one --layout=Symbol shows the offsets for.* + +**wall time: 2.23s** + +````` + + + + + + + + + + + + + + + + + +````` + +## `./build/ripwire . --naming-consistency --limit=8` + +*The corpus's OWN case-convention vote per (language, kind) group; off-convention names get a mechanical propose= (a suggestion, never a blind rename).* + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [13 more display lines; full output is 4390 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --naming-calibration` + +*Score the naming-* rules against this repo's own rename history: proxy=old/(old+new) per rule, 0.50 = chance; read pairs= (sample size) first.* + +**wall time: 21.28s** + +````` + + + + + + + + + + + +

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+… [187 more display lines; full output is 18275 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --lint --naming-locals` + +*The opt-in --lint modifier: naming predicates over LOCAL variable names too, C/C++ only, only inside functions already past a size/complexity gate.* + +**wall time: 3.69s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [640 more display lines; full output is 72767 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --lint-catalog` + +*The built-in rule registry — one row per rule with sev=/category=/rationale/lang=/since=; no corpus needed.* + +````` + + +a C-style cast — cppcoreguidelines-pro-type-cstyle-cast prefers the explicit static_cast/const_cast/reinterpret_cast +a goto statement — cppcoreguidelines-avoid-goto +a do/while loop shape (on Swift, its do/catch block shares the same grammar node and also matches) +a call to an unbounded C string function (strcpy/strcat/sprintf/gets) +a call to a broken hash or cipher (MD5/SHA1/MD4/RC4) +a doubly-parenthesized expression — readability-redundant-parentheses +an if-body that is just `;` — bugprone-suspicious-semicolon +a C-style typedef struct/union where `using` is preferred +a non-trivial numeric literal inside a function body, outside a const/constexpr init +a catch block with an empty body +x = x — almost always a copy-paste bug +a function body over 80 lines +brace nesting depth over 4 inside a function body +a bare `return;` mixed with a value-returning return in the same function +a statement after an unconditional return/break/continue/throw/raise in the same block +a 1-2 letter Function/Method/Var name — visible far beyond any tiny scope [Beniamini/Hofmeister] +more than 5 words in one name; a k or C-family g_/m_/s_ marker prefix is not a word [Butler; AlSuhaibani] +foo1/foo2/... digit-suffix siblings sharing a base name in one scope [Butler] +internal consecutive underscores, or a C-family reserved __x/_X form [Butler] +snake_case and camelCase mixed inside one name [Butler] +an is/has/can/should/was-prefixed name whose KNOWN return type is not bool-like [LAPD A2] +a set-prefixed name whose KNOWN return type is not void-like [LAPD A3] +a co-visible pair within edit distance <=2, reordered tokens, or a bare/digit-suffixed twin [Namesake] +every split subtoken is corpus-ubiquitous (BM25 idf) on a body past the size floor — fires only at the low end [Sparck Jones 1972] +the comma operator inside an expression (never a for-header comma) [Gopstein FSE 2017] +++/-- evaluated inside a larger expression (never a whole statement) [Gopstein FSE 2017] +an assignment whose VALUE is consumed (a condition, an argument, ...) [Gopstein FSE 2017] +a conditional expression inside a conditional expression [Gopstein FSE 2017] +… [12 more display lines; full output is 7847 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --legend-dict` + +*The session legend dictionary the MCP server serves as ripwire://legend-dict/full — one definition per line, headed by its dictv= version; no corpus needed. =roster lists the completeness attributes it defines.* + +````` +ripwire legend dictionary ripwire.dict/v1 dictv=ff6a8ec8438b7fe0 entries=1176 +: this LAST child is only the legend pointer; the root keeps every attribute it carries inline, unchanged (schema=, each count, cut and floor); rows follow it; legend="ref": a definition is sent once per session (this dictionary's core, or the first answer that needs … [line truncated: 80 more bytes on this line] +schema=ripwire.KEY/v1: the line ripwire.KEY/v1 below reads the answer's rows +window: shown= total= capped= has_more= next_offset= offset= limit= page a list (capped=1 cut; next_offset= pastes as offset=) +X_capped= (any attribute ending _capped): 1 = cut +under ref, est_tokens= and over_ceiling= price the answer with its inline legend: an upper bound +under ref, a group of n <= 8 runner-less rows prints as its n single rows, each run_unknown=1 +ripwire.map/v1 : ranked symbol map: groups rows (k= rank), resolved callees; the header comment is data +ripwire.map-diff/v1 : the ranked map anchored at at=: what the diff touched, the map's row vocabulary +ripwire.metrics/v1 : the ranked map with per-symbol metrics +ripwire.around/v1 : call neighbourhood of of=: depth= hops, fanout= kept per hop; absent rows lie outside that boundary +ripwire.query/v1 : lexical-rank map for the query term, the map's row vocabulary +ripwire.pack-signatures/v1 : the ranked map plus signature rows +ripwire.pack-top-n/v1 : the ranked map plus bodies of the top-N symbols +ripwire.skipped/v1 : why the index lacks a file ; indexed but unvouched ; census +ripwire.notes/v1 : field notes by target: holds ; the kept count comment: notes= rows, targets= rows, dangling= targets matching nothing indexed (listed, surfaced nowhere) +ripwire.lego/v1 : ONE interface/base type: , its method contract, every implementor +ripwire.expand/v1 : full bodies: of ; resolved callees (p= when not the b's file) +ripwire.expand-file/v1 : the file's own text: ; per scoped symbol; full id = p::sc::n +ripwire.candidate-page/v1 : budgeted-bundle candidate page: a resumable window over the ranked candidate set the bundle cuts, for task= under budget_tokens=, one tier per page, ranks global across pages +ripwire.pack-task/v1 : one-call task bundle for task= under budget_tokens=: ranking, ranked but over 1 hop out (of_top= ranked rows) > with callees > 1-hop from the bodies … [line truncated: 108 more bytes on this line] +ripwire.from-trace/v1 : trace frames mapped to indexed symbols, innermost first; the innermost in-corpus body included +ripwire.exemplar/v1 : the best-in-class instance of kind= for the task, chosen by role: , to imitate +ripwire.pack-task/v1 : N minimally overlapping agent bundles carved along call-graph communities plus one shared core; each wraps a ; bundle role=core|partition i= symbols= modules= bytes= tokens=: one agent's ctx, symbols= ids assigned, bytes= its size; tokens= = est_t … [line truncated: 345 more bytes on this line] +ripwire.callers/v1 : 1-hop CALLERS of of= (defs= matched, count= distinct symbols): ; hop_tested=/hop_untested= +ripwire.callees/v1 : 1-hop CALLEES of of= (defs= matched, count= distinct symbols): +ripwire.uses/v1 : resolvable use-sites of of=: +ripwire.impact/v1 : transitive blast radius of of=: reach set, importers; defs= matched, reaches= their transitive callers, radius_tested= non-tests an indexed test reaches, radius_untested= the rest; importers= files that #include/import a def's file +ripwire.defs/v1 : per the parsed definitions the name binds (defs= groups; a prototype with its definition is one): , sel= binds that one alone in any SYM verb, in= distinct callers (a floor); source first, then in=, then path +ripwire.path/v1 : one DIRECTED call path from= to to=, each a hop; reachable=0 hops=0 when none shown +… [1147 more display lines; full output is 134933 bytes on 1177 raw line(s)] +````` + +## `./build/ripwire . --lint --lint-select=cache-` + +*Run ONLY one rule family; the root carries selected="K of N" so a filtered zero is never confusable with an unfiltered one.* + +**wall time: 4.94s** + +````` + + + + + + + + + + +vector<std::vector<double>> +nodes[ perm[i] ] +nodes[ perm[ i + 1 ] ] +p = p->next +map +byName[ symN[i] ] +vector<std::vector<std::vector<std::uint32_t>>> +vector<std::vector<std::uint32_t>> +m[ symN[id] ] +vector<std::vector<double>> +m[ in.keys[ i ] ] +map +vector<std::vector<std::vector<std::uint32_t>>> +vector<std::vector<std::uint32_t>> +m[ symN[id] ] +map +m[ g_pool[ g_keyOf[i] ] ] +g_pool[ g_readOf[i] ] +g_pool[ g_readOf[i] ] +m[ g_pool[i] ] +… [612 more display lines; full output is 72931 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --lint --lint-ignore=naming-,cache-` + +*DROP two families, applied after selection; the raw select=/ignore= you passed rides on the root.* + +**wall time: 2.41s** + +````` + + + + + + + + + + + + + + + + + + + + + + + +0.5 +1023u +main (90 lines) +20 +delta < 0.02 && delta > -0.02 +0.02 +… [708 more display lines; full output is 67272 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --lint --lint-select=goto --lint-max-per-rule=4` + +*A rule that spends its own match budget (here 4, set BELOW the default 5000 so the floor shows on this repo): goto carries count_capped="1", its count= is a FLOOR, and the root names the call that counts the rest — findings_next= re-runs only the floored rules under a 10x budget.* + +**wall time: 2.74s** + +````` + + + +goto epilogue; +goto epilogue; +goto epilogue; +goto epilogue; + +````` + +## `./build/ripwire . --lint --lint-select=goto --lint-max-per-rule=40` + +*Pasting that findings_next=: the same rule under a 10x budget counts its true total — no count_capped=, no findings_next=.* + +**wall time: 2.54s** + +````` + + + +goto epilogue; +goto epilogue; +goto epilogue; +goto epilogue; +goto epilogue; +goto epilogue; +goto epilogue; +goto epilogue; +goto epilogue; +goto epilogue; +goto epilogue; +goto epilogue; +goto error; +goto error; +goto error; +goto done; +goto done; + +````` + +## `./build/ripwire . --lint --lint-select=cach-` + +*An unresolvable PREFIX refuses (exit 1) with a did-you-mean from a real edit distance (one character off cache-).* + +**exit code: 1** — **wall time: 2.63s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --lint-select: 'cach-' matches no rule or family (did you mean 'cache-'?) — see --lint-catalog for the full registry +````` + +## `./build/ripwire . --lint --lint-select=nosuchfamily` + +*A PREFIX with no near miss at all: the refusal points at --lint-catalog instead of guessing.* + +**exit code: 1** — **wall time: 2.57s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --lint-select: 'nosuchfamily' matches no rule or family — see --lint-catalog for the full registry +````` + +## `./build/ripwire . --lint --sarif` + +*The SAME findings as SARIF 2.1.0 (what github/codeql-action/upload-sarif consumes) — pure re-serialization, results count == the native run's.* + +**wall time: 2.26s** + +````` +{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"ripwire","rules":[{"id":"c-style-cast","shortDescription":{"text":"c-style-cast"},"properties":{"builtin":true,"capped":false,"applicable": … [line truncated: 7 more bytes on this line] +{"id":"goto","shortDescription":{"text":"goto"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"do-while","shortDescription":{"text":"do-while"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"unsafe-c-fn","shortDescription":{"text":"unsafe-c-fn"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"weak-crypto","shortDescription":{"text":"weak-crypto"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"redundant-parens","shortDescription":{"text":"redundant-parens"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"suspicious-semicolon","shortDescription":{"text":"suspicious-semicolon"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"typedef-over-using","shortDescription":{"text":"typedef-over-using"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"magic-number","shortDescription":{"text":"magic-number"},"properties":{"builtin":true,"capped":true,"applicable":true}}, +{"id":"empty-catch","shortDescription":{"text":"empty-catch"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"self-assign","shortDescription":{"text":"self-assign"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"large-function","shortDescription":{"text":"large-function"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"deep-nesting","shortDescription":{"text":"deep-nesting"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"inconsistent-return","shortDescription":{"text":"inconsistent-return"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"unreachable-code","shortDescription":{"text":"unreachable-code"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"naming-short","shortDescription":{"text":"naming-short"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"naming-wordy","shortDescription":{"text":"naming-wordy"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"naming-series","shortDescription":{"text":"naming-series"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"naming-underscore","shortDescription":{"text":"naming-underscore"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"naming-case","shortDescription":{"text":"naming-case"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"naming-predicate","shortDescription":{"text":"naming-predicate"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"naming-setter","shortDescription":{"text":"naming-setter"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"naming-confusable","shortDescription":{"text":"naming-confusable"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"naming-uninformative","shortDescription":{"text":"naming-uninformative"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"atom-comma-operator","shortDescription":{"text":"atom-comma-operator"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"atom-embedded-crement","shortDescription":{"text":"atom-embedded-crement"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"atom-assign-as-value","shortDescription":{"text":"atom-assign-as-value"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"atom-nested-ternary","shortDescription":{"text":"atom-nested-ternary"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"atom-implicit-predicate","shortDescription":{"text":"atom-implicit-predicate"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +{"id":"atom-octal-literal","shortDescription":{"text":"atom-octal-literal"},"properties":{"builtin":true,"capped":false,"applicable":true}}, +… [17159 more display lines; full output is 2436418 bytes on 1 raw line(s)] +````` + +Parsed summary of the same SARIF (past the display cut): + +````` +sarif 2.1.0 rules= 39 results= 8575 +````` + +## `./build/ripwire . --lint --sarif --limit=5` + +*SARIF is always the FULL result set: paging alongside it refuses loudly.* + +**exit code: 1** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --sarif always emits the full result set — drop --limit=N/--offset=M +````` + +## `./build/ripwire . --dmm` + +*The Delta Maintainability Model scalar for the WORKING TREE vs HEAD — recorded against a CLEAN tree (the sandbox section shows a real delta). UNAVAILABLE is a stated reason, never 0 or 1.* + +**wall time: 10.30s** + +````` + + +

+

+ +````` + +## `./build/ripwire . --dmm=HEAD` + +*The per-commit scalar: HEAD vs its first parent, with the three separately actionable sub-scores.* + +**wall time: 18.88s** + +````` + + +

+

+ +````` + +## `./build/ripwire . --dmm=HEAD~3..HEAD` + +*The range form: tree HEAD vs tree HEAD~3.* + +**wall time: 22.47s** + +````` + + +

+

+ +````` + +## `./build/ripwire . --cochange --cochange-groups` + +*Modularity-violation GROUPS instead of pairs: "X co-changes with {A,B,C}, none of which it depends on" — a greedy cover, disclosed as greedy.* + +**wall time: 5.07s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [1002 more display lines; full output is 67536 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --cochange --cochange-recur=2` + +*Only pairs whose co-change RECURS in 2+ sub-windows of the mined window (sub_windows= is the denominator) — a one-off sprint stops reading like a structural defect.* + +**wall time: 4.95s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +````` + +## `./build/ripwire . --html=/aux/map2.html --color-by=community` + +*The HTML graph with the initial colour mode set to community (the page embeds all five modes and keeps a live selector).* + +**wall time: 5.80s** + +````` +(empty) +````` + +Artifact written: + +````` + 155374 /aux/map2.html +````` + +## `./build/ripwire . --index-out=/aux/ci_index` + +*CI generate-and-exit: cold-parse and write BOTH committable cache families (lean + rich), no map on stdout.* + +**wall time: 8.66s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --index-out wrote /aux/ci_index.lean.ripwirecache (40244008 bytes, lean family) +ripwire: --index-out wrote /aux/ci_index.rich.ripwirecache (81040874 bytes, rich family) +````` + +Artifact written: + +````` + 40244008 /aux/ci_index.lean.ripwirecache + 81040874 /aux/ci_index.rich.ripwirecache + 121284882 total +````` + +## `./build/ripwire . --cache=/aux/ci_index.lean.ripwirecache --top-k=3` + +*Consume the lean artifact in a PR job: restore-equivalence, never blob-byte-identity.* + +**wall time: 4.48s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [80 more display lines; full output is 10040 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --pin-census=/aux/pin_census.tsv --top-k=3` + +*Eval-only: a per-call-site census of WHICH mechanism resolved each call, and the canonical id of every surviving target.* + +**wall time: 3.43s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [80 more display lines; full output is 10040 bytes on 1 raw line(s)] +````` + +Artifact written: + +````` +# ripwire pin-census v3 C=kind\tmech\tpre\tpost\tflags\tcaller_id\tcallee\ttargets(|-sep)\tline +# v3 field escape: every id and callee field is escaped, so no separator occurs inside one. A backslash is +# written \\, TAB \t, LF \n, CR \r, every other control byte 0x00-0x1f and the targets separator | as \xHH +# (lowercase hex). Split lines on LF, fields on TAB and targets on |, THEN decode. Columns are unchanged +# from v2 and an id without those bytes is spelled exactly as in v2; a C++ out-of-line template member +# whose template-argument list spans lines keeps its line break as \n instead of splitting the row. +# line is the 1-based call-site line in the caller's file (v2, appended LAST so v1 readers are unchanged): +# the key a SCIP occurrence joins on, so a coverage loss can be classified per site instead of guessed. + 179596 /aux/pin_census.tsv +````` + +## `./build/ripwire . --plan-lint=test/planlintfix/wave.md` + +*The house PLAN/DESIGN format's STRUCTURE check — never semantics; exit 2 when a card or ledger row gates.* + +**exit code: 2** — **wall time: 5.20s** + +````` + + + + + + + + + + + + + +````` + +## `./build/ripwire . --plan-lint=test/planlintfix/wave_ledger.md` + +*The ledger-shaped fixture through the same check (exit 2: one gating card).* + +**exit code: 2** — **wall time: 3.99s** + +````` + + + + + + + +````` + +## `./build/ripwire . --doctor --agent=claude` + +*--doctor plus a LIVE integration inspection for one agent: PATH binary, installed-skill manifest parity, hook executability, MCP wiring — read-only, fixed repair commands, never config contents; exit 1 when any check fails.* + +**exit code: 1** — **wall time: 36.57s** + +````` + + + + + + + + + + + + + +````` + +## `./build/ripwire . --doctor --agent=nosuch` + +*Other --agent values refuse.* + +**exit code: 1** + +````` +(empty) +````` + +stderr: + +````` +ripwire: unsupported --agent value 'nosuch' (supported: codex, claude) +````` + + +--- + +# the dirty-tree verbs (throwaway clone, NOT the read-only repo) + +Everything below runs with `cwd` = the throwaway clone at `/dirty` (`git clone --local` of this repo, then one deliberate regression in `src/infra/sortutil.h`). The read-only repo is never touched. The binary is the same `build/ripwire`, addressed absolutely. + +## `./build/ripwire . --situ` + +*Situational report for a real diff: blast radius + tests + co-change + forgotten co-change partners.* + +**wall time: 16.84s** + +````` +ripwire situational-awareness — 1 changed file(s), 14 symbols in them +root: . +at: b0cb13d8d+dirty + change_set: granularity=file changed_symbols=14 file_symbols=14 files_narrowed=0 files_file_granular=1 diff_hunks=7 diff_hunks_located=6 diff_hunks_unlocated=1 — seeds = symbols a diff -U0-vs-HEAD hunk overlaps (function/method body spans only); an unlocated hunk (module-level, deletion, rename) … [line truncated: 34 more bytes on this line] + [1] blast radius: 1043 symbols across 150 files transitively depend on these changes (showing 8 of 150 files — shown=8 total=150 capped=1 prcontext_cap=20 (--pr-context's own per-file list is cut at 20 too); next: --situ --limit=150) + counts_floor=1 graph_ambiguous=3637 graph_unresolved=20080 graph_unindexed=311 (files no grammar in this build could read at all) (the map header's own gauges) — every count above is a FLOOR, never a total: call edges are name-based, so dynamic dispatch, callbacks and macros can be missing … [line truncated: 45 more bytes on this line] + src/graph.h (59 dependent symbols) + src/mcpverbs.h (41 dependent symbols) + src/quality.h (41 dependent symbols) + src/verbs_for.h (33 dependent symbols) + src/backhops.h (31 dependent symbols) + src/slice.h (31 dependent symbols) + src/crossref.h (28 dependent symbols) + src/resolve.h (26 dependent symbols) + [2] tests to run (12) order=evidence: [changed] you edited it, [partner] named after a changed file, then hops asc (1 = direct); "(n): a, b" = n runner-less files sharing that evidence; a (run: …) is relative to root: + test/verify_radix.cpp [hops=1] (run: bash test/greptiercheck.sh) + test/adaptivecutshapefix/adaptive_cut_shape_test.cpp [hops=2] (run: bash test/adaptivecutshapecheck.sh) + test/connectcore_harness.cpp [hops=2] (run: bash test/connectcorecheck.sh) + test/forrowfeatures_unit.cpp [hops=2] (run: bash test/forrowfeaturescheck.sh) + test/fuzz/readers/readers_domain.cpp [hops=2] (run: not derivable) + test/verify_csr.cpp [hops=2] (run: bash test/a9disclosurecheck.sh) + test/cloneband_harness.cpp [hops=3] (run: bash test/clonebandcheck.sh) + test/shstatus_harness.cpp [hops=3] (run: bash test/gateexitcheck.sh) + test/type3clone_harness.cpp [hops=3] (run: bash test/type3clonecheck.sh) + test/includeprecise_unit.cpp [hops=4] (run: bash test/includeprecisecheck.sh) + test/rustimport_unit.cpp [hops=4] (run: bash test/rustimportprecisecheck.sh) + test/fuzz/readers/readers_light.cpp [hops=5] (run: not derivable) + script_gates_unmodelled=946 — test/*.sh gates never appear above: script-to-binary edges are not call edges (a path count) + [3] co-change — usually edited with these but NOT in your diff (0) window="18mo@HEAD" commits="7863": + (none — 7863 commits were mined and none co-edited a file outside your diff) + next: --test-gate +````` + +## `./build/ripwire . --test-gate` + +*The pre-PR gate with real obligations — exit 4 when tests-to-run or untested blast radius is non-empty.* + +**exit code: 4** — **wall time: 14.26s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +````` + +## `./build/ripwire . --quality-delta` + +*Every row carries p="file:line", the gating rows are marked gating="1" and now bar= (the threshold each numeric row is judged against), and the exit-2 refusal prints a naming line on stderr; a gating row carries a pasteable next=.* + +**exit code: 2** — **wall time: 54.88s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [175 more display lines; full output is 20654 bytes on 1 raw line(s)] +````` + +stderr: + +````` +ripwire: no ./.ripwire_quality_baseline — auto-comparing the working tree vs git HEAD (commit the baseline with --quality-baseline to pin it) +ripwire: --quality-delta gating: 5 preexisting-worse major finding(s); first: api-surface src/infra/sortutil.h::rw::sortutil::nonNegativeFloatDescKey at src/infra/sortutil.h:122 (was=1 now=2) +````` + +## `./build/ripwire . --quality-delta --legend=full` + +*The same gating report under --legend=full — same rows, same exit 2; the default compact comment (schema="ripwire.quality-delta/v1", the shape an agent's edit loop should run) becomes ~4 KB of prose legend.* + +**exit code: 2** — **wall time: 30.82s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [175 more display lines; full output is 26130 bytes on 1 raw line(s)] +````` + +stderr: + +````` +ripwire: no ./.ripwire_quality_baseline — auto-comparing the working tree vs git HEAD (commit the baseline with --quality-baseline to pin it) +ripwire: --quality-delta gating: 5 preexisting-worse major finding(s); first: api-surface src/infra/sortutil.h::rw::sortutil::nonNegativeFloatDescKey at src/infra/sortutil.h:122 (was=1 now=2) +````` + +## `./build/ripwire . --quality-delta --json` + +*The same findings as JSON (one of the CI/scripting verbs --json supports) — same exit 2 as the XML form.* + +**exit code: 2** — **wall time: 29.88s** + +````` +{"baseline":"git-HEAD","regressions":9,"minor":1,"acked":0,"stale":193,"preexisting-worse":6,"new-symbol":3,"gating":5,"register-macro-excluded":63,"api-new-surface":2,"at":"b0cb13d8d+dirty","renames":68,"rename_window_commits":400,"acked_by_rename":0,"acked_by_content":0,"renames_window_truncated": … [line truncated: 240 more bytes on this line] +{"kind":"complexity","sym":"src/infra/sortutil.h::rw::sortutil::lessByScoreDescId","was":1,"now":67,"p":"src/infra/sortutil.h:62","gating":true}, +{"kind":"dead-code","sym":"src/infra/sortutil.h::rw::sortutil::nonNegativeFloatAscKeyCopy","p":"src/infra/sortutil.h:132","origin":"new-symbol"}, +{"kind":"dead-code","sym":"src/infra/sortutil.h::rw::sortutil::sortScoredIdsWithOptions","p":"src/infra/sortutil.h:142","origin":"new-symbol"}, +{"kind":"duplication","members":"src/infra/sortutil.h::rw::sortutil::nonNegativeFloatAscKeyCopy | src/infra/sortutil.h::rw::sortutil::nonNegativeFloatDescKey","tokens":59,"p":"src/infra/sortutil.h:132","gating":true}, +{"kind":"nesting","sym":"src/infra/sortutil.h::rw::sortutil::lessByScoreDescId","was":1,"now":6,"p":"src/infra/sortutil.h:62","gating":true}, +{"kind":"new-clone-of-reused-helper","sym":"src/infra/sortutil.h::rw::sortutil::nonNegativeFloatAscKeyCopy | src/infra/sortutil.h::rw::sortutil::nonNegativeFloatDescKey","was":0,"now":4,"p":"src/infra/sortutil.h:132","gating":true}, +{"kind":"params","sym":"src/infra/sortutil.h::rw::sortutil::sortScoredIdsWithOptions","was":0,"now":8,"p":"src/infra/sortutil.h:142","origin":"new-symbol"}, +{"kind":"verbosity","sym":"src/infra/sortutil.h::rw::sortutil::lessByScoreDescId","was":8,"now":47,"p":"src/infra/sortutil.h:62","sev":"minor"}], +"sa":[{"kind":"api-surface","key":"085e3d408c2c4a35","why":"target-gone"}, +{"kind":"api-surface","key":"155d74d341a49f3c","why":"target-gone"}, +{"kind":"api-surface","key":"1a15386c2d1e47af","why":"target-gone"}, +{"kind":"api-surface","key":"298e798c7f075715","why":"target-gone"}, +{"kind":"api-surface","key":"56acdf9b5c314a14","why":"target-gone"}, +{"kind":"api-surface","key":"5a07390012b46e06","why":"target-gone"}, +{"kind":"api-surface","key":"6eef859578c8c376","why":"target-gone"}, +{"kind":"api-surface","key":"6f2394762f82a855","why":"target-gone"}, +{"kind":"api-surface","key":"7f2c3eefdf6e512e","why":"target-gone"}, +{"kind":"api-surface","key":"802e513731103806","why":"target-gone"}, +{"kind":"api-surface","key":"b6a24afef32a68a8","why":"target-gone"}, +{"kind":"api-surface","key":"c923e661c197b265","why":"target-gone"}, +{"kind":"api-surface:new-symbol","key":"1926b0d9e94541a0","why":"target-gone"}, +{"kind":"api-surface:new-symbol","key":"1d3814ba687a4aef","why":"target-gone"}, +{"kind":"api-surface:new-symbol","key":"1db76028879244ef","why":"target-gone"}, +{"kind":"api-surface:new-symbol","key":"25c9f0504fd376a4","why":"target-gone"}, +{"kind":"api-surface:new-symbol","key":"26aa7c55d54c4341","why":"target-gone"}, +{"kind":"api-surface:new-symbol","key":"26e3f9a6bff9ea57","why":"target-gone"}, +{"kind":"api-surface:new-symbol","key":"36e39c7ab0fc1686","why":"target-gone"}, +{"kind":"api-surface:new-symbol","key":"4bce64bd920de0c3","why":"target-gone"}, +{"kind":"api-surface:new-symbol","key":"61f0e361ef7dee27","why":"target-gone"}, +… [172 more display lines; full output is 19311 bytes on 1 raw line(s)] +````` + +stderr: + +````` +ripwire: no ./.ripwire_quality_baseline — auto-comparing the working tree vs git HEAD (commit the baseline with --quality-baseline to pin it) +ripwire: --quality-delta gating: 5 preexisting-worse major finding(s); first: api-surface src/infra/sortutil.h::rw::sortutil::nonNegativeFloatDescKey at src/infra/sortutil.h:122 (was=1 now=2) +````` + +## `./build/ripwire . --quality-delta --quality-ack --ack-only=zzznope` + +*NEW FLAG: --ack-only matching nothing REFUSES rather than falling back to acking everything.* + +**exit code: 1** — **wall time: 22.88s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: no ./.ripwire_quality_baseline — auto-comparing the working tree vs git HEAD (commit the baseline with --quality-baseline to pin it) +ripwire: ack provenance backfill — 0 clone row(s) reconstructed from the current tree, 196 re-derived, 39 left UNVERIFIED (their group was not found here — a floor, not proof it is gone), 55 left legacy (member set not found cloning here — a floor, not proof it is gone), 1297 ineligible (no cu … [line truncated: 200 more bytes on this line] +ripwire: --ack-only=zzznope matched none of the 9 finding(s) — nothing written +````` + +## `./build/ripwire . --quality-delta --quality-ack --ack-only=api-surface` + +*NEW FLAG: ack only the api-surface findings — a per-finding ratchet instead of a rubber stamp.* + +**wall time: 25.71s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: no ./.ripwire_quality_baseline — auto-comparing the working tree vs git HEAD (commit the baseline with --quality-baseline to pin it) +ripwire: ack provenance backfill — 0 clone row(s) reconstructed from the current tree, 196 re-derived, 39 left UNVERIFIED (their group was not found here — a floor, not proof it is gone), 55 left legacy (member set not found cloning here — a floor, not proof it is gone), 1297 ineligible (no cu … [line truncated: 200 more bytes on this line] +ripwire: acknowledged 1 of 9 finding(s) (8 left UNACKED by --ack-only, 0 already acked) → ./.ripwire_quality_acks +````` + +## `./build/ripwire . --quality-delta` + +*Re-run after the partial ack: acked=3, the rest still gate (exit 2).* + +**exit code: 2** — **wall time: 35.34s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [174 more display lines; full output is 20357 bytes on 1 raw line(s)] +````` + +stderr: + +````` +ripwire: no ./.ripwire_quality_baseline — auto-comparing the working tree vs git HEAD (commit the baseline with --quality-baseline to pin it) +ripwire: --quality-delta gating: 4 preexisting-worse major finding(s); first: complexity src/infra/sortutil.h::rw::sortutil::lessByScoreDescId at src/infra/sortutil.h:62 (was=1 now=67) +````` + +## `./build/ripwire . --ack-only=gating` + +*--ack-only WITHOUT --quality-ack REFUSES loudly (exit 1, the pairing named) — it used to be silently ignored.* + +**exit code: 1** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --ack-only=SUBSTR narrows --quality-ack — pass both (e.g. ripwire

--quality-delta --ack-only=contract-change --quality-ack="reason") +````` + +## `./build/ripwire . --edit-check=nonNegativeFloatDescKey` + +*A real contract-change: was=1 now=2 params, with the call sites that are now provably incompatible, and a pasteable next= (--uses=SYM) on the root.* + +**wall time: 5.05s** + +````` + + + + + + +````` + +## `./build/ripwire . --edit-check=nonNegativeFloatDescKey --legend=full` + +*The same verdict under --legend=full: the default's one compact comment (the post-edit reflex at its cheapest) becomes ~5.7 KB of prose legend, every row identical.* + +**wall time: 5.57s** + +````` + + + + + + +````` + +## `./build/ripwire . --pr-context` + +*The review-evidence bundle with an actual changed file.* + +**wall time: 10.91s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [107 more display lines; full output is 10223 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --map-diff --top-k=5` + +*The map re-ranked with a teleport toward the changed file (changed=1 here, not 0).* + +**wall time: 6.26s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + +````` + +## `./build/ripwire . --clones` + +*The duplicated helper the sandbox edit introduced shows up as a clone group.* + +**wall time: 2.44s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [309 more display lines; full output is 16373 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --stray-content=zz-orphan` + +*CHANGED: a ref with NO merge base with HEAD now reports v="unknown" ok="0" in its own bucket — the absence of an answer, never a claim it is merged. (The sandbox carries a deliberately parentless branch built with `git commit-tree`; a shallow CI clone puts every ref here.)* + +**wall time: 6.71s** + +````` + + + + + +````` + +stderr: + +````` +[math degraded] crossref: no merge-base for ref (shallow clone or unrelated history?) — verdict is unknown, not merged (crossref.h:1750, std::vector rw::crossref::probeRefBases(const std::string &, const std::vector &, const std::string &) — logged once per site) +````` + +## `./build/ripwire . --stray-content=zz-orphan --plan` + +*CHANGED: --plan surfaces those same refs as an row rather than silently dropping them.* + +**wall time: 8.27s** + +````` + + + + +````` + +stderr: + +````` +[math degraded] crossref: no merge-base for ref (shallow clone or unrelated history?) — verdict is unknown, not merged (crossref.h:1750, std::vector rw::crossref::probeRefBases(const std::string &, const std::vector &, const std::string &) — logged once per site) +````` + +## `./build/ripwire . --dmm` + +*The DMM scalar on a REAL delta: the sandbox edit grew one unit past the nesting/complexity thresholds and added an 8-parameter one, so dmm is low and the three sub-scores say which property moved.* + +**wall time: 15.21s** + +````` + + +

+

+ +````` + +## `./build/ripwire . --quality-delta --scope=src/graph.h` + +*OWNERSHIP partition for a shared tree: every regression here lives in src/infra/, so under a scope naming src/graph.h they ALL print under with a do-not-ack banner and never gate — scoped-out-gating= says how many would have.* + +**wall time: 35.35s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [177 more display lines; full output is 20624 bytes on 1 raw line(s)] +````` + +stderr: + +````` +ripwire: no ./.ripwire_quality_baseline — auto-comparing the working tree vs git HEAD (commit the baseline with --quality-baseline to pin it) +````` + +## `./build/ripwire . --quality-delta --quality-ack --scope=src/graph.h --ack-only=api-surface` + +*The rubber-stamp guard: an --ack-only that names an OUT-OF-SCOPE row refuses (exit 1) and writes nothing.* + +**exit code: 1** — **wall time: 25.15s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: no ./.ripwire_quality_baseline — auto-comparing the working tree vs git HEAD (commit the baseline with --quality-baseline to pin it) +ripwire: --ack-only=api-surface selects 1 finding(s) OUT OF SCOPE for --scope=src/graph.h — refusing, and writing nothing at all: + api-surface src/infra/sortutil.h::rw::sortutil::nonNegativeFloatDescKey at src/infra/sortutil.h:122 + those rows belong to whoever is editing those paths. Acking them here writes their debt into a committed ledger under YOUR + reason string, which is how a per-finding ratchet becomes a rubber stamp. Narrow the pattern, or widen the scope if they really are yours. +````` + +## `./build/ripwire . --handoff` + +*The continuation packet with a REAL diff: verified changed symbols + blast radius + tests-to-run, then the heuristic rows.* + +**wall time: 12.34s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [11 more display lines; full output is 2681 bytes on 1 raw line(s)] +````` + +## `./build/ripwire . --note-add="lessByScoreDescId: keep this branch-free — it sits inside the PageRank sort comparator"` + +*Pin a field note (write-side memory) to a symbol; committed to .ripwire_notes in the sandbox. The BARE name is resolved through the same resolver the read verbs use and stored as the canonical id — the rewrite is echoed on stderr, because a silent one is not a disclosure.* + +**wall time: 3.01s** + +````` +src/infra/sortutil.h::rw::sortutil::lessByScoreDescId 2026-11-20 keep this branch-free — it sits inside the PageRank sort comparator b0cb13d8d80ed7a0219eca835d53a9e97ec1613d integration/train-ge2 +````` + +stderr: + +````` +ripwire: --note-add: tip: notes that say "chose X over Y because Z" surface better — consider adding the why +ripwire: --note-add: target 'lessByScoreDescId' canonicalised to 'src/infra/sortutil.h::rw::sortutil::lessByScoreDescId' — that is the id --for/--expand key notes by +````` + +## `./build/ripwire . --notes` + +*The note is listed under the canonical id, dangling="0" — i.e. it will actually surface. (Before the H1 fix the bare name was stored verbatim and read dangling="1": recorded, and surfaced nowhere.)* + +**wall time: 1.49s** + +````` + + + + + + + + + + + + + + + + gate scripts' claim (~line 1305) is NOT enforced — the derived-vs-stated sibling loop here covers docs/EVALS.md only. It drifted 407→451 unnoticed (fixed 2026-08-23). To close: grep both files ('file:line:' parsing) in the gateCountClaims arm.]]> + + + + +````` + +## `./build/ripwire . --note-add="gitOneLine: which one?"` + +*Two definitions carry this name, so the write REFUSES rather than pick one: a note keys ONE canonical id, and an ambiguous selector is refused, never silently narrowed. Every candidate is named, with a runnable retry.* + +**exit code: 1** — **wall time: 1.09s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --note-add: tip: notes that say "chose X over Y because Z" surface better — consider adding the why +ripwire: --note-add: target 'gitOneLine' is ambiguous — it matches 2 definitions in 2 distinct contracts, and a note keys ONE canonical id (it would surface on one of them and look absent on the rest). Qualify one: ./src/handoff.h:gitOneLine, ./src/quality.h:gitOneLine — e.g. --note-add="./src/h … [line truncated: 33 more bytes on this line] +````` + +## `./build/ripwire . --note-add="lessByScoreDescIdd: typo"` + +*A name that resolves to nothing is refused with the read verbs' own did-you-mean — never written as a dead note.* + +**exit code: 1** — **wall time: 3.23s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --note-add: tip: notes that say "chose X over Y because Z" surface better — consider adding the why +ripwire: --note-add: target not found: lessByScoreDescIdd (did you mean 'lessByScoreDescId'?) (note: the lexical definition scan stopped at its budget, 4096 files or 16 MiB, before reading every file, so this miss is not proof the bytes define nothing; --grep=lessByScoreDescIdd lists its text uses) … [line truncated: 170 more bytes on this line] +````` + +## `./build/ripwire . --note-add="src/infra/sortutil.h::rw::sortutil::lessByScoreDescId: chose the flat two-branch compare over the nested ladder because the comparator sits inside the PageRank sort"` + +*The same symbol addressed by its CANONICAL id: already canonical, so nothing is rewritten and both notes land on ONE target.* + +**wall time: 2.37s** + +````` +src/infra/sortutil.h::rw::sortutil::lessByScoreDescId 2026-11-20 chose the flat two-branch compare over the nested ladder because the comparator sits inside the PageRank sort b0cb13d8d80ed7a0219eca835d53a9e97ec1613d integration/train-ge2 +````` + +## `./build/ripwire . --expand=lessByScoreDescId --top-k=0` + +*Both notes riding along with the symbol's body — the elements follow the body, past the display cut, so they are extracted below.* + +**wall time: 1.78s** + +````` + + + + + + + + + +````` + +## `./build/ripwire . --replace-symbol-body=lessByScoreDescId --edit-payload=/aux/empty_payload.h` + +*An EMPTY payload refuses — it never implies deletion.* + +**exit code: 1** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --edit-payload is empty; empty never means delete +````` + +## `./build/ripwire . --replace-symbol-body=lessByScoreDescId --edit-payload=/aux/payload_lessByScoreDescId.h` + +*Whole-symbol replace without a whole-file read: the payload is the ORIGINAL flat body, so this edit undoes the sandbox's deep-nesting regression. The receipt's span is the POST-edit byte range; replaced_bytes counts the old bytes overwritten.* + +**wall time: 16.85s** + +Input file: + +````` +inline bool lessByScoreDescId( const std::vector& scores, std::uint32_t a, std::uint32_t b ) noexcept +{ + if( scores[a] != scores[b] ) + { + return scores[a] > scores[b]; + } + return a < b; +} +````` + +````` +{"applied":"replace_symbol_body","symbol":"lessByScoreDescId","file":"src/infra/sortutil.h","span":{"start":2923,"end":3136},"lines":{"start":62,"end":69},"replaced_bytes":1718,"old_file_bytes":10679,"new_file_bytes":9174,"file_eol":"lf","eol_normalized":false,"trailing_newline_folded":true,"separat … [line truncated: 725 more bytes on this line] +"graph_ambiguous":3637,"graph_unresolved":20080,"graph_unindexed":311,"counts_floor":true},"tests_to_run":[{"p":"test/verify_radix.cpp","hops":1,"run":"bash test/greptiercheck.sh"}, +{"p":"test/adaptivecutshapefix/adaptive_cut_shape_test.cpp","hops":2,"run":"bash test/adaptivecutshapecheck.sh"}, +{"p":"test/connectcore_harness.cpp","hops":2,"run":"bash test/connectcorecheck.sh"}, +{"p":"test/forrowfeatures_unit.cpp","hops":2,"run":"bash test/forrowfeaturescheck.sh"}, +{"p":"test/fuzz/readers/readers_domain.cpp","hops":2,"run_unknown":true}, +{"p":"test/verify_csr.cpp","hops":2,"run":"bash test/a9disclosurecheck.sh"}, +{"p":"test/cloneband_harness.cpp","hops":3,"run":"bash test/clonebandcheck.sh"}, +{"p":"test/shstatus_harness.cpp","hops":3,"run":"bash test/gateexitcheck.sh"}, +{"p":"test/type3clone_harness.cpp","hops":3,"run":"bash test/type3clonecheck.sh"}, +{"p":"test/includeprecise_unit.cpp","hops":4,"run":"bash test/includeprecisecheck.sh"}, +{"p":"test/rustimport_unit.cpp","hops":4,"run":"bash test/rustimportprecisecheck.sh"}, +{"p":"test/fuzz/readers/readers_light.cpp","hops":5,"run_unknown":true}], +"order":"evidence","partners":0,"run_first":1,"tests":12,"script_gates_unmodelled":946,"graph_ambiguous":3637,"graph_unresolved":20080,"graph_unindexed":311,"counts_floor":true,"next":"bash test/greptiercheck.sh"} +````` + +stderr: + +````` +ripwire: cache : over its 2048 MiB budget — evicted 730 blob(s) of other roots or other ripwire builds (this build's blobs for this root are kept) +ripwire edit: applied atomically; receipt carries region, blob_sha, edit_check, tests_to_run; next: bash test/greptiercheck.sh +````` + +## `./build/ripwire . --edit-check=lessByScoreDescId` + +*The closed loop: contract unchanged (same params, same publicness) after the replace — nothing provably incompatible.* + +**wall time: 6.88s** + +````` + + + + + + + + + + + + +````` + +## `./build/ripwire . --insert-after-symbol=lessByScoreDescId --edit-payload=/aux/payload_note.h` + +*Insert immediately AFTER one uniquely-resolved definition; replaced_bytes=0 because the insert verbs never overwrite. The receipt carries the folded post-edit verification (lines=, edit_check, tests_to_run) so the loop closes in one call.* + +**wall time: 8.62s** + +````` +{"applied":"insert_after_symbol","symbol":"lessByScoreDescId","file":"src/infra/sortutil.h","span":{"start":3136,"end":3224},"lines":{"start":69,"end":71},"replaced_bytes":0,"old_file_bytes":9174,"new_file_bytes":9262,"file_eol":"lf","eol_normalized":false,"trailing_newline_folded":true,"separator_p … [line truncated: 650 more bytes on this line] +"graph_ambiguous":3637,"graph_unresolved":20080,"graph_unindexed":311,"counts_floor":true},"tests_to_run":[{"p":"test/verify_radix.cpp","hops":1,"run":"bash test/greptiercheck.sh"}, +{"p":"test/adaptivecutshapefix/adaptive_cut_shape_test.cpp","hops":2,"run":"bash test/adaptivecutshapecheck.sh"}, +{"p":"test/connectcore_harness.cpp","hops":2,"run":"bash test/connectcorecheck.sh"}, +{"p":"test/forrowfeatures_unit.cpp","hops":2,"run":"bash test/forrowfeaturescheck.sh"}, +{"p":"test/fuzz/readers/readers_domain.cpp","hops":2,"run_unknown":true}, +{"p":"test/verify_csr.cpp","hops":2,"run":"bash test/a9disclosurecheck.sh"}, +{"p":"test/cloneband_harness.cpp","hops":3,"run":"bash test/clonebandcheck.sh"}, +{"p":"test/shstatus_harness.cpp","hops":3,"run":"bash test/gateexitcheck.sh"}, +{"p":"test/type3clone_harness.cpp","hops":3,"run":"bash test/type3clonecheck.sh"}, +{"p":"test/includeprecise_unit.cpp","hops":4,"run":"bash test/includeprecisecheck.sh"}, +{"p":"test/rustimport_unit.cpp","hops":4,"run":"bash test/rustimportprecisecheck.sh"}, +{"p":"test/fuzz/readers/readers_light.cpp","hops":5,"run_unknown":true}], +"order":"evidence","partners":0,"run_first":1,"tests":12,"script_gates_unmodelled":946,"graph_ambiguous":3637,"graph_unresolved":20080,"graph_unindexed":311,"counts_floor":true,"next":"bash test/greptiercheck.sh"} +````` + +stderr: + +````` +ripwire edit: applied atomically; receipt carries region, blob_sha, edit_check, tests_to_run; next: bash test/greptiercheck.sh +````` + +## `./build/ripwire . --insert-after-symbol=lessByScoreDescId --edit-payload=/aux/payload_note.h --no-post-check` + +*The opt-out: the same insert with the folded verification skipped — lines= still rides (it is free), edit_check/tests_to_run do not, and the two pasteable commands stay on stderr.* + +**wall time: 4.86s** + +````` +{"applied":"insert_after_symbol","symbol":"lessByScoreDescId","file":"src/infra/sortutil.h","span":{"start":3136,"end":3224},"lines":{"start":69,"end":71},"replaced_bytes":0,"old_file_bytes":9262,"new_file_bytes":9350,"file_eol":"lf","eol_normalized":false,"trailing_newline_folded":true,"separator_p … [line truncated: 570 more bytes on this line] +````` + +stderr: + +````` +ripwire edit: applied atomically; receipt carries region, blob_sha (post-check skipped); next: --edit-check=src/infra/sortutil.h:lessByScoreDescId +````` + +## `./build/ripwire . --insert-before-symbol=nonNegativeFloatDescKey --edit-payload=/aux/payload_note.h --edit-target-file=src/infra/sortutil.h` + +*Insert BEFORE, with --edit-target-file pinning which same-named definition (here unambiguous — the disambiguator is simply honoured).* + +**wall time: 13.56s** + +````` +{"applied":"insert_before_symbol","symbol":"nonNegativeFloatDescKey","file":"src/infra/sortutil.h","span":{"start":3656,"end":3744},"lines":{"start":87,"end":88},"replaced_bytes":0,"old_file_bytes":9350,"new_file_bytes":9438,"file_eol":"lf","eol_normalized":false,"trailing_newline_folded":false,"sep … [line truncated: 753 more bytes on this line] +{"n":"benchAdaptive","p":"bench/bench_radix_ab.cpp:157","l":[162]}, +{"n":"radixSortNonNegativeFloatsDesc","p":"src/infra/sortutil.h:118","l":[127]}, +{"n":"radixSortByScoreDescId","p":"src/infra/sortutil.h:133","l":[193]}], +"graph_ambiguous":3637,"graph_unresolved":20080,"graph_unindexed":311,"counts_floor":true},"tests_to_run":[{"p":"test/verify_radix.cpp","hops":1,"run":"bash test/greptiercheck.sh"}, +{"p":"test/adaptivecutshapefix/adaptive_cut_shape_test.cpp","hops":2,"run":"bash test/adaptivecutshapecheck.sh"}, +{"p":"test/connectcore_harness.cpp","hops":2,"run":"bash test/connectcorecheck.sh"}, +{"p":"test/forrowfeatures_unit.cpp","hops":2,"run":"bash test/forrowfeaturescheck.sh"}, +{"p":"test/fuzz/readers/readers_domain.cpp","hops":2,"run_unknown":true}, +{"p":"test/verify_csr.cpp","hops":2,"run":"bash test/a9disclosurecheck.sh"}, +{"p":"test/cloneband_harness.cpp","hops":3,"run":"bash test/clonebandcheck.sh"}, +{"p":"test/shstatus_harness.cpp","hops":3,"run":"bash test/gateexitcheck.sh"}, +{"p":"test/type3clone_harness.cpp","hops":3,"run":"bash test/type3clonecheck.sh"}, +{"p":"test/includeprecise_unit.cpp","hops":4,"run":"bash test/includeprecisecheck.sh"}, +{"p":"test/rustimport_unit.cpp","hops":4,"run":"bash test/rustimportprecisecheck.sh"}, +{"p":"test/fuzz/readers/readers_light.cpp","hops":5,"run_unknown":true}], +"order":"evidence","partners":0,"run_first":1,"tests":12,"script_gates_unmodelled":946,"graph_ambiguous":3637,"graph_unresolved":20080,"graph_unindexed":311,"counts_floor":true,"next":"--uses=src/infra/sortutil.h:nonNegativeFloatDescKey"} +````` + +stderr: + +````` +ripwire edit: applied atomically; receipt carries region, blob_sha, edit_check, tests_to_run; next: --uses=src/infra/sortutil.h:nonNegativeFloatDescKey +````` + +## `./build/ripwire . --replace-symbol-body=DoesNotExist --edit-payload=/aux/payload_note.h` + +*An unknown TARGET refuses and leaves every file byte-identical.* + +**exit code: 1** — **wall time: 4.68s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --replace-symbol-body: symbol 'DoesNotExist' not found +````` + +## `./build/ripwire . --edit-plan=/aux/edit_plan.json --dry-run` + +*A versioned multi-edit TRANSACTION preflighted without writing: the receipt shows what each op would read and touch.* + +**wall time: 5.40s** + +Input file: + +````` +{ + "version": 1, + "edits": [ + { + "op": "insert_before_symbol", + "target": "nonNegativeFloatDescKey", + "payload": "plan_note.h" + } + ] +} +````` + +````` +{"schema":"ripwire.edit-plan/v1","mode":"dry-run","edits":1,"files":1,"callers_union":4,"graph_ambiguous":3637,"graph_unresolved":20080,"graph_unindexed":311,"counts_floor":true,"atomic_scope":"per-file","rollback_on_write_error":true,"recheck_before_each_write":true,"multifile_crash_atomic":false," … [line truncated: 400 more bytes on this line] +````` + +## `./build/ripwire . --edit-plan=/aux/edit_plan.json --apply` + +*The same plan committed: per-file locks, re-verify-before-write, atomic rename, rollback on a later failure.* + +**wall time: 10.17s** + +````` +{"schema":"ripwire.edit-plan/v1","mode":"apply","edits":1,"files":1,"callers_union":4,"graph_ambiguous":3637,"graph_unresolved":20080,"graph_unindexed":311,"counts_floor":true,"applied":1,"atomic_files":1,"atomic_scope":"per-file","rollback_on_write_error":true,"recheck_before_each_write":true,"mult … [line truncated: 584 more bytes on this line] +{"n":"benchAdaptive","p":"bench/bench_radix_ab.cpp:157","l":[162]}, +{"n":"radixSortNonNegativeFloatsDesc","p":"src/infra/sortutil.h:120","l":[129]}, +{"n":"radixSortByScoreDescId","p":"src/infra/sortutil.h:135","l":[195]}], +"graph_ambiguous":3637,"graph_unresolved":20080,"graph_unindexed":311,"counts_floor":true}}]} +````` + +## `./build/ripwire . --edit-plan=/aux/edit_plan.json` + +*Neither --dry-run nor --apply: the mode is explicit, so this refuses.* + +**exit code: 1** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --edit-plan requires exactly one of --dry-run or --apply +````` + +## `./build/ripwire . --quality-delta` + +*After the agent's edits: the complexity/nesting rows on lessByScoreDescId are gone (the replace undid them), the rest still gate (exit 2).* + +**exit code: 2** — **wall time: 30.95s** + +````` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +… [171 more display lines; full output is 19726 bytes on 1 raw line(s)] +````` + +stderr: + +````` +ripwire: no ./.ripwire_quality_baseline — auto-comparing the working tree vs git HEAD (commit the baseline with --quality-baseline to pin it) +ripwire: --quality-delta gating: 2 preexisting-worse major finding(s); first: duplication src/infra/sortutil.h::rw::sortutil::nonNegativeFloatAscKeyCopy | src/infra/sortutil.h::rw::sortutil::nonNegativeFloatDescKey at src/infra/sortutil.h:101 (was=0 now=59) +````` + +## `./build/ripwire . --quality-baseline` + +*REFUSES, exit 1: this sandbox tree is already regressed, and pinning here would swallow that debt into the floor so every later delta read clean. It names how many gating findings it would absorb, the first of them, and the way forward.* + +**exit code: 1** — **wall time: 15.51s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --quality-baseline: this tree already holds 2 gating finding(s) against HEAD — pinning here would absorb + them into the floor, and every later --quality-delta would read clean. First: duplication src/infra/sortutil.h::rw::sortutil::nonNegativeFloatAscKeyCopy | src/infra/sortutil.h::rw::sortutil::nonNegativeFloatDescKey (was=0 now=59) + Commit the tree first, or pass --allow-dirty to pin anyway (the sidecar then records the 2 absorbed, and every + report against it carries baseline_absorbed="2"). +````` + +## `./build/ripwire . --quality-baseline --allow-dirty` + +*The consent form: pin anyway. The sidecar is stamped with the dirty pin and the absorbed count, so the fact outlives the process that knew it.* + +**wall time: 23.06s** + +````` +(empty) +````` + +stderr: + +````` +ripwire: --quality-baseline --allow-dirty: pinned with 2 gating finding(s) ABSORBED into the floor (stamped in the sidecar; every --quality-delta against it carries baseline_absorbed="2") +ripwire: wrote ./.ripwire_quality_baseline (snapshot of 41900 per-symbol rows, 44048 indexed symbols total) +````` + +Artifact written: + +````` + 8766401 .ripwire_quality_baseline +# ripwire quality baseline v6 — regenerate with --quality-baseline; do not hand-edit +producer 3689f993bf0d8513a1d157e08097f94270b1cc71a98e7b42d4667d4384fd714c +head b0cb13d8d80ed7a0219eca835d53a9e97ec1613d +dirty 1 +absorbed 2 +ccx 67c15011ee8b 0 +ccx d19d7c13cbc7 2 +ccx 1f7edbff929e5 12 +ccx 6a732f6699b +````` + +## `./build/ripwire . --quality-delta` + +*Against that sidecar the same tree reads regressions=0 — but baseline_absorbed= is on the root, so this green means clean SINCE THE PIN, never clean. A baseline is a floor YOU chose, and it belongs BEFORE the change.* + +**wall time: 29.47s** + +````` + + +````` + + +--- + +# the MCP dialect — the same verbs over stdio JSON-RPC (one-shot exchange, not a persistent server) + +## `printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize"}' '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | ./build/ripwire --mcp` + +*initialize + tools/list: the manifest an agent host loads at session start — every verb's name, description and input schema.* + +````` +{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-11-25","serverInfo":{"name":"ripwire","version":"0.6.10-dev.130+gb0cb13d8d"},"capabilities":{"tools":{},"resources":{}},"instructions":"Map before reading files. Start a new task with explore; use from_trace for an error; use impact plus uses … [line truncated: 760 more bytes on this line] +{"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"analyze","description":"Architecture map for a directory: signatures and the call graph for the top symbols. Use when landing cold in a repo or subdir, before reading files; for a task-scoped inventory use 'for', for one symbol's neighborhood find_ … [line truncated: 742 more bytes on this line] +{"name":"rank_by","description":"The SAME architecture map 'analyze' serves, ranked by a different signal instead of plain PageRank. rank_by = pagerank (default, omit it — the CLI's own unbiased --rank-by=pagerank; 'analyze' can rank differently on a tree with uncommitted changes, where it biases … [line truncated: 1077 more bytes on this line] +{"name":"find_symbol","description":"A symbol's 1-hop neighborhood: the symbol (with a fetch_body handle) plus direct callers (calledBy) and callees (calls). Full transitive reach: 'impact'. Read/write/import sites, not just calls: 'uses'. JSON {symbol, calledBy, calls, defs, count, hop_tested, hop_ … [line truncated: 1181 more bytes on this line] +{"name":"find_referencing_symbols","description":"Direct (1-hop) callers of a symbol, each with a fetch_body handle. For the full transitive blast radius use 'impact', for read/write/import sites 'uses'. JSON {symbol, calledBy, defs, count, hop_tested, hop_untested, declined_calls, counts_floor}; ca … [line truncated: 945 more bytes on this line] +{"name":"grep","description":"Trigram literal search; each hit annotated with its enclosing symbol (which function/class it is in). Hits carry text; enclosing rows a fetch_body handle. pattern = the literal; in=any lifts the span tiering (default: tightest non-empty tier; rest rides as suppressed_co … [line truncated: 837 more bytes on this line] +{"name":"cochange","description":"Files that historically change together with this file — the co-edit partners. Fowler's Shotgun Surgery as change coupling. dep_capable=false (sh/md/json/binary) or no_file_edges (Go, Java: imports not resolved) makes surprising undefined, not a finding. file = th … [line truncated: 705 more bytes on this line] +{"name":"memory_recall","description":"Most relevant memory notes / docs for a task, full text — the few that matter, not the whole corpus. path = docs/memory dir; task = what you're working on; top_k = docs to return, 1..1000 (default 6), refused outside that band, never clamped; budget_tokens = … [line truncated: 790 more bytes on this line] +{"name":"situational_awareness","description":"The 5 things to know about a diff, as JSON: blast_radius, tests_to_run, forgotten (usual co-change partners missing from this diff), hotspot_alert, modules_touched. forgotten = the Shotgun Surgery check. diff/files optional — defaults to 'git diff HEA … [line truncated: 1296 more bytes on this line] +{"name":"mentions","description":"Docs (markdown plans/designs) that name a code symbol in a backtick. symbol = the code symbol name; limit/offset page the files. An @FILE:LINE line-seed rebinds to the innermost definition enclosing that line and answers for it, disclosing the rebound name as 'sym' … [line truncated: 625 more bytes on this line] +{"name":"for","description":"Task-lens ranked, signatures-only inventory of the building blocks most relevant to a task (cx=complexity, in=reuse-count). task = the task in plain words; budget_tokens = an optional soft row target (the CLI --for --token-budget). The header carries route= (which ranker … [line truncated: 1061 more bytes on this line] +{"name":"lego","description":"Interface-to-impls view for ONE named interface/base: its method contract plus EVERY implementor (own-language only), each with file path. Use when implementing against a KNOWN interface (contrast 'for', which sprays top interfaces for a task). type = interface/base nam … [line truncated: 841 more bytes on this line] +{"name":"owners","description":"Bus-factor: recency-weighted (6-month half-life) author ownership per file. symbol = optional, restricts to the file that defines it; limit/offset page the rows. at= is the commit these numbers were computed at (+dirty = the working tree differed). An @FILE:LINE line- … [line truncated: 879 more bytes on this line] +{"name":"replace_symbol_body","description":"Replace a symbol's ENTIRE definition (signature through closing brace) with new_body — splices over the full def span, preserving every byte outside it verbatim; new_body must be a complete, well-formed definition. One trailing newline folds (trailing_n … [line truncated: 1323 more bytes on this line] +{"name":"insert_before_symbol","description":"Insert text immediately BEFORE a symbol's definition (its first byte); padded to the file's own blank-line seam (separator_padded=N). Same refusal contract as replace_symbol_body (not found / ambiguous / stale index / symlink / concurrent write, file unc … [line truncated: 877 more bytes on this line] +{"name":"insert_after_symbol","description":"Insert text immediately AFTER a symbol's definition (past its final byte, which is preserved exactly); padded to the file's own blank-line seam (separator_padded=N); one trailing newline folds (trailing_newline_folded). Same refusal contract as replace_sy … [line truncated: 878 more bytes on this line] +{"name":"fetch_body","description":"Full (or partial-range) source of a symbol's definition, addressed by the stable `handle` a read verb attached to it (bodies on request, not by default). start_line/end_line are optional, 1-based, INCLUSIVE and BODY-RELATIVE (line 1 = the def's first line), clampe … [line truncated: 1049 more bytes on this line] +{"name":"exemplar","description":"BEFORE writing a function / method / class / struct / interface / variable, get the repo's single best-in-class instance of that kind to imitate — signature AND full body. chosen by ROLE, NEVER by text similarity to your task: candidates are first filtered to cogn … [line truncated: 1372 more bytes on this line] +{"name":"quality_delta","description":"Your PR self-check, run every time you think a change is DONE — pairs with the CLI-only --test-gate (names the tests to run + the untested blast radius; not MCP-exposed) to form the two-step pre-PR gate. Reports ONLY what your tree made WORSE vs baseline, acr … [line truncated: 870 more bytes on this line] +{"name":"quality_baseline","description":"PIN the quality floor: writes .ripwire_quality_baseline stamped with the current git HEAD sha, snapshotting complexity / duplication / dead-code / API surface. Call once at the start of non-trivial work, then quality_delta compares against this pinned floor … [line truncated: 445 more bytes on this line] +{"name":"impact","description":"IS IT SAFE TO CHANGE X? — the TRANSITIVE blast radius of a symbol via calls, nearest first (d= hop depth), then PageRank. Use before modifying or deleting a symbol; it beats find_referencing_symbols (direct callers only), and 'uses' catches the read/write/import sit … [line truncated: 1325 more bytes on this line] +{"name":"uses","description":"The STATICALLY RESOLVABLE use-sites of a symbol, not just calls: role (call | read | write | import | extends), file:line, and enclosing symbol. Use to see the footprint before renaming or changing a name — find_referencing_symbols and impact follow only calls. extern … [line truncated: 1146 more bytes on this line] +{"name":"affected","description":"WHICH TESTS TO RUN for a change — test files that transitively reach the changed files/symbols, ranked by evidence (edited > partner-named > hop distance). files = changed files and/or symbols, comma-separated: each item is tried as an indexed PATH pattern first, … [line truncated: 1238 more bytes on this line] +{"name":"path_between","description":"Does A REACH B, and HOW? — the shortest directed CALL path between two symbols, hop-by-hop. reachable=\"0\" hops=\"0\" is a valid 'not reachable' answer — call edges are name-based, so a missing dynamic/callback edge can hide a real path. Named path_between … [line truncated: 709 more bytes on this line] +{"name":"connect","description":"When a task touches 2..16 named symbols, returns the minimal subgraph RELATING them - terminals, the fewest joining intermediaries (with signatures), and call edges in true direction - finding the shared-caller joins a directed path_between cannot; unrelated symbols … [line truncated: 950 more bytes on this line] +{"name":"explore","description":"ONE-call task orientation: the routed+anchored ranking, full bodies of the top hits, their 1-hop callers, field notes, and tests_to_run — ALL under one deterministic byte budget, in a fixed section order (ranking > bodies > callers > notes > tests) that degrades gr … [line truncated: 2134 more bytes on this line] +{"name":"from_trace","description":"Paste a stack trace / sanitizer report / compiler error and get it mapped onto indexed symbols, ranked INNERMOST-first: the parsed frame map, the ranked suspects' signatures, and the innermost in-corpus symbol's FULL body. Out-of-corpus frames are listed a … [line truncated: 1233 more bytes on this line] +{"name":"edit_check","description":"Just edited a symbol? Did its CONTRACT (param count + publicness) change vs git HEAD, and which 1-hop callers are NOW INCOMPATIBLE with the new arity by fixed-arity evidence (not a guess — every folded definition disagrees)? This is call sites worth OPENING, not … [line truncated: 1908 more bytes on this line] +{"name":"whereis","description":"WHERE DOES THIS CONTENT LIVE? Which branch's tree defines or mentions a symbol, HEAD first, with on-head=0 naming the case this verb exists for: content that lives only on a branch (a finished fix stranded on 1 of 30 refs). Each distinct blob is read once (content-ad … [line truncated: 1475 more bytes on this line] +{"name":"stray_content","description":"Per branch: the lines its own divergent work AUTHORED (vs its merge-base with HEAD) that the live line does NOT have. Four verdicts (unmerged+superseded+merged+unknown=refs): v=unmerged is genuinely absent; v=superseded means the live line re-implemented the wo … [line truncated: 1123 more bytes on this line] +{"name":"flags","description":"WHAT IS BUILT BUT DARK here — the answer to 'why don't I see feature X?'. Harvests all three gate patterns (ifndef/define header gates, CMake option(), getenv reads) with each gate's kind, DEFAULT, the size of the code it guards, and its read sites. When a name is bo … [line truncated: 1434 more bytes on this line] +{"name":"doc_drift","description":"WHICH OF THIS REPO'S DOC CLAIMS ARE NOW FALSE. Verifies the CHECKABLE anchors in every markdown file against the live index and returns ONLY the ones that no longer hold: file:line refs (missing-file / past-eof / line-moved), backticked symbol mentions (undefined), … [line truncated: 1167 more bytes on this line] +{"name":"slice","description":"WHERE IS THIS VARIABLE DEFINED AND USED inside one function — NAME-BASED intra-procedural def-use rows of one variable inside ONE uniquely-resolved definition (the ARISE slicer, arXiv:2605.03117). symbol alone lists the sliceable locals to pick from; add var (or spel … [line truncated: 1722 more bytes on this line] +{"name":"batch","description":"ONE-TURN CONTEXT SWEEP: answer up to 16 heterogeneous READ sub-queries in a single call (the deterministic $0 counterpart of a parallel-search agent). queries = array over the SAME path, in EITHER grammar: {verb, ...args} objects, or the CLI --batch file's own \"verb:a … [line truncated: 2040 more bytes on this line] +````` + +The manifest, summarised (name / description bytes / required args) — what the host pays in context every session: + +````` +tools= 33 manifest_bytes= 47453 (~tokens at 4 bytes/token: 11863 ) +explore desc_bytes= 1339 schema_bytes= 958 required=['task'] +batch desc_bytes= 1235 schema_bytes= 962 required=['queries'] +edit_check desc_bytes= 1180 schema_bytes= 889 required=['symbol'] +slice desc_bytes= 953 schema_bytes= 932 required=['symbol'] +whereis desc_bytes= 701 schema_bytes= 941 required=['symbol'] +flags desc_bytes= 881 schema_bytes= 720 required=[] +exemplar desc_bytes= 951 schema_bytes= 591 required=[] +replace_symbol_body desc_bytes= 865 schema_bytes= 610 required=['symbol', 'new_body'] +impact desc_bytes= 821 schema_bytes= 666 required=['symbol'] +situational_awareness desc_bytes= 864 schema_bytes= 581 required=[] +affected desc_bytes= 790 schema_bytes= 610 required=['files'] +from_trace desc_bytes= 836 schema_bytes= 559 required=['trace'] +find_symbol desc_bytes= 752 schema_bytes= 590 required=['symbol'] +doc_drift desc_bytes= 728 schema_bytes= 604 required=[] +uses desc_bytes= 626 schema_bytes= 682 required=['symbol'] +stray_content desc_bytes= 678 schema_bytes= 604 required=[] +rank_by desc_bytes= 758 schema_bytes= 481 required=[] +for desc_bytes= 453 schema_bytes= 777 required=['task'] +fetch_body desc_bytes= 623 schema_bytes= 588 required=['handle'] +connect desc_bytes= 535 schema_bytes= 580 required=['symbols'] +find_referencing_symbols desc_bytes= 505 schema_bytes= 590 required=['symbol'] +insert_after_symbol desc_bytes= 458 schema_bytes= 577 required=['symbol', 'text'] +insert_before_symbol desc_bytes= 455 schema_bytes= 578 required=['symbol', 'text'] +owners desc_bytes= 425 schema_bytes= 625 required=[] +quality_delta desc_bytes= 750 schema_bytes= 279 required=[] +lego desc_bytes= 360 schema_bytes= 651 required=['type'] +grep desc_bytes= 445 schema_bytes= 562 required=['pattern'] +memory_recall desc_bytes= 447 schema_bytes= 500 required=['task'] +path_between desc_bytes= 357 schema_bytes= 506 required=['from', 'to'] +cochange desc_bytes= 393 schema_bytes= 476 required=['file'] +analyze desc_bytes= 546 schema_bytes= 318 required=[] +mentions desc_bytes= 305 schema_bytes= 486 required=['symbol'] +quality_baseline desc_bytes= 407 schema_bytes= 193 required=[] +````` + +## `printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize"}' '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | ./build/ripwire --mcp --mcp-tools=core` + +*--mcp-tools=core: the server lists only the core profile's tools (explore, batch, from_trace, impact, uses, fetch_body, edit_check, quality_delta), so a host that loads every schema at session start pays only for those.* + +````` +{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-11-25","serverInfo":{"name":"ripwire","version":"0.6.10-dev.130+gb0cb13d8d"},"capabilities":{"tools":{},"resources":{}},"instructions":"Map before reading files. Start a new task with explore; use from_trace for an error; use impact plus uses … [line truncated: 977 more bytes on this line] +{"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"fetch_body","description":"Full (or partial-range) source of a symbol's definition, addressed by the stable `handle` a read verb attached to it (bodies on request, not by default). start_line/end_line are optional, 1-based, INCLUSIVE and BODY-RELAT … [line truncated: 1092 more bytes on this line] +{"name":"quality_delta","description":"Your PR self-check, run every time you think a change is DONE — pairs with the CLI-only --test-gate (names the tests to run + the untested blast radius; not MCP-exposed) to form the two-step pre-PR gate. Reports ONLY what your tree made WORSE vs baseline, acr … [line truncated: 870 more bytes on this line] +{"name":"impact","description":"IS IT SAFE TO CHANGE X? — the TRANSITIVE blast radius of a symbol via calls, nearest first (d= hop depth), then PageRank. Use before modifying or deleting a symbol; it beats find_referencing_symbols (direct callers only), and 'uses' catches the read/write/import sit … [line truncated: 1325 more bytes on this line] +{"name":"uses","description":"The STATICALLY RESOLVABLE use-sites of a symbol, not just calls: role (call | read | write | import | extends), file:line, and enclosing symbol. Use to see the footprint before renaming or changing a name — find_referencing_symbols and impact follow only calls. extern … [line truncated: 1146 more bytes on this line] +{"name":"explore","description":"ONE-call task orientation: the routed+anchored ranking, full bodies of the top hits, their 1-hop callers, field notes, and tests_to_run — ALL under one deterministic byte budget, in a fixed section order (ranking > bodies > callers > notes > tests) that degrades gr … [line truncated: 2134 more bytes on this line] +{"name":"from_trace","description":"Paste a stack trace / sanitizer report / compiler error and get it mapped onto indexed symbols, ranked INNERMOST-first: the parsed frame map, the ranked suspects' signatures, and the innermost in-corpus symbol's FULL body. Out-of-corpus frames are listed a … [line truncated: 1233 more bytes on this line] +{"name":"edit_check","description":"Just edited a symbol? Did its CONTRACT (param count + publicness) change vs git HEAD, and which 1-hop callers are NOW INCOMPATIBLE with the new arity by fixed-arity evidence (not a guess — every folded definition disagrees)? This is call sites worth OPENING, not … [line truncated: 1908 more bytes on this line] +{"name":"batch","description":"ONE-TURN CONTEXT SWEEP: answer up to 16 heterogeneous READ sub-queries in a single call (the deterministic $0 counterpart of a parallel-search agent). queries = array over the SAME path, in EITHER grammar: {verb, ...args} objects, or the CLI --batch file's own \"verb:a … [line truncated: 2040 more bytes on this line] +````` + +The core manifest, summarised (name / description bytes / required args): + +````` +tools= 8 manifest_bytes= 14193 (~tokens at 4 bytes/token: 3548 ) +explore desc_bytes= 1339 schema_bytes= 958 required=['task'] +batch desc_bytes= 1235 schema_bytes= 962 required=['queries'] +edit_check desc_bytes= 1180 schema_bytes= 889 required=['symbol'] +impact desc_bytes= 821 schema_bytes= 666 required=['symbol'] +from_trace desc_bytes= 836 schema_bytes= 559 required=['trace'] +uses desc_bytes= 626 schema_bytes= 682 required=['symbol'] +fetch_body desc_bytes= 623 schema_bytes= 588 required=['handle'] +quality_delta desc_bytes= 750 schema_bytes= 279 required=[] +````` + +## `printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize"}' '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"for","arguments":{"path":".","task":"pagerank power iteration"}}}' | ./build/ripwire --mcp` + +*MCP `for`: always bundle=sigs (never the CLI's compact route), the same ranked signatures as --for.* + +**wall time: 7.01s** + +````` +{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-11-25","serverInfo":{"name":"ripwire","version":"0.6.10-dev.130+gb0cb13d8d"},"capabilities":{"tools":{},"resources":{}},"instructions":"Map before reading files. Start a new task with explore; use from_trace for an error; use impact plus uses … [line truncated: 760 more bytes on this line] +{"jsonrpc":"2.0","id":2,"result":{"content":[{"type":"text","text":". window: shown= total= capped= has_more= next_offset= offset= limit= (ca … [line truncated: 13902 more bytes on this line] +"_index":"[index: files=4779 symbols=44046 hash=3fa167a7]","_fresh":"ok"}} +{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"{}", rw::rootRelPathsLegend( clnSingleRoot ) ); + rw::emitTo( stdout, "{}", rw::rootRelPathsLegend( clnSingleRoot ) ); rw::emitTo( stdout, "", cg.size(), cg3.size(), // M2: pageDisclosure's paging half (which spells total= itself) now also rides on a CUT bare run, diff --git a/src/verbtable.h b/src/verbtable.h index 9e22c2178..7ab436bf5 100644 --- a/src/verbtable.h +++ b/src/verbtable.h @@ -57,7 +57,7 @@ inline constexpr std::array kKnownVerbs = { // breaks the ascending-sort contract std::binary_search (below, at the one call site) depends on fails // the build, not just the gate. There is deliberately no isKnownVerb() wrapper here: a bare one-line // `return std::algorithm(...)` forwarder over a small fixed container is exactly the shape -// naminglens::ncAnyOf and notes::sortNotes already are, and adding a third structurally-identical +// rw::isOneOf and notes::sortNotes already are, and adding a third structurally-identical // wrapper is a clone, not a new primitive — src/main.cpp's communityVerbSuffix (the table's one caller) // calls std::binary_search directly against kKnownVerbs instead. static_assert( []() constexpr { diff --git a/src/warmsnap.h b/src/warmsnap.h index afee92a43..784a294ca 100644 --- a/src/warmsnap.h +++ b/src/warmsnap.h @@ -78,7 +78,8 @@ namespace rw::warmsnap { inline constexpr std::uint64_t kMagic = 0x0150'414e'5357'52ull; // "RWSNAP\x01" -inline constexpr std::uint32_t kVersion = 3; // bump on ANY layout change in the three sections +inline constexpr std::uint32_t kVersion = 4; // bump on ANY layout change in the three sections + // 4: lane qd-tangle — SymRow's two pad bytes carry Symbol::steer and ::dispatchShare (3 is held by in-flight lanes) // 3: the GRAPH section carries Graph::provenSites (PROVEN-SITE-KEEPS-NAMESAKES) // 2: the MODEL section dropped its stored stat signature of the blob — the // blob's identity is in this file's NAME, so that binding is structural diff --git a/src/warmsnap_model.h b/src/warmsnap_model.h index 4ae407c9b..ed123944c 100644 --- a/src/warmsnap_model.h +++ b/src/warmsnap_model.h @@ -44,7 +44,7 @@ struct SymRow std::uint8_t kind, lang; std::array evWhy; std::uint8_t maxNest, arityExact, bits, paramsMin, extentSuspect, rankFlags; // bits: testScope 1, internalLinkage 2, scopeRootsStd 4, fnLocal 8 - std::uint8_t pad[ 2 ]; + std::uint8_t steer, dispatchShare; // QD-TANGLE (model.h Symbol::steer / ::dispatchShare) }; static_assert( RawRow && sizeof( SymRow ) == 64, "SymRow is a raw 64 B row" ); @@ -222,7 +222,7 @@ inline void writeSymbolFamily( Out& o, const std::vector& family ) rows[ i ] = SymRow{ s.fileId, s.line, s.sigStartByte, s.sigEndByte, s.endByte, s.cx, s.ccx, s.loc, s.locals, s.ppAlt, s.humps, s.deepLoc, s.ev, s.params, std::uint8_t( s.kind ), std::uint8_t( s.lang ), s.evWhy, s.maxNest, s.arityExact, std::uint8_t( s.testScope | ( s.internalLinkage << 1 ) | ( s.scopeRootsStd << 2 ) | ( s.fnLocal << 3 ) ), std::uint8_t( s.paramsMin ), - std::uint8_t( s.extentSuspect ), std::uint8_t( s.rankFlags ), { 0, 0 } }; + std::uint8_t( s.extentSuspect ), std::uint8_t( s.rankFlags ), s.steer, s.dispatchShare }; names.push_back( s.name ); scopes.push_back( s.scope ); } @@ -458,6 +458,7 @@ inline bool readSymbolFamily( In& in, std::vector& family, std::size_t f s.evWhy = r.evWhy; s.params = r.params; s.maxNest = r.maxNest; s.arityExact = r.arityExact; s.testScope = r.bits & 1; s.internalLinkage = ( r.bits >> 1 ) & 1; s.scopeRootsStd = ( r.bits >> 2 ) & 1; s.fnLocal = ( r.bits >> 3 ) & 1; s.paramsMin = r.paramsMin & 15; s.extentSuspect = r.extentSuspect & 15; s.rankFlags = r.rankFlags & 15; + s.steer = r.steer; s.dispatchShare = r.dispatchShare; s.name = textAt( nameEnds, nameBlob, i ); s.scope = textAt( scopeEnds, scopeBlob, i ); } ); diff --git a/test/capdisclose.map b/test/capdisclose.map index 931b30c2d..5837afa73 100644 --- a/test/capdisclose.map +++ b/test/capdisclose.map @@ -21,6 +21,7 @@ kCMakeMaxCallLines pending:#565 a read bound on one CMake call: past 16 lines th kCallPathSeeds none:K4 keep-guard seed window: which seeds the guard tries, no answer row is cut (LARGE-PARTIAL Stage 0 audit) kCloneKeyTokenBits none:a saturating key field width, re-verified: a wider key changes no row (Stage 0 audit) kDeadExportedRowsShown sink:shown,walkSkipped +kDispatchArmMaxRows none:a tangle shape test, not a cut: a dispatch arm of at most 40 lines reads alone, so its depth is exempt from the score; no row or answer is cut (QD-TANGLE, train ge2) kEvidenceCap pending:B43 disclosed elsewhere: pageTailOf emits shown= capped= for every pageWindow (verbs_navigate.h); the cap is used through a window, so the lint finds no cap site to tie kForBareFlagMaxSites none:a shape test, not a cut: a bare kebab token with more source sites is prose, so no is claimed (WHOLE-TOKEN; read by hand at train 1111c) kForBodyFoldBudgetBytes sink:cut,firstCutNext @@ -144,6 +145,7 @@ kShortKeyBodyBytes legend kShortKeyRows legend kShown sink:truncated,selfExecutablePath kSketchHashes none:the minhash sketch width, not a cut (Stage 0 audit) +kSteerStmts none:the steering-local distance, not a cut: a read 10+ statements after its write counts as steered; it names which locals the tangle row lists in locals=, none dropped (QD-TANGLE, train ge2) kSupport none:a minimum-commits threshold, not a cut (Stage 0 audit) kType3MaxBucket pending:B43 SILENT CUT by design (quadratic bucket), follow-up card: fires on every clones run kType3MaxTokensForLcs pending:B43 SILENT CUT, follow-up card: fired on 6 of 7 large repos; type3 total +0.15% lifted, shown rows unchanged diff --git a/test/cloneidiomcheck.sh b/test/cloneidiomcheck.sh index df86c1923..d07345a5f 100755 --- a/test/cloneidiomcheck.sh +++ b/test/cloneidiomcheck.sh @@ -39,6 +39,12 @@ # group carries no idiom); a pair identical once its parameters are renamed gates although it shares # no other identifier at all, also when its signature is generic (`name(…)`, `name[T any](…)`) or one default holds a template comma or a less-than; a pair sharing a MEMBER spelled like a parameter gates. The quality-delta half: the demoted pair is minor, the shared-constant # pair gates. The real-history replays live in test/dupshortcheck.sh. +# (P) THE FIFTH IDIOM, call-sequence (QD-FALSE-ROWS-E0): the reused sortUnique helper and a four-call stream +# writer — two call runs with no callee in common, the shape that gated a sort-unique lane twice — +# demote; the writer beside a twin that calls the SAME writer methods gates; the first pair in one file and +# one namespace gates; a std-only run identical once its parameter is renamed gates; a twin whose last +# statement is an assignment carries no idiom at all. The quality-delta half: the demoted pair is minor and +# not gating, its document defines call-sequence, and the shared-callee pair still gates. # # Usage: bash test/cloneidiomcheck.sh | RIPWIRE_BIN=asan/ripwire bash test/cloneidiomcheck.sh # Exits non-zero on any failure; prints PASS/FAIL per check and ALL PASS on success. @@ -63,6 +69,200 @@ command -v git >/dev/null 2>&1 || { echo "git required"; exit 2; } CORPUS="$TMP/corpus"; mkdir -p "$CORPUS" cp -R "$FIX/." "$CORPUS/" +# (P) THE CALL-SEQUENCE FIXTURES ARE WRITTEN HERE, NOT COMMITTED under test/cloneidiomfix: they copy real call runs +# (warmsnap writeStream, the sortUnique helper) on purpose, and a committed copy would sit in the repo as a NEW clone of +# src/ code that this repo's own quality-delta reports beside every change (a mixed src/fixture group is not exempt). +mkfix(){ mkdir -p "$CORPUS/$1"; cat >"$CORPUS/$1/$2"; } +mkfix callseq_demote frame.h <<'FIXEOF' +#pragma once +// call-sequence fixture: a row stream's frame writer, four calls on one writer. Normalized it is `$I . $I ( … ) ;` +// four times, which is all sortutil.h's helper is too. +#include +#include +#include +namespace frame +{ +struct Out +{ + void u64( std::uint64_t ) {} + void vec( const std::vector& ) {} + void put( const char*, std::size_t ) {} +}; +inline void writeStream( Out& o, std::size_t rowCount, const std::vector& chunkAt, const std::string& bytes ) +{ + o.u64( rowCount ); + o.vec( chunkAt ); + o.u64( bytes.size() ); + o.put( bytes.data(), bytes.size() ); +} +} +FIXEOF +mkfix callseq_demote sortutil.h <<'FIXEOF' +#pragma once +// call-sequence fixture (QD-FALSE-ROWS-E0): the reused sort-then-unique helper. Its body only CALLS things, and +// nothing it calls (sort, erase, unique) is called by frame.h's stream writer: two call runs, no shared callee. +#include +#include +namespace sortutil +{ +template< class Container, class Less = std::less<> > +inline void sortUnique( Container& values, Less less = {} ) +{ + std::sort( values.begin(), values.end(), less ); + values.erase( std::unique( values.begin(), values.end() ), values.end() ); +} +} +FIXEOF +mkfix callseq_sharedcallee frame.h <<'FIXEOF' +#pragma once +// call-sequence fixture: the stream writer again. Its twin (header.h) calls the SAME writer methods (u64, put): +// that is a copy of the framing, so the pair classifies but must keep gating. +#include +#include +#include +namespace frame +{ +struct Out +{ + void u64( std::uint64_t ) {} + void vec( const std::vector& ) {} + void put( const char*, std::size_t ) {} +}; +inline void writeStream( Out& o, std::size_t rowCount, const std::vector& chunkAt, const std::string& bytes ) +{ + o.u64( rowCount ); + o.vec( chunkAt ); + o.u64( bytes.size() ); + o.put( bytes.data(), bytes.size() ); +} +} +FIXEOF +mkfix callseq_sharedcallee header.h <<'FIXEOF' +#pragma once +#include "frame.h" +namespace header +{ +inline void writeHeader( frame::Out& w, std::size_t version, const std::vector& offsets, const std::string& name ) +{ + w.u64( version ); + w.vec( offsets ); + w.u64( name.size() ); + w.put( name.data(), name.size() ); +} +} +FIXEOF +mkfix callseq_samefile pair.h <<'FIXEOF' +#pragma once +// call-sequence fixture: two call runs that share no callee, but in ONE file and ONE namespace — copy-paste next +// door is copy-paste, so the pair classifies and keeps gating. +#include +#include +#include +#include +#include +namespace near +{ +struct Out +{ + void u64( std::uint64_t ) {} + void vec( const std::vector& ) {} + void put( const char*, std::size_t ) {} +}; +template< class Container, class Less = std::less<> > +inline void sortUnique( Container& values, Less less = {} ) +{ + std::sort( values.begin(), values.end(), less ); + values.erase( std::unique( values.begin(), values.end() ), values.end() ); +} +inline void writeStream( Out& o, std::size_t rowCount, const std::vector& chunkAt, const std::string& bytes ) +{ + o.u64( rowCount ); + o.vec( chunkAt ); + o.u64( bytes.size() ); + o.put( bytes.data(), bytes.size() ); +} +} +FIXEOF +mkfix callseq_alpha order.h <<'FIXEOF' +#pragma once +// call-sequence fixture: a call run over standard vocabulary only. Its twin (rank.h) is the same body with the +// parameter renamed — no identifier is left to share once parameters and std:: chains are set aside, so only the +// alpha-rename refusal can say it is a copy, and it must. +#include +#include +namespace order +{ +inline void sortDescending( std::vector& values ) +{ + std::sort( values.begin(), values.end() ); + std::reverse( values.begin(), values.end() ); + std::rotate( values.begin(), values.begin(), values.end() ); +} +} +FIXEOF +mkfix callseq_alpha rank.h <<'FIXEOF' +#pragma once +#include +#include +namespace rank +{ +inline void rankHighFirst( std::vector& scores ) +{ + std::sort( scores.begin(), scores.end() ); + std::reverse( scores.begin(), scores.end() ); + std::rotate( scores.begin(), scores.begin(), scores.end() ); +} +} +FIXEOF +mkfix callseq_assign frame.h <<'FIXEOF' +#pragma once +// call-sequence fixture: a row stream's frame writer, four calls on one writer. Normalized it is `$I . $I ( … ) ;` +// four times, which is all sortutil.h's helper is too. +#include +#include +#include +namespace frame +{ +struct Out +{ + void u64( std::uint64_t ) {} + void vec( const std::vector& ) {} + void put( const char*, std::size_t ) {} +}; +inline void writeStream( Out& o, std::size_t rowCount, const std::vector& chunkAt, const std::string& bytes ) +{ + o.u64( rowCount ); + o.vec( chunkAt ); + o.u64( bytes.size() ); + o.put( bytes.data(), bytes.size() ); +} +} +FIXEOF +mkfix callseq_assign sink.h <<'FIXEOF' +#pragma once +// call-sequence fixture: frame.h's writer beside a near twin whose last statement is an ASSIGNMENT. A body with +// an assignment is not a call run, so the group carries no idiom and keeps gating. +#include +#include +#include +namespace sink +{ +struct Log +{ + void tag( std::uint64_t ) {} + void list( const std::vector& ) {} + std::size_t mark = 0; +}; +inline void recordBatch( Log& log, std::size_t batchId, const std::vector& ids, const std::string& label ) +{ + log.tag( batchId ); + log.list( ids ); + log.tag( label.size() ); + log.mark = label.size() + ids.size(); +} +} +FIXEOF + echo "cloneidiomcheck: BIN=$BIN" # One row per line, for grep-per-row assertions. @@ -118,13 +318,19 @@ expect_row onestmt_alpha_tdefault widthBetween gapOf one-statement no # (O) t expect_row onestmt_alpha_ltdefault widthBetween gapOf one-statement no # (O) the same, with a less-than in one default (`hi = kLo < kHi`: the `<` opens no template, `pad` is still a parameter) expect_row onestmt_alpha_gogeneric WidthBetween GapOf one-statement no # (O) the same through Go type parameters (`GapOf[T int | int64](…)`) expect_row onestmt_memberparam rowFits cellFits one-statement no # (O) a shared MEMBER spelled like a parameter +expect_row callseq_demote sortUnique writeStream call-sequence yes # (P) two call runs, no callee in common +expect_row callseq_sharedcallee writeStream writeHeader call-sequence no # (P) the same writer methods called: a copy +expect_row callseq_samefile sortUnique writeStream call-sequence no # (P) one file, one namespace +expect_row callseq_alpha sortDescending rankHighFirst call-sequence no # (P) identical after renaming the parameter +expect_row callseq_assign writeStream recordBatch NONE no # (P) an assignment is not a call statement # ── (G) true-positive preservation: the row stream itself is untouched ──────────────────────────────── # Demotion is an ANNOTATION. Every fixture must still yield exactly ONE group of exactly TWO members — # the shape each yielded before any of this existed. A classifier that suppressed a row would pass every # attribute arm above and fail here. for d in ladder_demote ladder_sharedids ladder_samefile switchtable paramstruct nonidiom \ - onestmt_demote onestmt_sharedconst onestmt_samefile onestmt_expects onestmt_ifreturn onestmt_alpha onestmt_alpha_generic onestmt_alpha_gogeneric onestmt_alpha_tdefault onestmt_alpha_ltdefault onestmt_memberparam; do + onestmt_demote onestmt_sharedconst onestmt_samefile onestmt_expects onestmt_ifreturn onestmt_alpha onestmt_alpha_generic onestmt_alpha_gogeneric onestmt_alpha_tdefault onestmt_alpha_ltdefault onestmt_memberparam \ + callseq_demote callseq_sharedcallee callseq_samefile callseq_alpha callseq_assign; do n="$( rows "$d" | wc -l | tr -d ' ' )" m="$( rows "$d" | grep -c 'n="2"' )" if [ "$n" = 1 ] && [ "$m" = 1 ]; then @@ -287,6 +493,31 @@ case "$CROW" in *) no "quality-delta: the shared-constant one-statement pair stopped gating (row: ${CROW:-})";; esac +# (P) the quality-delta half of the fifth idiom. The writer is committed and the helper arrives in the working tree, +# so the pair is preexisting-worse (the writer existed) — the shape that gated: without call-sequence it is a gating row. +mkrepo qd_callseq "callseq_demote/frame.h" "callseq_demote/sortutil.h" || { echo "git fixture setup failed"; exit 2; } +QROW="$( qd qd_callseq | tr '<' '\n' | grep 'kind="duplication"' | grep 'sortUnique' )" # status: --quality-delta exits 0 or 2 (gating) by design; the row's sev= is the verdict, and an empty row FAILs +case "$QROW" in + '') no "quality-delta: no row for the call-sequence pair at all — the arms below are vacuous";; + *'idiom="call-sequence"'*'sev="minor"'*|*'sev="minor"'*'idiom="call-sequence"'*) ok "quality-delta: the no-shared-callee call-sequence pair is minor, idiom named";; + *) no "quality-delta: the no-shared-callee call-sequence pair is not a minor call-sequence row (row: $QROW)";; +esac +case "$QROW" in + *'gating="1"'*) no "quality-delta: the demoted call-sequence pair still gates";; + '') ;; + *) ok "quality-delta: the demoted call-sequence pair does not gate";; +esac +case "$( qdfull qd_callseq )" in + *'call-sequence is a body of call statements only'*) ok "quality-delta: the call-sequence row's document defines the idiom's narrowed test";; + *) no "quality-delta: a document with a call-sequence row never defines the narrowed test";; +esac +mkrepo qd_callseq_shared "callseq_sharedcallee/frame.h" "callseq_sharedcallee/header.h" || { echo "git fixture setup failed"; exit 2; } +KROW="$( qd qd_callseq_shared | tr '<' '\n' | grep 'kind="duplication"' | grep 'writeHeader' )" # status: --quality-delta exits 2 here by design (the pair gates); the row's gating= is the verdict, and an empty row FAILs +case "$KROW" in + *'idiom="call-sequence"'*'gating="1"'*|*'gating="1"'*'idiom="call-sequence"'*) ok "quality-delta: the shared-callee call-sequence pair still gates";; + *) no "quality-delta: the shared-callee call-sequence pair is not a gating call-sequence row (row: ${KROW:-})";; +esac + # ── (J) determinism ─────────────────────────────────────────────────────────────────────────────────── "$BIN" "$CORPUS" --clones --no-cache >"$TMP/a" 2>/dev/null "$BIN" "$CORPUS" --clones --no-cache >"$TMP/b" 2>/dev/null diff --git a/test/cloneoperandcheck.sh b/test/cloneoperandcheck.sh new file mode 100644 index 000000000..8bd8e1152 --- /dev/null +++ b/test/cloneoperandcheck.sh @@ -0,0 +1,505 @@ +#!/usr/bin/env bash +# cloneoperandcheck.sh — QD-IDIOM-ELEMTYPE: the operand path of the clone demotion (src/cloneidiom.h). +# +# WHY THIS GATE EXISTS. A port of a 700-line shell matcher (QD-VA-FORMS, 2026-11-19) needed 13 reasoned acks for +# short clone rows that matched unrelated code by SHAPE: an svLess binary search over a runtime vector +# beside one over a constexpr span of string_view tables, a quote strip beside a whitespace squeeze, two parsers' +# bounded peeks. Each pair operates on DIFFERENT DATA, and that is what the operand path reads: a group under the +# 80-token idiom ceiling, in distinct contexts, whose every pair has no literal in common (0 and 1 left out) or the +# same number of concrete parameters with a different type at some position, is reported minor with why= naming it. +# +# WHAT THIS GATE PINS — through --quality-delta (one member committed, its twin in the working tree, so the row is +# preexisting-worse and would gate): +# (P1) types: an svLess search over vector beside the same body over span is minor, +# why="different parameter types" +# (P2) literals: a quote strip beside a whitespace squeeze (one copy-filter loop) is minor, why="different literals" +# (P3) literals, one side empty: a bounded peek returning '\0' beside one returning a member is minor +# (N1) a copy that kept a literal (a tag-parameterised hex writer beside its "tangle " instance) GATES +# (N2) a copy over the same literals (two reverse find-by-key loops, 0 and 1 only) GATES +# (N3) the P2 pair in one file and one namespace GATES +# (N4) a GENERIC member (a template over the range) beside the concrete P1 member GATES +# (N5) the P2 shape grown past the 80-token ceiling, literal sets still disjoint, GATES +# (N6) a pair sharing one literal (Python's \w beside an identifier class with '$') GATES +# (C) PREMISE COUNT — every arm above found its row; an arm with no row FAILS (a missing row would pass a "does +# not gate" arm vacuously, and a negative that never forms its group proves nothing) +# (L) the document with a why= clone row defines it (full legend); one without carries no such sentence +# (V) the --clones verb does not read the verdict: the P2 group prints there without demoted="1" +# (J) determinism — two runs byte-identical +# Red-before: on a binary without the operand path, P1-P3 gate (FAIL). Guard-off (the disjointness, the concrete-type, +# the context and the ceiling tests removed): N1-N6 FAIL. See docs/EVALS.md "Clone operand path". +# +# Usage: bash test/cloneoperandcheck.sh [BIN] + +set -u +ROOT="$( cd "$( dirname "$0" )/.." && pwd )" +. "$ROOT/test/lib/clean-env.sh" +BIN="${1:-${RIPWIRE_BIN:-$ROOT/build/ripwire}}" +[ "${BIN#/}" = "$BIN" ] && BIN="$ROOT/$BIN" +TMP="$( mktemp -d )"; trap 'rm -rf "$TMP"' EXIT +export HOME="$TMP/home" TMPDIR="$TMP"; mkdir -p "$HOME" +fail=0; seen=0 +ok(){ printf ' PASS %s\n' "$*" || { fail=1; printf ' FAIL could not write the PASS line for: %s\n' "$*"; }; return 0; } +no(){ printf ' FAIL %s\n' "$*"; fail=1; } + +[ -x "$BIN" ] || { echo "no ripwire binary at $BIN — build first (cmake --build build -j)"; exit 2; } +command -v git >/dev/null 2>&1 || { echo "git required"; exit 2; } + +# The fixtures are WRITTEN HERE, never committed: they copy real bodies on purpose, and a committed copy would sit in +# this repo as a new clone of src/ code that its own quality-delta reports beside every change. +F="$TMP/fix" +mkfix(){ mkdir -p "$F/$1"; cat >"$F/$1/$2"; } + +mkfix tables tables.h <<'EOF' +#pragma once +#include +#include +#include +namespace tables +{ +inline bool svLess( std::string_view a, std::string_view b ) noexcept { return a < b; } +// the lookup of a strictly sorted constexpr table, taken as a span so a new table reuses it +inline bool inSortedTable( std::span table, std::string_view name ) noexcept +{ + return std::binary_search( table.begin(), table.end(), name, tables::svLess ); +} +} +EOF +mkfix names names.h <<'EOF' +#pragma once +#include +#include +#include +#include +#include "tables.h" +namespace shellnames +{ +// a runtime vector of names, sorted once +inline bool hasName( const std::vector& sorted, std::string_view n ) +{ + return std::binary_search( sorted.begin(), sorted.end(), n, tables::svLess ); +} +} +EOF +mkfix generic names.h <<'EOF' +#pragma once +#include +#include +#include "tables.h" +namespace shellnames +{ +template +inline bool hasName( const Range& sorted, std::string_view n ) +{ + return std::binary_search( sorted.begin(), sorted.end(), n, tables::svLess ); +} +} +EOF +mkfix squeeze layout.h <<'EOF' +#pragma once +#include +#include +#include +namespace layout +{ +inline std::string squeeze( std::string_view s ) +{ + std::string out; + out.reserve( s.size() ); + for( char c : s ) + { + if( std::isspace( (unsigned char)c ) == 0 ) + { + out.push_back( c ); + } + } + return out; +} +} +EOF +mkfix unq words.h <<'EOF' +#pragma once +#include +#include +namespace words +{ +// every quote character removed +inline std::string unq( std::string_view s ) +{ + std::string out; + out.reserve( s.size() ); + for( char c : s ) + { + if( c != '"' && c != '\'' ) + { + out.push_back( c ); + } + } + return out; +} +} +EOF +mkfix samescope_base text.h <<'EOF' +#pragma once +#include +#include +#include +namespace text +{ +inline std::string squeeze( std::string_view s ) +{ + std::string out; + out.reserve( s.size() ); + for( char c : s ) + { + if( std::isspace( (unsigned char)c ) == 0 ) + { + out.push_back( c ); + } + } + return out; +} +} +EOF +mkfix samescope_head text.h <<'EOF' +#pragma once +#include +#include +#include +namespace text +{ +inline std::string squeeze( std::string_view s ) +{ + std::string out; + out.reserve( s.size() ); + for( char c : s ) + { + if( std::isspace( (unsigned char)c ) == 0 ) + { + out.push_back( c ); + } + } + return out; +} +inline std::string unq( std::string_view s ) +{ + std::string out; + out.reserve( s.size() ); + for( char c : s ) + { + if( c != '"' && c != '\'' ) + { + out.push_back( c ); + } + } + return out; +} +} +EOF +mkfix bigsqueeze layout.h <<'EOF' +#pragma once +#include +#include +#include +namespace layout +{ +inline std::string squeezeMarked( std::string_view s, std::size_t& dropped ) +{ + std::string out; + out.reserve( s.size() + 2 ); + for( char c : s ) + { + if( c != ' ' && c != '\t' ) + { + out.push_back( c ); + } + else + { + ++dropped; + } + } + if( dropped > 4 ) + { + out.insert( out.begin(), '#' ); + out.push_back( '#' ); + } + if( out.size() > 64 ) + { + out.resize( 64 ); + } + return out; +} +} +EOF +mkfix bigunq words.h <<'EOF' +#pragma once +#include +#include +#include +namespace words +{ +inline std::string unquoteMarked( std::string_view s, std::size_t& dropped ) +{ + std::string out; + out.reserve( s.size() + 2 ); + for( char c : s ) + { + if( c != '"' && c != '\'' ) + { + out.push_back( c ); + } + else + { + ++dropped; + } + } + if( dropped > 8 ) + { + out.insert( out.begin(), '@' ); + out.push_back( '@' ); + } + if( out.size() > 128 ) + { + out.resize( 128 ); + } + return out; +} +} +EOF +mkfix peekq query.h <<'EOF' +#pragma once +#include +#include +namespace query +{ +struct Eval +{ + std::string_view src; + std::size_t pos = 0; + void skipWs() noexcept + { + while( pos < src.size() && src[pos] == ' ' ) + { + ++pos; + } + } + char peek() noexcept + { + skipWs(); + return pos < src.size() ? src[pos] : '\0'; + } +}; +} +EOF +mkfix peeks parser.h <<'EOF' +#pragma once +#include +#include +namespace shparse +{ +struct Tok { int kind = 0; }; +struct Parser +{ + std::vector t_; + std::size_t i_ = 0; + Tok eof_{}; + const Tok& peek() const noexcept + { + return i_ < t_.size() ? t_[i_] : eof_; + } +}; +} +EOF +mkfix hexpair sidecar.h <<'EOF' +#pragma once +#include +#include +namespace sidecar +{ +// a key -> hash record family: " ", both hex, one per record +template +inline void writeHexPairLines( std::ostream& f, std::string_view tag, const HexMap& m ) +{ + for( const auto& [h, v] : m ) + { + f << tag << ' ' << std::hex << h << ' ' << v << std::dec << '\n'; + } +} +} +EOF +mkfix tangle tangle.h <<'EOF' +#pragma once +#include +#include +#include +#include +namespace tanglefile +{ +struct Snap +{ + bool known = false; + std::vector> bySym; +}; +inline void writeTangleLines( std::ostream& f, const Snap& s ) +{ + if( s.known ) + { + f << "tangleon 1\n"; + } + for( const auto& [h, v] : s.bySym ) + { + f << "tangle " << std::hex << h << ' ' << v << std::dec << '\n'; + } +} +} +EOF +mkfix jsonget json.h <<'EOF' +#pragma once +#include +#include +#include +namespace tsimport +{ +struct JsonNode +{ + std::vector keys; + std::vector vals; + // a later duplicate wins at lookup, as in JSON.parse + const JsonNode* get( std::string_view key ) const noexcept + { + for( std::size_t cursor = keys.size(); cursor > 0; --cursor ) + { + if( keys[cursor - 1] == key ) + { + return &vals[cursor - 1]; + } + } + return nullptr; + } +}; +} +EOF +mkfix steerfind steer.h <<'EOF' +#pragma once +#include +#include +#include +namespace steer +{ +struct Slot { std::string_view name; std::uint32_t scopeEnd = 0; }; +struct Acc { std::vector slots; }; +inline Slot* steer_find( Acc& acc, std::string_view name, std::uint32_t at ) noexcept +{ + for( std::size_t i = acc.slots.size(); i > 0; --i ) + { + if( acc.slots[ i - 1 ].name == name && at < acc.slots[ i - 1 ].scopeEnd ) + { + return &acc.slots[ i - 1 ]; + } + } + return nullptr; +} +} +EOF +mkfix identchar ident.h <<'EOF' +#pragma once +namespace unusedfile +{ +inline bool isIdentChar( char c ) noexcept { return ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || ( c >= '0' && c <= '9' ) || c == '_'; } +inline bool isIdent( char c ) noexcept { return isIdentChar( c ) || c == '$' || static_cast( c ) >= 0x80; } +} +EOF +mkfix wordchar word.h <<'EOF' +#pragma once +#include "ident.h" +namespace shword +{ +inline bool isWordChar( char c ) noexcept // Python's \w on str: ASCII word characters, and any non-ASCII byte +{ + return unusedfile::isIdentChar( c ) || static_cast( c ) >= 0x80; +} +} +EOF + +# mkrepo "" "": each dir's files land in src/. +mkrepo() +{ + local R="$TMP/$1" d + mkdir -p "$R/src" + ( cd "$R" && git init -q . && git config user.email t@t && git config user.name t && git config commit.gpgsign false ) || return 1 + for d in $2; do cp "$F/$d/"* "$R/src/"; done + ( cd "$R" && git add -A && git commit -qm base ) || return 1 + for d in $3; do cp "$F/$d/"* "$R/src/"; done + return 0 +} +qd(){ "$BIN" "$TMP/$1" --quality-delta --no-cache 2>/dev/null; } # status: exits 0 or 2 (gating) by design; the row is the verdict +# row : the duplication row naming it, one line, or empty +row(){ qd "$1" | tr '<' '\n' | grep '^r kind="duplication"' | grep -- "$2" | head -1; } # status: qd exits 0 or 2 by design; an empty row FAILs the arm that reads it + +# demotes