Skip to content

[codex] retain nested and bound callable definitions - #2124

Merged
TheGreenCedar merged 4 commits into
dev/codestory-nextfrom
codex/2123-callable-definitions
Sep 4, 2026
Merged

TheGreenCedar merged 4 commits into
dev/codestory-nextfrom
codex/2123-callable-definitions

Conversation

@TheGreenCedar

@TheGreenCedar TheGreenCedar commented Sep 4, 2026 •

Copy link
Copy Markdown
Owner

Result and context

Restore parser-established callable definitions that were absent from the source index. This is an upstream source repair under #2116, not evidence that the packet compiler qualifies.

The independent source-universe audit on #2120 showed that ranking could not recover some required source because the indexed definition did not exist. A neutral 72-combination syntax matrix reproduced 40 missing or misnamed definitions before the change. It does not contain evaluation repository or answer vocabulary.

Closes #2123. Refs #2116.

Changes

  • C/C++ definitions follow the parser's declarator chain, including nested pointers, parentheses, references, explicit specializations and calling-convention wrappers. Parameter and unrelated descendant names cannot become the declaration identity.
  • Native member edges use the same captured definition identity. Prototypes and lambda captures preserve their existing extraction path.
  • JavaScript, TypeScript and TSX retain variable-bound function expressions and generators, using the binding name rather than publishing the private expression name as a global alias.
  • Calls bound by a private function-expression or generator name remain unresolved rather than resolving to an unrelated outer function with that name. This includes nested closures; anonymous and outside-scope controls retain normal resolution. Scope is attached to each graph call occurrence before reference deduplication; private and ordinary calls sharing one physical line cannot borrow each other's marker.
  • Changed language rule digests and a scoped extraction revision invalidate affected parser-cache entries through the existing cache key; unrelated language keys and the global cache version are unchanged.

Review native_declarators.rs and the graph rules first, then the conversion boundary in lib.rs and the neutral contract matrix. Packet retrieval, scoring, compiler policy and exact-proof policy are unchanged.

Snapshot changes

The C++ fixture gains its reference-returning Player::name definition, its membership/source occurrence and the existing resolver's call target. Related callsite ordinals and projection hashes follow from that added node.

The TSX golden had an unrelated stale duplicate callable-state row. The same snapshot failure reproduced on clean base source at a4f9242512e92af0e43d58987f4d27a67bbd6c91, whose indexer tree is identical to integration base fc6973d0bd4390cc1ae7814b3e4ee8236802b861. Existing projection.rs already collapses duplicate symbol keys to SQLite's last-wins shape. Only that obsolete expected row was removed; production projection code was not changed.

Verification

Source head: 897f3ab78a70dcd5e70cdbb4df0cb9d5d676345f.
Tree: afa7b230f59227cb3af5e80bff1f8c0854e21957.
Base: fc6973d0bd4390cc1ae7814b3e4ee8236802b861.
Worktree: /Users/albert/.codex/worktrees/2123-callable-definitions/CodeStory.

Focused locked tests passed on the committed source:

  • callable_definition_fidelity: 8 passed, including the expanded 80-combination matrix, pointer-depth changes, specializations, native membership, prototypes/lambdas and reference/operator/destructor controls.
  • query_rule_regressions: 22 passed, including 96 multiline private-scope variants, 24 anonymous/outside-scope controls, and 96 same-line layout/name/scope variants. The original scope matrix reproduced 48 wrong-target failures; the same-line matrix reproduced 96 failures before the occurrence-bound correction.
  • native_rule_regressions: 32 passed.
  • fidelity_regression: 8 passed.
  • tictactoe_language_coverage: 13 passed.
  • language_extraction_snapshot: 3 passed.
  • Indexer cache tests: 7 passed.
  • Selected JavaScript, TypeScript and native proof-resolution lane: 23 passed.
  • Runtime-import boundary lane: 3 passed, including six same-line order/language variants.
  • Indexer library clippy with warnings denied passed.
  • Formatting, documentation links and diff whitespace checks passed.

The independent initial review found two causal classes: omitted legal native declarators and private expression calls incorrectly selecting outer functions. The first follow-up accepted the native repair but found that delayed scope annotation incorrectly used a shared same-line target-node span. That annotation seam is now removed: each original graph occurrence receives its scope before edge identity/deduplication. Independent correction verification accepted this exact head: all 29 retained scope probes and 55 focused checks passed; native acceptance remains unchanged.

Preserved review receipts:

  • Initial: /Users/albert/.codex/evidence/codestory-2123-verifier.FWCIxV/receipt.json, SHA-256 4bd01c3f0d0d0ad2b7507e3e9baa859c7f3c1dbad159c263f3e7296f0938db64.
  • First correction: /Users/albert/.codex/evidence/codestory-2123-corrections.qf2D2r/receipt.json, SHA-256 eb16c27e76c652219f1156da5b717578be52cc3938eed813aa40249b15192b00.
  • Accepted occurrence-bound correction: /Users/albert/.codex/evidence/codestory-2123-f2-seam.eydctZ/receipt.json, SHA-256 274422e605be06c52080358f1637a1874080f0b09af8bac093b4218ce2b3f9e5.

Applicable CI passed on this head: draft source checks (33840343760), retrieval/transport contracts (33840343673), crate durability (33840343783), rustdoc (33840343815) and the issue-link guard. The Windows missing-manifest cell was intentionally skipped. This is support-PR verification, not release source stabilization or product qualification. No installed-runtime, calibration or release proof has run for this patch. Existing failed packet receipts and the old stop remain preserved. Version remains 0.17.5.

Risk and follow-up

Newly visible definitions change downstream source inventory and may improve existing navigation resolution. Call-proof authority still belongs to its separate closed syntax checks. The adversarial review checks ownership and ambiguity rather than inferring safety from symbol counts.

After integration, remeasure the source inventory and causal losses using fresh artifacts. Documentation extents and preprocessor recovery remain separate observed gaps; this PR does not claim to repair them.

@TheGreenCedar
TheGreenCedar marked this pull request as ready for review September 4, 2026 05:51
@TheGreenCedar
TheGreenCedar merged commit cd062c7 into dev/codestory-next Sep 4, 2026
9 checks passed
@TheGreenCedar
TheGreenCedar deleted the codex/2123-callable-definitions branch September 4, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant