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(incremental): treat runtime property installers as unresolved evidence
Lum110472e907a5ab7a
diff --git a/tests/skill/understand/test_incremental_symbols.test.mjs b/tests/skill/understand/test_incremental_symbols.test.mjsindex ad4a1da0..e0ba2ac5 100644--- a/tests/skill/understand/test_incremental_symbols.test.mjs+++ b/tests/skill/understand/test_incremental_symbols.test.mjs@@ -156,6 +156,8 @@ describe('incremental symbol matching', () => {['computed method', 'class A { ["run"]() {} }'],['computed name fragments', 'class A { ["r" + "un"]() {} keep() {} }'],['computed method assignment', 'class A { keep() {} }; A.prototype["r" + "un"] = function() {};'],+ ['computed property-definition call', 'class A { keep() {} }; Object.defineProperty(A.prototype, "r" + "un", { value() {} });'],+ ['computed reflection call', 'class A { keep() {} }; Reflect.defineProperty(A.prototype, "r" + "un", { value() {} });'],['escaped method assignment', String.raw`class A { keep() {} }; A.prototype.r\u0075n = function() {};`],['escaped identifier', String.raw`class A { r\u0075n() {} keep() {} }`],['escaped string method name', String.raw`class A { "r\u0075n"() {} keep() {} }`],diff --git a/tests/skill/understand/test_prepare_incremental.test.mjs b/tests/skill/understand/test_prepare_incremental.test.mjsindex 93ab9ff9..bdb9c1a0 100644--- a/tests/skill/understand/test_prepare_incremental.test.mjs+++ b/tests/skill/understand/test_prepare_incremental.test.mjs@@ -254,6 +254,8 @@ describe('incremental symbol publication gate', { timeout: 30_000 }, () => {it.each([['declaration', 'export class Service { ["method" + "0"]() { return 1; } method1() {} }\n'],['assignment', 'export class Service { method1() {} }; Service.prototype["method" + "0"] = function() {};\n'],+ ['property definition', 'export class Service { method1() {} }; Object.defineProperty(Service.prototype, "method" + "0", { value() {} });\n'],+ ['reflection', 'export class Service { method1() {} }; Reflect.defineProperty(Service.prototype, "method" + "0", { value() {} });\n'],])('does not publish a missing method whose computed %s still denotes the old symbol', (_label, source) => {const f = symbolFixture(2);const result = new Function(source.replace('export ', '') + '\nreturn Service;')();diff --git a/understand-anything-plugin/packages/core/src/plugins/tree-sitter-plugin.test.ts b/understand-anything-plugin/packages/core/src/plugins/tree-sitter-plugin.test.tsindex 909d7116..a6562fc3 100644--- a/understand-anything-plugin/packages/core/src/plugins/tree-sitter-plugin.test.ts+++ b/understand-anything-plugin/packages/core/src/plugins/tree-sitter-plugin.test.ts@@ -388,6 +388,13 @@ export class Greeter {'class A { keep() {} }; A.prototype[key] ||= function() {};','class A { keep() {} }; ({method: A.prototype[key]} = obj);',String.raw`class A { keep() {} }; A.prototype.r\u0075n = function() {};`,+ 'class A { keep() {} }; Object.defineProperty(A.prototype, "r" + "un", { value() {} });',+ 'class A { keep() {} }; Reflect.defineProperty(A.prototype, "r" + "un", { value() {} });',+ 'const define = Object.defineProperty; define(A.prototype, key, { value() {} });',+ 'const { defineProperty: define } = Object; define(A.prototype, key, { value() {} });',+ 'Object["define" + "Property"](A.prototype, key, { value() {} });',+ 'Reflect.set(A.prototype, "r" + "un", function() {});',+ 'Object.assign(A.prototype, descriptors);',]) {const result = plugin.analyzeFileStrict(filePath, code);expect(result.status).toBe("succeeded");diff --git a/understand-anything-plugin/packages/core/src/plugins/tree-sitter-plugin.ts b/understand-anything-plugin/packages/core/src/plugins/tree-sitter-plugin.tsindex bafd715a..9ca7280b 100644--- a/understand-anything-plugin/packages/core/src/plugins/tree-sitter-plugin.ts+++ b/understand-anything-plugin/packages/core/src/plugins/tree-sitter-plugin.ts@@ -302,9 +302,30 @@ export class TreeSitterPlugin implements AnalyzerPlugin {name.includes("\\") || name.includes("`") || name.startsWith("@")|| name.startsWith("r#") || name.normalize("NFKC") !== name,);+ const isJavaScriptExtractor = extractor.languageIds.some(id => id === "typescript" || id === "javascript");+ const propertyDefinitionNames = new Set(["defineProperty", "defineProperties", "__defineGetter__", "__defineSetter__"]);const pending = [tree.rootNode];while (pending.length > 0) {const node = pending.pop()!;+ if (isJavaScriptExtractor) {+ // Runtime property installers are not structural declarations. Mark+ // references as well as calls so local aliases/destructuring cannot+ // make a computed property name look like a confirmed deletion.+ if (["identifier", "property_identifier", "shorthand_property_identifier_pattern"].includes(node.type)+ && (propertyDefinitionNames.has(node.text) || node.text === "Reflect")) {+ hasUnresolvedNames = true;+ }+ if (node.type === "member_expression"+ && node.childForFieldName("object")?.text === "Object"+ && node.childForFieldName("property")?.text === "assign") {+ hasUnresolvedNames = true;+ }+ if (node.type === "call_expression") {+ const callee = node.childForFieldName("function");+ // A computed callee can itself select a property-definition API.+ if (callee?.type === "subscript_expression") hasUnresolvedNames = true;+ }+ }const methodName = ["method_definition", "method_signature", "abstract_method_signature"].includes(node.type)? node.childForFieldName("name") : null;// Valid syntax is not necessarily a name the extractor can resolve.@@ -314,7 +335,7 @@ export class TreeSitterPlugin implements AnalyzerPlugin {|| (methodName?.type === "string" && methodName.text.includes("\\"))) {hasUnresolvedNames = true;}- if (!hasUnresolvedNames && extractor.languageIds.some(id => id === "typescript" || id === "javascript")+ if (!hasUnresolvedNames && isJavaScriptExtractor&& ["assignment_expression", "augmented_assignment_expression"].includes(node.type)) {// Methods can also be installed through prototype/object writes.// Inspect the entire target for destructuring and wrapped accesses;diff --git a/understand-anything-plugin/skills/understand/SKILL.md b/understand-anything-plugin/skills/understand/SKILL.mdindex 5ed2676e..4af941ed 100644--- a/understand-anything-plugin/skills/understand/SKILL.md+++ b/understand-anything-plugin/skills/understand/SKILL.md@@ -418,6 +418,8 @@ Candidate endpoints use the current analysis's node and ownership descriptors beA syntactically valid parse is insufficient to prove deletion when declaration names remain computed or escaped, including methods installed through computed prototype/object assignments. The strict parser marks this uncertainty, and missing symbols remain `unknown` rather than being treated as deleted merely because their literal spelling is absent.+Runtime property-definition APIs (including `Object.defineProperty`, `Reflect`, and locally aliased property installers) and computed callees also make absence unconfirmed. The structural extractor does not evaluate runtime property creation; such evidence blocks automatic deletion confirmation even when the remaining declarations parse successfully.+Go receiver methods, Rust inherent impl methods, and C++ out-of-class definitions retain explicit type ownership and their own source ranges. Their duplicate entries in `classes[].methods` are reconciled without assuming the method body is inside the type declaration. Free functions with the same name stay distinct; unresolved receivers and Rust trait impl identities remain `unknown`. Receiver changes also affect structural fingerprints when the type declaration is in another file.When the report has `unresolvedFiles`, prepare exactly one repair: