Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
TypeScript antigravity-skillsbusiness-knowledgeclaude-codeclaude-skillscodebase-analysiscodexcodex-skillsdeveloper-tools-ai-agentgemini-cli-skillskarpathy-llm-wikiknowledge-baseknowledge-graphmemoryopencode-skillspi-agentunderstandcodevibe-coding
fix(core): account for parameter-property declaration coverage
Lum1104e9389cfad747
diff --git a/docs/incremental/symbol-loss-validation.md b/docs/incremental/symbol-loss-validation.mdindex 34578ac1..0cbfe959 100644--- a/docs/incremental/symbol-loss-validation.md+++ b/docs/incremental/symbol-loss-validation.md@@ -29,7 +29,7 @@ Each source transition is checked independently from publication mechanics.| Identity | stable ID; alternate ID; reused ID; same name across owners; free function versus method; duplicate/overloaded source identities; moved lines || Supplemental names | exact same/different name; unknown name; reader/writer suffix; quoted/symbol spelling; escapes/interpolation || Scope | same class; another class; free scope; unresolved/shadowed/reassigned receiver; unrelated local/import aliases; bound installer alias; arbitrary evaluation |-| Syntax | JS/TS/JSX/TSX methods/properties/class expressions/assignments/property APIs; Ruby accessors/alias declarations/method installers; Python attributes/installers; Go/Rust/C++ receiver extraction |+| Syntax | JS/TS/JSX/TSX methods/properties/TypeScript parameter properties/class expressions/assignments/property APIs; Ruby accessors/alias declarations/method installers; Python attributes/installers; Go/Rust/C++ receiver extraction || Negative evidence | unrelated string, parameter, normal read/call; static installer for another symbol; another owner's accessor || Invalid evidence | unsupported parser/coverage adapter, parse recovery/error, empty extraction, missing evidence version/coverage profile, ambiguous old mapping || Publication | 20-to-1 omission; equal counts; merge/direct-finalize refusal; retry success/failure; stable prepare baseline; stale shards; deleted/excluded files; both data directories; current edge endpoint reuse |diff --git a/tests/skill/understand/test_symbol_evidence_matrix.test.mjs b/tests/skill/understand/test_symbol_evidence_matrix.test.mjsindex 959737fb..cdc26ec3 100644--- a/tests/skill/understand/test_symbol_evidence_matrix.test.mjs+++ b/tests/skill/understand/test_symbol_evidence_matrix.test.mjs@@ -340,4 +340,24 @@ describe('scoped symbol evidence contract', () => {expect(state.after.symbolEvidence.coverage.gaps).toContainEqual(expect.objectContaining({scope: {kind: 'unknown'}}));});+ it.each(['ts', 'tsx'])('distinguishes %s parameter properties from ordinary parameters and other owners', extension => {+ for (const modifier of ['public', 'protected', 'private', 'readonly', 'public readonly']) {+ for (const binding of ['run = () => {}', 'run?: () => void', 'other = () => {}']) {+ for (const owner of ['A', 'B']) {+ const code = `class A { keep() {} } class ${owner} { constructor(${modifier} ${binding}) {} }`;+ const result = classify(extension, code).result.missing[0];+ expect(result.status).toBe(owner === 'A' && binding.startsWith('run') ? 'unknown' : 'deleted');+ if (result.status === 'unknown') expect(result.evidence).toContainEqual(expect.objectContaining({+ name: 'run', scope: {kind: 'class', name: 'A'},+ reason: 'Parameter-property callability is not covered by structural extraction',+ }));+ }+ }+ }+ expect(classify(extension, 'class A { constructor(run = () => {}) {} keep() {} }')+ .result.missing[0].status).toBe('deleted');+ expect(classify(extension, 'class B { static Nested = class { constructor(public run = () => {}) {} } }')+ .result.missing[0].status).toBe('deleted');+ });+});diff --git a/understand-anything-plugin/packages/core/src/plugins/symbol-coverage.ts b/understand-anything-plugin/packages/core/src/plugins/symbol-coverage.tsindex 3b4bab3b..facd368a 100644--- a/understand-anything-plugin/packages/core/src/plugins/symbol-coverage.ts+++ b/understand-anything-plugin/packages/core/src/plugins/symbol-coverage.ts@@ -18,8 +18,16 @@ const NON_DECLARATION_NAMES = new Set(["export_specifier", "import_specifier", "const OPAQUE_DECLARATIONS = new Set(["macro_invocation", "preproc_call", "preproc_function_def"]);export const COVERAGE_LANGUAGES = new Set(["javascript", "typescript", "tsx", "ruby", "python", "go", "rust", "cpp"]);-export function declarationGap(node: Node, scope: SymbolScope): SymbolEvidenceEntry | null {+export function declarationGap(node: Node, scope: SymbolScope, receiver: SymbolScope): SymbolEvidenceEntry | null {const range: [number, number] = [node.startPosition.row + 1, node.endPosition.row + 1];+ // TypeScript parameter properties have both parameter-binding and class-+ // member roles. Their declaration target is the indexed receiver scope.+ if (["required_parameter", "optional_parameter"].includes(node.type)+ && node.children.some(child => ["accessibility_modifier", "readonly", "override_modifier", "override"].includes(child.type))) {+ return { kind: "callable", scope: receiver,+ name: declarationName(node.childForFieldName("pattern") ?? declarationKey(node)), lineRange: range,+ reason: "Parameter-property callability is not covered by structural extraction" };+ }if (OPAQUE_DECLARATIONS.has(node.type)) return { kind: null, scope: UNKNOWN_SCOPE, name: null,lineRange: range, reason: `Declaration expansion is not verified: ${node.type}` };const name = declarationKey(node);diff --git a/understand-anything-plugin/packages/core/src/plugins/symbol-evidence.ts b/understand-anything-plugin/packages/core/src/plugins/symbol-evidence.tsindex 77df1a38..adc77938 100644--- a/understand-anything-plugin/packages/core/src/plugins/symbol-evidence.ts+++ b/understand-anything-plugin/packages/core/src/plugins/symbol-evidence.ts@@ -97,7 +97,7 @@ export function collectSymbolEvidence(root: Node, structure: StructuralAnalysis,};const visit = (node: Node) => {const owner = scopes.declaration(node);- const gap = declarationGap(node, owner);+ const gap = declarationGap(node, owner, scopes.receiver(node));if (gap) coverage.gaps.push(gap);const declared = declarationKey(node);const declaredName = declared?.type === "computed_property_name" ? literal(declared.namedChildren[0]) : declarationName(declared);