From 765c8a5dc91e871b52b053ea2b8b4c07787d6575 Mon Sep 17 00:00:00 2001 From: joyful-ii-V-I <210578314+joyful-ii-V-I@users.noreply.github.com> Date: Wed, 18 Nov 2026 00:26:01 -0500 Subject: [PATCH 1/5] Bind the source copy of a two-copy --callers method and name the copy Owner decision 11-17, "bind source, disclose". --callers=Owner.method refused when M1 left two bodied definitions and one was a copy (vscode's extensions/copilot/src/util/vs tree, whose files open with a COPIED banner). --path binds all K such definitions (ownerSpellingFittedDefs) and picks none, so a single-pick verb needs a source rule. It reuses existing rules: - sourceOnlyKeptDefs: M1's survivor list, now shared by M1 (unchanged) and the new pick. - definitionIsCopy: isToolOrVendoredPath (the --for subject anchor's rule, moved from subjectanchor.h to filter.h unchanged) or docparse::hasGeneratedMarker on the file head. - sourceCopyPick: exactly one non-copy survivor binds; two or none still refuse. The pick runs inside the one binder (callersRefusedPick in callHierarchyRowsNarrowed), so CLI --callers and MCP find_referencing_symbols / callers answer the same copy. The root keeps narrowed= and adds copy_p= (each copy as p:line) and copy_next= (the callers call on the first copy) on XML, columnar and JSON, and as MCP keys plus copy_note. The full and compact legends define both. The dictionary pair moves to dictv=93a964379c56ed78 entries=1131. --for is not reached: its graph block binds through GraphSubjectSpellings, which does not include the pick. Arms in gvassemblycheck: d6 binds the banner copy's source with copy_p= and copy_next=, and equals the explicit call. d7 refuses when neither definition is source, and d4's two-source refusal is unchanged. d8 checks MCP == CLI --json. e4 checks --for adds no block. d6 and d8 are red on b162d4e2e. Co-Authored-By: Claude Opus 5.5 --- changelog.d/callers-two-copy-bind.md | 5 + src/callhierarchy.h | 5 +- src/compactlegend.h | 3 + src/filter.h | 22 ++++ src/forgraphverb.h | 160 ++++++++++++++++++++++++--- src/forliteral.h | 2 +- src/mcpverbs.h | 2 + src/subjectanchor.h | 21 ---- src/verbs_navigate.h | 15 ++- test/gvassemblycheck.sh | 91 ++++++++++++++- 10 files changed, 282 insertions(+), 44 deletions(-) create mode 100644 changelog.d/callers-two-copy-bind.md diff --git a/changelog.d/callers-two-copy-bind.md b/changelog.d/callers-two-copy-bind.md new file mode 100644 index 000000000..9885026ad --- /dev/null +++ b/changelog.d/callers-two-copy-bind.md @@ -0,0 +1,5 @@ +### Changed — `--callers` binds the source copy of a two-copy method and names the copy + +`--callers=Owner.method` used to refuse when the name had two bodied definitions and one of them was a copy, such as vscode's `extensions/copilot/src/util/vs/…` tree, whose files open with "DO NOT modify, this file was COPIED". Now, when every definition left after the test-path and bodyless ones are dropped is a copy except ONE, the source one answers. A copy is a file under a CI or tool dot directory, a vendoring directory or the demo/generated tier, or a file whose head declares it generated or copied. The root carries `narrowed=` as before, plus `copy_p=` (each copy as `p:line`) and `copy_next=` (the callers call on the first copy). MCP `find_referencing_symbols` and the `callers` batch verb answer the same copy (`copy_p` / `copy_next` / `copy_note`). Two source definitions, or none, still refuse. `--for` is unchanged. New arms (d6)-(d8) and (e4) in `test/gvassemblycheck.sh`. + +Versions: the session legend dictionary moves to `dictv=93a964379c56ed78 entries=1131` (the `copy_p=` and `copy_next=` entries); docs/COMMANDS.md and the 2026-11-13 showcase capture record the new pair. diff --git a/src/callhierarchy.h b/src/callhierarchy.h index 830137b38..00f254cae 100644 --- a/src/callhierarchy.h +++ b/src/callhierarchy.h @@ -116,9 +116,12 @@ struct CallHierarchyRows // lane declined-sites (declinedsites.h): the records behind declinedCalls, in served order (callers file-first, callees // file and line) — the rows, never in `rows` or any count above; uncut, declinedSites.size() == declinedCalls. std::vector declinedSites; - // GV-PATH-BIND (CLI --callers, src/verbs_navigate.h callHierarchyRowsNarrowed): the selector as typed when it bound nothing and the + // GV-PATH-BIND (CLI --callers, src/forgraphverb.h callHierarchyRowsNarrowed): the selector as typed when it bound nothing and the // M1 rule narrowed it to one source definition, whose spelling these rows answer; empty otherwise (the root's narrowed=) std::vector narrowed; + // CALLERS-TWO-COPY-BIND (forgraphverb.h sourceCopyPick): beside `narrowed`, the copies of the bound definition the answer left out + // (the root's copy_p= / copy_next=); empty otherwise + std::vector copies; // BODILESS-SEED (contractseed.h): callers only — the selector's contract seeds and the implementor bodies `matches` gained // for them (the root's impls=; absent when contractSeeds is 0) std::size_t contractSeeds = 0; diff --git a/src/compactlegend.h b/src/compactlegend.h index c9ea6438f..a7a69660f 100644 --- a/src/compactlegend.h +++ b/src/compactlegend.h @@ -696,6 +696,9 @@ inline constexpr CompactCompletenessTerm kCompactCompletenessTerms[] = { "anchor", ": that markdown link named a heading this file does not have, so the edge is the file", true, "c", MapHeaderRead::No, "missing" }, // GV-PATH-BIND (src/forgraphverb.h kNarrowedVerbLegend), present-only: the callers selector the M1 rule narrowed { "narrowed", "narrowed=: the spelling as typed fits several definitions (refused as written); the test/fixture-path and bodyless ones dropped, the ONE source definition left answers by its own spelling", false, "callers", MapHeaderRead::No, {}, "callers" }, + // CALLERS-TWO-COPY-BIND (src/forgraphverb.h kSourceCopyLegend), present-only: beside narrowed=, the copies the bind left out + { "copy_p", "copy_p=: beside narrowed=, the other definitions the spelling fits are COPIES (CI/tool dot dir, vendoring dir, demo/generated tier, or a generated/copied banner), so the one source definition answers; p:line each, not counted", false, "callers", MapHeaderRead::No, {}, "callers" }, + { "copy_next", "copy_next=: the callers call on the first copy_p= copy", false, "callers", MapHeaderRead::No, {}, "callers" }, // CALLSITE-AT (2026-10-09): a callers row's call sites (editcheck.h rowCallSites); keyed to the callers schema, so the // map's own rows never read it. The columnar form names the same list as its sites_at column. { "sites_at", ": its leaf-name calls not proven elsewhere, as [file:]line (p=: def line, default file); not proof each binds", true, "s", MapHeaderRead::No, {}, "callers" }, diff --git a/src/filter.h b/src/filter.h index 215e28794..856bd9a6c 100644 --- a/src/filter.h +++ b/src/filter.h @@ -360,6 +360,28 @@ inline bool isDemoOrGeneratedPath( std::string_view p ) noexcept return isYarnPnpFileName( fileName ) || ( hasDirSegment( p, "migrations/" ) && isNumberedMigrationFileName( fileName ) ); } +// A CI, tool or vendored copy: under a dot directory (.github, .circleci, .yarn), a vendoring directory, or the demo/generated tier. Such +// a file can define the subject's symbol, even first in path order (a bundled .github action defined Angular's UrlSerializer), and it +// is never what the subject means. The --for subject anchor (subjectanchor.h sourceClassDef) and the --callers two-copy bind +// (forgraphverb.h definitionIsCopy) read this one rule; it moved here from subjectanchor.h so both can. +inline bool isToolOrVendoredPath( std::string_view p ) noexcept +{ + if( isDemoOrGeneratedPath( p ) ) + { + return true; + } + for( std::size_t start = 0, slash = p.find( '/' ); slash != std::string_view::npos; start = slash + 1, slash = p.find( '/', start ) ) + { + const std::string_view dir = p.substr( start, slash - start ); + const bool vendoring = dir == "vendor" || dir == "third_party" || dir == "node_modules" || dir == "bower_components"; + if( vendoring || ( dir.size() > 1 && dir.front() == '.' && dir != ".." ) ) + { + return true; + } + } + return false; +} + inline constexpr float kRankTierTestMul = 0.35f; inline constexpr float kRankTierDemoMul = 0.35f; diff --git a/src/forgraphverb.h b/src/forgraphverb.h index ff16c0310..00c7d1b96 100644 --- a/src/forgraphverb.h +++ b/src/forgraphverb.h @@ -25,6 +25,7 @@ #include "pathgaps.h" // resolvePathEndpoint — the --path resolver #include "pathpairs.h" // pathDefInTests — the --defs class="test" rule (M1) #include "defattrib.h" // endpointDefinitionCount — from= binds one definition (M3) +#include "docparse.h" // hasGeneratedMarker / readWholeFile — a generated or copied file's banner (CALLERS-TWO-COPY-BIND) #include "backhops.h" // DeclinedCrossRule — a builtin-spelled declined call is no crossing (M3) #include "infra/emit.h" // emitTo — the met_bridge disclosure's stderr line #include "serialize.h" // escapeXml @@ -82,6 +83,22 @@ inline std::optional soleDefinitionSpelling( const IngestResult& in return std::nullopt; } +// The M1 survivors of `spec`: its fitting definitions less the test/fixture-path, bodyless and doc-unit ones, in the resolver's order; +// nullopt when the spelling was not refused over two or more fitting definitions all placed (an unplaced one is never listed). +inline std::optional> sourceOnlyKeptDefs( const IngestResult& ing, std::string_view spec ) +{ + std::size_t fitted = 0; + std::vector fits; + (void)resolveAllByWrittenSpelling( ing, spec, {}, &fitted, &fits ); + if( fitted < 2 || fits.size() != fitted ) + { + return std::nullopt; + } + std::erase_if( fits, [ & ]( NodeId id ) + { return id >= ing.symbols.size() || !isDefinitionNotDeclaration( ing.symbols[ id ] ) || pathDefInTests( ing, id ) || isDocUnit( ing.symbols[ id ] ); } ); + return fits; +} + // GV-ASSEMBLY M1 ESRC (endpoint source-prefer; ORCH reports/s0-xh-1110.md, rule frozen there). A task spelling the resolver REFUSES // because several definitions fit it (`ApplicationRef.tick` on angular: the source method plus two bodyless mocks under a tests/ // tree) leaves the graph question unasked, though only one of them is code the task can mean. On that refusal only, the fitting @@ -92,26 +109,65 @@ inline std::optional soleDefinitionSpelling( const IngestResult& in // as before. The block discloses the narrowing (narrowed= on the open tag), so verb= is the one call that ran. inline std::optional sourceOnlyPickSpelling( const IngestResult& ing, std::string_view spec ) { - std::size_t fitted = 0; - std::vector fits; - (void)resolveAllByWrittenSpelling( ing, spec, {}, &fitted, &fits ); - if( fitted < 2 || fits.size() != fitted ) + const std::optional> kept = sourceOnlyKeptDefs( ing, spec ); + if( !kept || kept->size() != 1 ) { return std::nullopt; } - std::vector kept; - for( const NodeId id : fits ) + return soleDefinitionSpelling( ing, kept->front() ); +} + +// CALLERS-TWO-COPY-BIND: is definition `id` a COPY of code that lives elsewhere: a file under a CI/tool dot directory, a vendoring +// directory or the demo/generated tier (filter.h isToolOrVendoredPath, the --for subject anchor's rule), or a file whose head +// declares it generated or copied (docparse.h hasGeneratedMarker: vscode's extensions/copilot/src/util/vs tree opens with +// "DO NOT modify, this file was COPIED"). An unreadable file is not called a copy. +inline bool definitionIsCopy( const IngestResult& ing, NodeId id ) +{ + const std::uint32_t f = ing.symbols[ id ].fileId; + if( isToolOrVendoredPath( rootRelPath( ing, f ) ) ) + { + return true; + } + const std::optional text = docparse::detail::readWholeFile( diskPath( ing, f ) ); + return text && docparse::hasGeneratedMarker( *text ); +} + +// CALLERS-TWO-COPY-BIND (owner 11-17: "bind source, disclose"). A callers spelling M1 still refuses because two or more source-looking +// definitions survive it (sourceOnlyKeptDefs), where all but ONE are copies (definitionIsCopy): the answer is that one's own +// spelling, and `copies` names the copies the answer leaves out (resolver order), so the reader can ask for one. Two non-copies +// left, or none, → nullopt: refused as before. +struct SourceCopyPick +{ + std::string spelling; + std::vector copies; +}; +inline std::optional sourceCopyPick( const IngestResult& ing, std::string_view spec ) +{ + std::optional> kept = sourceOnlyKeptDefs( ing, spec ); + if( !kept || kept->size() < 2 ) + { + return std::nullopt; // M1's own case (one left) or nothing left + } + SourceCopyPick pick; + NodeId source = kNoNode; + for( const NodeId id : *kept ) { - if( id < ing.symbols.size() && isDefinitionNotDeclaration( ing.symbols[ id ] ) && !pathDefInTests( ing, id ) && !isDocUnit( ing.symbols[ id ] ) ) + if( definitionIsCopy( ing, id ) ) { - kept.push_back( id ); + pick.copies.push_back( id ); + } + else if( std::exchange( source, id ) != kNoNode ) + { + return std::nullopt; // two source definitions: no pick } } - if( kept.size() != 1 ) + std::optional spelling = source == kNoNode ? std::nullopt : soleDefinitionSpelling( ing, source ); + if( !spelling ) { return std::nullopt; } - return soleDefinitionSpelling( ing, kept.front() ); + pick.spelling = std::move( *spelling ); + return pick; } // Does the graph verb of `form` bind `spec` as written: the --path resolver (a glob included), the --callers one, the --connect one. @@ -141,16 +197,36 @@ inline std::optional narrowRefusedSpelling( const IngestResult& ing return std::nullopt; } +// The spelling a refused CALLERS selector binds instead: the M1 pick (narrowRefusedSpelling), else (CALLERS-TWO-COPY-BIND) the one +// source definition beside its copies (sourceCopyPick; `copies` receives them), each kept only when --callers binds it; nullopt = +// refused as before. +inline std::optional callersRefusedPick( const IngestResult& ing, std::string_view sym, std::vector& copies ) +{ + if( std::optional pick = narrowRefusedSpelling( ing, sym, GraphSubjectForm::Callers ) ) + { + return pick; + } + std::optional two = sourceCopyPick( ing, sym ); + if( !two || !graphFormResolves( ing, GraphSubjectForm::Callers, two->spelling ) ) + { + return std::nullopt; + } + copies = std::move( two->copies ); + return std::move( two->spelling ); +} + // GV-PATH-BIND + CALLERS-TWO-COPY: the ONE binder of the one-hop rows every surface serves — the CLI --callers/--callees and MCP // find_referencing_symbols / find_symbol / the callers verb. The rows of `sym`; for a CALLERS selector that binds nothing as typed and that -// the M1 rule narrows to one source definition (narrowRefusedSpelling), the rows of that definition's own spelling: `bound` holds it, `sym` -// is moved onto it and the rows' `narrowed` names the selector as typed. Otherwise the rows as typed (empty matches: the caller refuses as -// before). MCP used to call callHierarchyRows directly and refused the spelling the CLI answered. +// callersRefusedPick binds to one source definition, the rows of that definition's own spelling: `bound` holds it, `sym` is moved +// onto it, the rows' `narrowed` names the selector as typed and `copies` the copies left out (CALLERS-TWO-COPY-BIND). Otherwise the +// rows as typed (empty matches: the caller refuses as before). MCP used to call callHierarchyRows directly and refused the spelling +// the CLI answered. inline CallHierarchyRows callHierarchyRowsNarrowed( const IngestResult& ing, const Graph& g, std::string_view& sym, bool wantCallers, std::string& bound, const ValueRefIndex* valueIndex = nullptr ) // the MCP server passes its cached one { CallHierarchyRows rows = callHierarchyRows( ing, g, sym, wantCallers, valueIndex ); - std::optional pick = wantCallers && rows.matches.empty() ? narrowRefusedSpelling( ing, sym, GraphSubjectForm::Callers ) : std::nullopt; + std::vector copies; + std::optional pick = wantCallers && rows.matches.empty() ? callersRefusedPick( ing, sym, copies ) : std::nullopt; if( !pick ) { return rows; @@ -161,11 +237,67 @@ inline CallHierarchyRows callHierarchyRowsNarrowed( const IngestResult& ing, con return rows; } narrowedRows.narrowed.emplace_back( sym ); + narrowedRows.copies = std::move( copies ); bound = std::move( *pick ); sym = bound; return narrowedRows; } +// CALLERS-TWO-COPY-BIND: the disclosure of the copies a two-copy bind left out, every dialect from one place. copy_p= lists each copy +// as p:line (space-separated, resolver order); copy_next= is the callers call on the first, by the spelling that binds it alone +// (soleDefinitionSpelling; absent when none does). Empty with no copies (0 bytes). +struct SourceCopyDisclosure +{ + std::string p; // "file:line file:line" + std::string next; // "--callers=file:name", or "" +}; +inline SourceCopyDisclosure sourceCopyDisclosure( const IngestResult& ing, std::span copies ) +{ + SourceCopyDisclosure out; + for( const NodeId id : copies ) + { + const Symbol& s = ing.symbols[ id ]; + out.p += ( out.p.empty() ? "" : " " ) + std::string( rootRelPath( ing, s.fileId ) ) + ":" + std::to_string( s.line ); + } + if( !copies.empty() ) + { + const std::optional sel = soleDefinitionSpelling( ing, copies.front() ); + out.next = sel ? nextFlag( "--callers=", *sel ) : std::string(); + } + return out; +} +inline std::string sourceCopyAttrXml( const IngestResult& ing, std::span copies ) +{ + if( copies.empty() ) + { + return {}; + } + const SourceCopyDisclosure d = sourceCopyDisclosure( ing, copies ); + std::vector esc; + std::string out = " copy_p=\"" + std::string( escapeXml( d.p, esc ) ) + "\""; + return d.next.empty() ? out : out + " copy_next=\"" + std::string( escapeXml( d.next, esc ) ) + "\""; +} +inline std::string sourceCopyKeysJson( const IngestResult& ing, std::span copies ) +{ + if( copies.empty() ) + { + return {}; + } + const SourceCopyDisclosure d = sourceCopyDisclosure( ing, copies ); + const std::string out = ",\"copy_p\":\"" + jsonStr( d.p ) + "\""; + return d.next.empty() ? out : out + ",\"copy_next\":\"" + jsonStr( d.next ) + "\""; +} + +// The legend clause for copy_p= / copy_next= (present only with them; no period inside, so it reads as one sentence). +inline constexpr std::string_view kSourceCopyLegend = + "copy_p=: beside narrowed=, the other definitions the spelling fits are COPIES (under a CI/tool dot directory, a vendoring " + "directory or the demo/generated tier, or their file opens with a generated or copied banner), so the one source definition " + "answers and the copies (p:line each) are not counted; copy_next= is the callers call on the first copy. "; +inline std::string_view sourceCopyLegend( bool on ) noexcept +{ + return on ? kSourceCopyLegend : std::string_view(); +} + // ` narrowed="a b"`: the spellings as typed that M1 narrowed, space-separated; "" when none. The --for block's open tag and the direct // verbs' roots spell it alike. inline std::string narrowedAttrXml( std::span narrowed ) diff --git a/src/forliteral.h b/src/forliteral.h index 09250da2d..b2495f970 100644 --- a/src/forliteral.h +++ b/src/forliteral.h @@ -118,7 +118,7 @@ #include "taskroute.h" // taskroute::identifierRunOf #include "siblift.h" // siblift_detail::dirOf — a path's directory #include "forreadercallers.h" // renderReaderCallers — READER-CALLERS: the callers of the shown rows' reader functions -#include "subjectanchor.h" // subject_detail::sourceClassDef / isToolOrVendoredPath — the answer's source-class anchors +#include "subjectanchor.h" // subject_detail::sourceClassDef / isToolOrVendoredPath (filter.h) — the answer's source-class anchors #include #include diff --git a/src/mcpverbs.h b/src/mcpverbs.h index b710095f7..aec238487 100644 --- a/src/mcpverbs.h +++ b/src/mcpverbs.h @@ -943,6 +943,7 @@ inline std::string symbolQueryJson( const std::string& root, const std::string& // stay (mcpattrparitycheck), and count_of names the array they total, right beside them // (test/mcptwinclaimscheck.sh (C)). find_referencing_symbols has one array, so it needs no label. out += ( chRows.narrowed.empty() ? std::string() : ",\"narrowed\":\"" + mcpdetail::jsonEscape( chRows.narrowed.front() ) + "\"" ) // GV-PATH-BIND: the CLI JSON root's key + + sourceCopyKeysJson( ing, chRows.copies ) // CALLERS-TWO-COPY-BIND: the CLI JSON root's copy_p / copy_next + ",\"defs\":" + std::to_string( chRows.matches.size() ) + ",\"count\":" + std::to_string( rowTotal ) + ( referencingOnly ? "" : ",\"count_of\":\"calls\"" ) @@ -996,6 +997,7 @@ inline std::string symbolQueryJson( const std::string& root, const std::string& out += nextFieldJson( viaImplLegend( anyImpl ), "impl_note" ); // lane L6: likewise for "via":"impl" out += nextFieldJson( narrowedVerbLegend( !chRows.narrowed.empty() ), "narrowed_note" ); // CALLERS-TWO-COPY: the CLI legend's narrowed= reading, only with the key out += nextFieldJson( std::string( viaMacroLegend( anyMacro ) ) + viaMacroCappedLegend( chRows.viaMacroWithheld > 0 ), "via_macro_note" ); // BX1 FIX 2; + the ceiling + out += nextFieldJson( sourceCopyLegend( !chRows.copies.empty() ), "copy_note" ); // CALLERS-TWO-COPY-BIND: likewise for copy_p / copy_next out += declinedSitesJson( sqDc, referencingOnly, /*mcp=*/true ); // lane declined-sites: the CLI rows, never in calls/calledBy or count out += nextFieldJson( declinedSitesLegend( declinedSitesLegendFlags( sqDc, referencingOnly, sqDcCut ), /*mcp=*/true ), "declined_note" ); // their reading, only when they ride out += nextFieldJson( callSitesAtLegend( calledBySites.any, calledBySites.anyCut, kCallSitesPerRowCap ), "sites_note" ); // CALLSITE-AT: its reading, only when a row carries it (nextFieldJson: "" -> no key, JSON-escaped) diff --git a/src/subjectanchor.h b/src/subjectanchor.h index 62f2872f7..dcf82b448 100644 --- a/src/subjectanchor.h +++ b/src/subjectanchor.h @@ -240,27 +240,6 @@ inline bool isGraphForm( std::string_view task, const std::vector 1 && dir.front() == '.' && dir != ".." ) ) - { - return true; - } - } - return false; -} - inline bool sourceClassDef( const IngestResult& ing, NodeId id ) { const Symbol& s = ing.symbols[id]; diff --git a/src/verbs_navigate.h b/src/verbs_navigate.h index c84d655b6..4af253b0d 100644 --- a/src/verbs_navigate.h +++ b/src/verbs_navigate.h @@ -195,7 +195,7 @@ inline int emitCallHierarchyAlt( const rw::Config& cfg, const rw::IngestResult& if( cfg.columnar ) { std::vector page( result.begin() + pw.begin, result.begin() + pw.end ); - const std::string attr = "of=\"" + ex( sym ) + "\"" + rw::narrowedAttrXml( chRows.narrowed ) + " defs=\"" + std::to_string( matches.size() ) + const std::string attr = "of=\"" + ex( sym ) + "\"" + rw::narrowedAttrXml( chRows.narrowed ) + rw::sourceCopyAttrXml( ing, chRows.copies ) + " defs=\"" + std::to_string( matches.size() ) + "\" count=\"" + std::to_string( result.size() ) + "\"" + ( !wantCallers && bodylessDefsCount > 0 ? " bodyless_defs=\"" + std::to_string( bodylessDefsCount ) + "\"" : "" ) + chUnprovenAttr @@ -234,8 +234,9 @@ inline int emitCallHierarchyAlt( const rw::Config& cfg, const rw::IngestResult& nullptr, &pageTest, &chDcCols.paths } ); // + the block and the rows; TIER-FOLLOWUP: return 0; } - rw::emitTo( stdout, "{{\"of\":\"{}\"{},\"defs\":{},\"count\":{}", jsonStr( sym ).c_str(), - chRows.narrowed.empty() ? std::string() : ",\"narrowed\":\"" + jsonStr( chRows.narrowed.front() ) + "\"", matches.size(), result.size() ); // GV-PATH-BIND + rw::emitTo( stdout, "{{\"of\":\"{}\"{}{},\"defs\":{},\"count\":{}", jsonStr( sym ).c_str(), + chRows.narrowed.empty() ? std::string() : ",\"narrowed\":\"" + jsonStr( chRows.narrowed.front() ) + "\"", // GV-PATH-BIND + rw::sourceCopyKeysJson( ing, chRows.copies ), matches.size(), result.size() ); // CALLERS-TWO-COPY-BIND if( !wantCallers && bodylessDefsCount > 0 ) { rw::emitTo( stdout, ",\"bodyless_defs\":{}", bodylessDefsCount ); @@ -469,7 +470,8 @@ std::optional runCallHierarchy( const MainDispatch& d ) + rw::valueRefsDepthLegendFor( chRows.valueRefs ) // exactly when the root carries the depth disclosure + rw::patternDispatchLegend( !chRows.valueRefs.patternSites.empty() || !chRows.valueRefs.patternWideSites.empty(), wantCallers ) + std::string( rw::slotJoinLegend( wantCallers ? chRows.valueRefs.slotCallers : !chRows.valueRefs.slotSites.empty(), wantCallers, wantCallers && chRows.valueRefs.slotCands ) ) // IX-1: exactly when a slot join rides - + std::string( rw::closureBlocksLegend( !chClosures.empty() ) ) + std::string( rw::narrowedVerbLegend( !chRows.narrowed.empty() ) ) ).c_str(), // IX-3: exactly when pattern_dispatch= rides; ix2-slice: exactly when an block rides + + std::string( rw::closureBlocksLegend( !chClosures.empty() ) ) + std::string( rw::narrowedVerbLegend( !chRows.narrowed.empty() ) ) + + std::string( rw::sourceCopyLegend( !chRows.copies.empty() ) ) ).c_str(), // IX-3: exactly when pattern_dispatch= rides; ix2-slice: exactly when an block rides rw::rootRelPathsLegend( chSingleRoot ), rw::multiRootTableLegend( ing.rootLabels.size() >= 2 ) ); if( cfg.columnar && chHasLink ) @@ -518,8 +520,9 @@ std::optional runCallHierarchy( const MainDispatch& d ) // §P10.6: defs= = resolved definitions this name matched (matches.size()) — the rows below UNION the // neighbors of every def, which --uses/--impact already disclose and these two verbs silently hid. - rw::emitTo( stdout, "<{} of=\"{}\"{} defs=\"{}\" count=\"{}\"{}", tag, ex( sym ).c_str(), rw::narrowedAttrXml( chRows.narrowed ), matches.size(), result.size(), - chRootAttr.c_str() ); // GV-PATH-BIND: narrowed= beside the of= it qualifies + rw::emitTo( stdout, "<{} of=\"{}\"{}{} defs=\"{}\" count=\"{}\"{}", tag, ex( sym ).c_str(), rw::narrowedAttrXml( chRows.narrowed ), + rw::sourceCopyAttrXml( ing, chRows.copies ), matches.size(), result.size(), + chRootAttr.c_str() ); // GV-PATH-BIND: narrowed= beside the of= it qualifies; CALLERS-TWO-COPY-BIND: copy_p= / copy_next= if( !wantCallers && bodylessDefsCount > 0 ) { rw::emitTo( stdout, " bodyless_defs=\"{}\"", bodylessDefsCount ); diff --git a/test/gvassemblycheck.sh b/test/gvassemblycheck.sh index db2f30142..922613c83 100755 --- a/test/gvassemblycheck.sh +++ b/test/gvassemblycheck.sh @@ -20,6 +20,17 @@ # the definition that joins, as for any many-definition name) # (d5) CALLERS-TWO-COPY: MCP find_referencing_symbols binds through the same callHierarchyRowsNarrowed: the d3 answer # (narrowed, bootApp), and the d4 fixture still refuses +# CALLERS-TWO-COPY-BIND (owner 11-17 "bind source, disclose"; src/forgraphverb.h sourceCopyPick): when M1 leaves two bodied +# definitions and all but ONE are COPIES (a CI/tool dot dir, a vendoring dir, the demo/generated tier, or a file opening with a +# generated/copied banner), --callers binds the source one and names the copies +# (d6) a copied-banner twin (the vscode extensions/copilot/src/util/vs shape): --callers=ApplicationRef.tick rc 0, of= the source +# definition, narrowed=, copy_p= the copy's p:line, copy_next= the callers call on the copy (which itself binds the copy alone), +# bootApp listed, the readings in the compact and full legends, and the answer == the explicit call's apart from that disclosure +# (d7) NEGATIVE: neither definition left is source (a banner copy + a .github copy, no src/ one) -> still refused (rc 1), no copy_p=; +# the d4 two-source refusal carries no copy_p= either +# (d8) MCP find_referencing_symbols answers the same copy as the CLI: the bound file, narrowed, copy_p, copy_next equal the CLI --json +# root's, and the MCP answer carries copy_note +# (e4) --for is not reached: `callers of ApplicationRef.tick` on the d6 tree appends no graph block (the M1 rule alone binds there) # M3 MET-BRIDGE: an unreached path whose search reached a caller of to= prints the proven prefix and the one crossing. # (b1) onFileEvent -> ConnectionManagerImpl::onData (a virtual `filter->onData( 1 )` the graph declines): AF2 E1 puts the bridge AHEAD # of (after_gap=0); "$F1V/extensions/copilot/src/util/vs/app/application_ref.ts" <<'T' +//!!! DO NOT modify, this file was COPIED from 'upstream/src/app' +export class ApplicationRef { + tick(): void { copyTick(); } +} +function copyTick(): void {} +T +# the neither-source twin: the banner copy and a .github copy, no src/ definition left +F1X="$TMP/fx1x"; cp -R "$F1V" "$F1X"; rm -f "$F1X/src/app/application_ref.ts"; mkdir -p "$F1X/.github/actions/app" +cat > "$F1X/.github/actions/app/application_ref.ts" <<'T' +export class ApplicationRef { + tick(): void { ghTick(); } +} +function ghTick(): void {} +T + # ── M3 fixtures ── F3="$TMP/fx3"; mkdir -p "$F3/src" cat > "$F3/src/filter.h" <<'C' @@ -238,7 +267,7 @@ else no "(d4) rc=$( rc d4p )/$( rc d4c )/$( rc d4k ) narrowed=$d4n"; fi # callHierarchyRowsNarrowed), so ApplicationRef.tick narrows to the one source definition there too ("narrowed", its # note, bootApp in calledBy), where MCP called callHierarchyRows directly and refused it. NEGATIVE: the two-source # fixture still refuses on MCP, as --callers does (d4). RED on the base binary (MCP answered -32602 / not found). -mcpq(){ python3 - "$BIN" "$1" "$2" <<'PY' +mcpq(){ python3 - "$BIN" "$1" "$2" ${3:+"$3"} <<'PY' import json, subprocess, sys binp, root, verb = sys.argv[1], sys.argv[2], sys.argv[3] reqs = [ { "jsonrpc": "2.0", "id": 0, "method": "initialize", "params": { "protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": { "name": "g", "version": "1" } } }, @@ -260,6 +289,10 @@ for line in p.stdout.splitlines(): names = [ e.get( "name" ) for e in j.get( "calledBy", [] ) ] print( "ok", "narrowed=" + str( j.get( "narrowed", "-" ) ), "note=" + ( "1" if "narrowed_note" in j else "0" ), "defs=" + str( j.get( "defs" ) ), "calledBy=" + ",".join( n for n in names if n ) ) + if len( sys.argv ) > 4: # (d8): the fields the CLI --json root carries, for the twin comparison + sym = j.get( "symbol" ) if isinstance( j.get( "symbol" ), dict ) else {} + print( "file=%s narrowed=%s copy_p=%s copy_next=%s copy_note=%d" % ( str( sym.get( "p", sym.get( "file", "-" ) ) ).split( ":" )[0], j.get( "narrowed", "-" ), j.get( "copy_p", "-" ), + j.get( "copy_next", "-" ), int( "copy_note" in j ) ) ) break else: print( "err no response" ) @@ -278,6 +311,62 @@ case "$d5b" in *) no "(d5) negative: want the -32602 symbol-not-found refusal for ApplicationRef.tick, got [$d5b]" ;; esac +# ── CALLERS-TWO-COPY-BIND ── +# (d6) the copied-banner twin: --callers binds the source definition and names the copy +run "$F1V" d6 --callers=ApplicationRef.tick +run "$F1V" d6f --callers=ApplicationRef.tick --legend=full +run "$F1V" d6v --callers=src/app/application_ref.ts:tick +d6of="$( rootattr d6 callers of )"; d6nar="$( rootattr d6 callers narrowed )"; d6cp="$( rootattr d6 callers copy_p )"; d6cn="$( rootattr d6 callers copy_next )" +# "eq=1" when the bound answer equals the explicit call's once narrowed=/copy_p=/copy_next= and their compact readings are taken out +d6eq="$( python3 - "$TMP/d6.xml" "$TMP/d6v.xml" <<'PY' +import re, sys +a = open( sys.argv[1], encoding="utf8", errors="replace" ).read() +b = open( sys.argv[2], encoding="utf8", errors="replace" ).read() +reads = len( re.findall( r'copy_p=: ', a ) ) + len( re.findall( r'copy_next=: ', a ) ) +cut = re.sub( r' (narrowed|copy_p|copy_next)="[^"]*"', '', a ) +cut = re.sub( r'(narrowed|copy_p|copy_next)=: [^.]*\. ?', '', cut ) +mask = lambda s: re.sub( r' est_tokens="\d+"', '', s ) +print( "eq=%d reads=%d" % ( int( mask( cut ) == mask( b ) and b != '' ), reads ) ) +PY +)" +cp_sel="${d6cn#--callers=}" +run "$F1V" d6c "--callers=$cp_sel" +if [ "$( rc d6 )" = 0 ] && [ "$( rc d6f )" = 0 ] && [ "$( rc d6v )" = 0 ] && [ "$d6of" = "src/app/application_ref.ts:tick" ] && [ "$d6nar" = "ApplicationRef.tick" ] \ + && [ "$d6cp" = "extensions/copilot/src/util/vs/app/application_ref.ts:3" ] && [ "$d6cn" = "--callers=extensions/copilot/src/util/vs/app/application_ref.ts:tick" ] \ + && grep -q 'n="bootApp"' "$TMP/d6.xml" && [ "$d6eq" = "eq=1 reads=2" ] && grep -q 'copy_p=: beside narrowed=' "$TMP/d6f.xml" \ + && [ "$( rc d6c )" = 0 ] && [ "$( rootattr d6c callers defs )" = 1 ] && [ "$( rootattr d6c callers copy_p )" = "-" ]; then + ok "(d6) banner copy: --callers binds of=$d6of (narrowed=$d6nar), copy_p=$d6cp, copy_next= binds the copy alone, == the explicit call ($d6eq)" +else no "(d6) rc=$( rc d6 )/$( rc d6f )/$( rc d6v )/$( rc d6c ) of='$d6of' narrowed='$d6nar' copy_p='$d6cp' copy_next='$d6cn' $d6eq"; fi + +# (d7) negative: no source definition left (a banner copy + a .github copy) -> still refused, no disclosure; nor on d4's refusal +run "$F1X" d7 --callers=ApplicationRef.tick +if [ "$( rc d7 )" = 1 ] && grep -q 'found="0" refused=' "$TMP/d7.xml" && [ "$( count d7 'copy_p' )" = 0 ] && [ "$( count d7 'narrowed' )" = 0 ] \ + && [ "$( count d4k 'copy_p' )" = 0 ]; then + ok "(d7) neither definition is source: --callers still refuses (rc 1), no copy_p=/narrowed=; the two-source refusal (d4) has no copy_p= either" +else no "(d7) rc=$( rc d7 ) copy_p=$( count d7 'copy_p' )/$( count d4k 'copy_p' ) narrowed=$( count d7 'narrowed' )"; fi + +# (d8) MCP answers the same copy as the CLI +run "$F1V" d8j --callers=ApplicationRef.tick --json --legend=full # (--legend=compact is XML-only and refuses with --json) +d8cli="$( python3 - "$TMP/d8j.xml" <<'PY' +import json, sys +try: + j = json.loads( open( sys.argv[1], encoding="utf8" ).read() ) +except ValueError: + print( "unparsable" ); sys.exit() +print( "file=%s narrowed=%s copy_p=%s copy_next=%s copy_note=1" % ( j.get( "of", "-" ).split( ":" )[0], j.get( "narrowed", "-" ), j.get( "copy_p", "-" ), j.get( "copy_next", "-" ) ) ) +PY +)" +d8mcp="$( mcpq "$F1V" find_referencing_symbols twin | sed -n 2p )" +if [ "$( rc d8j )" = 0 ] && [ -n "$d8mcp" ] && [ "$d8mcp" = "$d8cli" ] && [ "${d8cli#*copy_p=extensions/}" != "$d8cli" ]; then + ok "(d8) MCP find_referencing_symbols == CLI --json on the two-copy bind: $d8mcp" +else no "(d8) CLI [$d8cli] vs MCP [$d8mcp]"; fi + +# (e4) --for is not reached by the two-copy bind +run "$F1V" e4 --for="callers of ApplicationRef.tick" +if [ "$( rc e4 )" = 0 ] && [ "$( count e4 ' Date: Mon, 23 Nov 2026 20:22:36 -0500 Subject: [PATCH 2/5] fix(lint): --lint's shipped tier calls rw::isToolOrVendoredPath from filter.h (rebase onto 0.7.0) Main's LT1 (src/verbs_lint.h) called subject_detail::isToolOrVendoredPath from subjectanchor.h; this lane moved that function unchanged to filter.h so the --callers copy pick can share it. The call and its include follow it. Same function, same tier: --lint's output does not move. Co-Authored-By: Claude Opus 5.5 --- src/verbs_lint.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/verbs_lint.h b/src/verbs_lint.h index 268d763d3..aec3b8ea7 100644 --- a/src/verbs_lint.h +++ b/src/verbs_lint.h @@ -8,7 +8,7 @@ #include "valuerefs.h" // VrRender / vrPath — a row's p= spelled as every other verb's #include "outputceiling.h" // kOutputCeilingChars — the default page's byte ceiling (CL1) #include "nextverb.h" // nextFlag — findings_next='s pasteable spelling (knob-honesty-068) -#include "subjectanchor.h" // isToolOrVendoredPath — the shipped-not-authored path tier --lint's order sorts last (LT1) +#include "filter.h" // isToolOrVendoredPath — the shipped-not-authored path tier --lint's order sorts last (LT1) #include "infra/emit.h" // rw::emitTo — THE emitter: std::print where the library has , std::format+fputs // where it does not, chosen by feature test and DISCLOSED as emit= on --version. The // pilot conversion used to spell the fallback here; the choice now lives in one header. @@ -1019,7 +1019,7 @@ struct LintRowOrder }; // The files nobody here authors, by the house's OWN verdicts — no new heuristic: a tool / vendored / generated path -// (subjectanchor.h subject_detail::isToolOrVendoredPath, which already holds filter.h's demo/generated table), a minified file +// (filter.h rw::isToolOrVendoredPath, which already holds the demo/generated table), a minified file // (--skipped's minified-suspect, ingest.h isMinifiedHealth), and a bundle (filter.h's evidence tier, vendoredBundleFiles). std::vector lintShippedFiles( const rw::IngestResult& ing ) { @@ -1027,7 +1027,7 @@ std::vector lintShippedFiles( const rw::IngestResult& ing ) for( std::uint32_t f = 0; f < shipped.size(); ++f ) { const bool minified = f < ing.fileHealth.size() && rw::isMinifiedHealth( ing.fileHealth[f] ); - shipped[f] = char( shipped[f] != 0 || minified || rw::subject_detail::isToolOrVendoredPath( rw::rootRelPath( ing, f ) ) ); + shipped[f] = char( shipped[f] != 0 || minified || rw::isToolOrVendoredPath( rw::rootRelPath( ing, f ) ) ); } return shipped; } From 319c9f0e2284cbb1c7a08cfb7481133a0eb71c71 Mon Sep 17 00:00:00 2001 From: joyful-ii-V-I <210578314+joyful-ii-V-I@users.noreply.github.com> Date: Mon, 23 Nov 2026 21:59:42 -0500 Subject: [PATCH 3/5] docs: re-record the showcase's --legend-dict block for copy_p / copy_next; rebuild docs/COMMANDS.md The newest capture (2026-11-23) named main's dictionary (dictv=6c4aa81a81163d18 entries=1320); showcasecapturecheck (I) compares it with the live binary (0d983acad983c50f / 1322). Only that block is re-taken, with the capture's own fmt_block/publish_block; docs/docs_commands_build.py rebuilds the Try-it sample. Co-Authored-By: Claude Opus 5.5 --- docs/COMMANDS.md | 2 +- docs/captures/COMMANDS_showcase_2026-11-23.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/COMMANDS.md b/docs/COMMANDS.md index 4a1869c41..76996f389 100644 --- a/docs/COMMANDS.md +++ b/docs/COMMANDS.md @@ -4790,7 +4790,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=6c4aa81a81163d18 entries=1320 +ripwire legend dictionary ripwire.dict/v1 dictv=0d983acad983c50f entries=1322 : 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=) diff --git a/docs/captures/COMMANDS_showcase_2026-11-23.md b/docs/captures/COMMANDS_showcase_2026-11-23.md index 2ebb20aa8..f5f9cd03d 100644 --- a/docs/captures/COMMANDS_showcase_2026-11-23.md +++ b/docs/captures/COMMANDS_showcase_2026-11-23.md @@ -6325,7 +6325,7 @@ ripwire: --run-timeout=SECONDS modifies --run-trace — pass it too (e.g. ripwir *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=6c4aa81a81163d18 entries=1320 +ripwire legend dictionary ripwire.dict/v1 dictv=0d983acad983c50f entries=1322 : 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=) @@ -6355,7 +6355,7 @@ ripwire.pack-task/v1 : one-call task bundle for task= under budget_tokens=: 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: 503 more bytes on this line] -… [1297 more display lines; full output is 168197 bytes on 1321 raw line(s)] +… [1299 more display lines; full output is 168478 bytes on 1323 raw line(s)] ````` ## `./build/ripwire . --lint --lint-select=cache-` From 7b4c9a6fc9f536c712820091bcc826631e4cb06c Mon Sep 17 00:00:00 2001 From: joyful-ii-V-I <210578314+joyful-ii-V-I@users.noreply.github.com> Date: Tue, 24 Nov 2026 00:23:04 -0500 Subject: [PATCH 4/5] fix(callers): render copy_next= with nextAttrXml so a quoted copy path stays pasteable sourceCopyAttrXml wrote copy_next= through escapeXml, so a copy whose path has a space (nextFlag shell-quotes it) came out as --callers='.github/work flow.ts:tick', which does not paste. It now goes through nextAttrXml( d.next, "copy_next" ), the one next= escaper (apostrophes raw in the "-delimited attribute). JSON and MCP copy_next were already raw (jsonStr). New arm (d9) in test/gvassemblycheck.sh: red on 319c9f0e2, green here; it also pastes the value and checks the --json and MCP spelling. CodeRabbit #735 thread 4675004111. Co-Authored-By: Claude Opus 5.5 --- changelog.d/callers-two-copy-bind.md | 2 +- src/forgraphverb.h | 2 +- test/gvassemblycheck.sh | 28 ++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/changelog.d/callers-two-copy-bind.md b/changelog.d/callers-two-copy-bind.md index 9885026ad..451d14991 100644 --- a/changelog.d/callers-two-copy-bind.md +++ b/changelog.d/callers-two-copy-bind.md @@ -1,5 +1,5 @@ ### Changed — `--callers` binds the source copy of a two-copy method and names the copy -`--callers=Owner.method` used to refuse when the name had two bodied definitions and one of them was a copy, such as vscode's `extensions/copilot/src/util/vs/…` tree, whose files open with "DO NOT modify, this file was COPIED". Now, when every definition left after the test-path and bodyless ones are dropped is a copy except ONE, the source one answers. A copy is a file under a CI or tool dot directory, a vendoring directory or the demo/generated tier, or a file whose head declares it generated or copied. The root carries `narrowed=` as before, plus `copy_p=` (each copy as `p:line`) and `copy_next=` (the callers call on the first copy). MCP `find_referencing_symbols` and the `callers` batch verb answer the same copy (`copy_p` / `copy_next` / `copy_note`). Two source definitions, or none, still refuse. `--for` is unchanged. New arms (d6)-(d8) and (e4) in `test/gvassemblycheck.sh`. +`--callers=Owner.method` used to refuse when the name had two bodied definitions and one of them was a copy, such as vscode's `extensions/copilot/src/util/vs/…` tree, whose files open with "DO NOT modify, this file was COPIED". Now, when every definition left after the test-path and bodyless ones are dropped is a copy except ONE, the source one answers. A copy is a file under a CI or tool dot directory, a vendoring directory or the demo/generated tier, or a file whose head declares it generated or copied. The root carries `narrowed=` as before, plus `copy_p=` (each copy as `p:line`) and `copy_next=` (the callers call on the first copy). MCP `find_referencing_symbols` and the `callers` batch verb answer the same copy (`copy_p` / `copy_next` / `copy_note`). Two source definitions, or none, still refuse. `--for` is unchanged. New arms (d6)-(d9) and (e4) in `test/gvassemblycheck.sh`. Versions: the session legend dictionary moves to `dictv=93a964379c56ed78 entries=1131` (the `copy_p=` and `copy_next=` entries); docs/COMMANDS.md and the 2026-11-13 showcase capture record the new pair. diff --git a/src/forgraphverb.h b/src/forgraphverb.h index 00c7d1b96..7c57de478 100644 --- a/src/forgraphverb.h +++ b/src/forgraphverb.h @@ -275,7 +275,7 @@ inline std::string sourceCopyAttrXml( const IngestResult& ing, std::span esc; std::string out = " copy_p=\"" + std::string( escapeXml( d.p, esc ) ) + "\""; - return d.next.empty() ? out : out + " copy_next=\"" + std::string( escapeXml( d.next, esc ) ) + "\""; + return out + nextAttrXml( d.next, "copy_next" ); // nextFlag's shell quotes stay raw (the one next= escaper); empty next => nothing } inline std::string sourceCopyKeysJson( const IngestResult& ing, std::span copies ) { diff --git a/test/gvassemblycheck.sh b/test/gvassemblycheck.sh index 922613c83..a43efc043 100755 --- a/test/gvassemblycheck.sh +++ b/test/gvassemblycheck.sh @@ -30,6 +30,8 @@ # the d4 two-source refusal carries no copy_p= either # (d8) MCP find_referencing_symbols answers the same copy as the CLI: the bound file, narrowed, copy_p, copy_next equal the CLI --json # root's, and the MCP answer carries copy_note +# (d9) a space-bearing copy path (.github/work flow.ts): copy_next= keeps nextFlag's shell quotes raw (nextAttrXml), pastes to +# the copy alone, and the CLI --json / MCP copy_next carry the same value # (e4) --for is not reached: `callers of ApplicationRef.tick` on the d6 tree appends no graph block (the M1 rule alone binds there) # M3 MET-BRIDGE: an unreached path whose search reached a caller of to= prints the proven prefix and the one crossing. # (b1) onFileEvent -> ConnectionManagerImpl::onData (a virtual `filter->onData( 1 )` the graph declines): AF2 E1 puts the bridge AHEAD @@ -108,6 +110,14 @@ export class ApplicationRef { } function ghTick(): void {} T +# (d9) the space-bearing copy: a .github copy whose path has a space, so copy_next='s selector is shell-quoted +F1S="$TMP/fx1s"; cp -R "$F1" "$F1S"; mkdir -p "$F1S/.github" +cat > "$F1S/.github/work flow.ts" <<'T' +export class ApplicationRef { + tick(): void { wfTick(); } +} +function wfTick(): void {} +T # ── M3 fixtures ── F3="$TMP/fx3"; mkdir -p "$F3/src" @@ -361,6 +371,24 @@ if [ "$( rc d8j )" = 0 ] && [ -n "$d8mcp" ] && [ "$d8mcp" = "$d8cli" ] && [ "${d ok "(d8) MCP find_referencing_symbols == CLI --json on the two-copy bind: $d8mcp" else no "(d8) CLI [$d8cli] vs MCP [$d8mcp]"; fi +# (d9) a space-bearing copy path: copy_next= is the nextFlag-quoted call with its apostrophes RAW (nextAttrXml, the one next= +# escaper), not escapeXml's ' -- pasted out of the raw answer it binds the copy alone; the CLI --json and MCP spell the same +# value. RED before the fix (copy_next="--callers='.github/work flow.ts:tick'"). +want9="--callers='.github/work flow.ts:tick'" +run "$F1S" d9 --callers=ApplicationRef.tick +run "$F1S" d9j --callers=ApplicationRef.tick --json --legend=full +d9raw="$( python3 -c 'import re,sys; m=re.search(r" copy_next=\"([^\"]*)\"", open(sys.argv[1], encoding="utf8", errors="replace").read()); print(m.group(1) if m else "-")' "$TMP/d9.xml" )" +d9js="$( python3 -c 'import json,sys +try: print(json.loads(open(sys.argv[1], encoding="utf8").read()).get("copy_next","-")) +except ValueError: print("unparsable")' "$TMP/d9j.xml" )" +d9mcp="$( mcpq "$F1S" find_referencing_symbols twin | sed -n 2p )" +d9paste="$( cd "$F1S" && eval "\"\$BIN\" \"\$F1S\" --no-cache --legend=compact $d9raw" 2>/dev/null )"; d9prc=$? +d9pof="$( printf '%s' "$d9paste" | python3 -c 'import re,sys; m=re.search(r"]*\bof=\"([^\"]*)\"", sys.stdin.read()); print(m.group(1) if m else "-")' )" +if [ "$( rc d9 )" = 0 ] && [ "$d9raw" = "$want9" ] && [ "$( count d9 ''' )" = 0 ] && [ "$( rc d9j )" = 0 ] && [ "$d9js" = "$want9" ] \ + && [ "${d9mcp#*copy_next="$want9" copy_note=1}" != "$d9mcp" ] && [ "$d9prc" = 0 ] && [ "$d9pof" = ".github/work flow.ts:tick" ]; then + ok "(d9) space-bearing copy: copy_next=$d9raw raw (no '), pastes to of=$d9pof; --json and MCP spell it the same" +else no "(d9) rc=$( rc d9 )/$( rc d9j ) copy_next xml=[$d9raw] json=[$d9js] mcp=[$d9mcp] paste rc=$d9prc of=[$d9pof]"; fi + # (e4) --for is not reached by the two-copy bind run "$F1V" e4 --for="callers of ApplicationRef.tick" if [ "$( rc e4 )" = 0 ] && [ "$( count e4 ' Date: Tue, 24 Nov 2026 00:23:14 -0500 Subject: [PATCH 5/5] changelog: cite the generated dictionary pair dictv=0d983acad983c50f entries=1322 The note still named the pre-rebase pair (93a964379c56ed78 / 1131) and the 2026-11-13 capture. ripwire --legend-dict at this revision, docs/COMMANDS.md and docs/captures/COMMANDS_showcase_2026-11-23.md all record 0d983acad983c50f / 1322. CodeRabbit #735 thread 4675004104. Co-Authored-By: Claude Opus 5.5 --- changelog.d/callers-two-copy-bind.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/callers-two-copy-bind.md b/changelog.d/callers-two-copy-bind.md index 451d14991..ccce894c6 100644 --- a/changelog.d/callers-two-copy-bind.md +++ b/changelog.d/callers-two-copy-bind.md @@ -2,4 +2,4 @@ `--callers=Owner.method` used to refuse when the name had two bodied definitions and one of them was a copy, such as vscode's `extensions/copilot/src/util/vs/…` tree, whose files open with "DO NOT modify, this file was COPIED". Now, when every definition left after the test-path and bodyless ones are dropped is a copy except ONE, the source one answers. A copy is a file under a CI or tool dot directory, a vendoring directory or the demo/generated tier, or a file whose head declares it generated or copied. The root carries `narrowed=` as before, plus `copy_p=` (each copy as `p:line`) and `copy_next=` (the callers call on the first copy). MCP `find_referencing_symbols` and the `callers` batch verb answer the same copy (`copy_p` / `copy_next` / `copy_note`). Two source definitions, or none, still refuse. `--for` is unchanged. New arms (d6)-(d9) and (e4) in `test/gvassemblycheck.sh`. -Versions: the session legend dictionary moves to `dictv=93a964379c56ed78 entries=1131` (the `copy_p=` and `copy_next=` entries); docs/COMMANDS.md and the 2026-11-13 showcase capture record the new pair. +Versions: the session legend dictionary moves to `dictv=0d983acad983c50f entries=1322` (the `copy_p=` and `copy_next=` entries); docs/COMMANDS.md and the 2026-11-23 showcase capture record the new pair.