Skip to content

feat(typescript): the four bulk/projected accessors — parity with Python's #180/#181 surface (#298) - #302

Merged
rahlk merged 10 commits into
release/1.4from
feat/issue-298-ts-bulk-accessors
Jul 27, 2026
Merged

feat(typescript): the four bulk/projected accessors — parity with Python's #180/#181 surface (#298)#302
rahlk merged 10 commits into
release/1.4from
feat/issue-298-ts-bulk-accessors

Conversation

@rahlk

Copy link
Copy Markdown
Collaborator

Closes the 1.4-line half of #298 (the release/2.0 forward-port follows separately).

What this adds

The four set-at-a-time projected accessors on the TypeScript surface, mirroring Python's #180/#181 template — on both backends:

  • get_callables_overview() -> List[TSCallableOverview] — new projection model: parity core + TS facets (is_exported, is_async, is_static, accessibility), analyzer-native 7-value kind passthrough, owner_signature/owner_kind pair (closed class|interface set; namespace-owned, nested, and module-level callables are ownerless — the dotted signature carries the namespace path)
  • get_method_bodies(signatures) — mechanical omission rule: entries with code=None (implicit constructors, synthesized callables) and unknown signatures are omitted; every returned value is a real str
  • get_decorated_callables(markers) / get_callsites_for(signatures) — verbatim Python contracts (empty-entry-vs-omitted semantics)
  • Neo4j: one Cypher round trip per accessor over the 1.x vocabulary, query shapes pinned by mutation-tested stub assertions

Verification

  • 90 passed / 23 skipped fast lane; exact-set assertions independently re-derived from the fixture by reviewers
  • Live dual-backend parity (env-gated, real podman Neo4j + --emit neo4j): all four accessors agree, full-field comparisons (113 passed)
  • The blessed slim fixture is now tracked (gitignore exception) — the suite runs from a clean clone

Filed during review

Ships as 1.5.0 (additive API ⇒ minor). Remaining on #298 after merge: the release/2.0 forward-port (needs the upstream cants decorators-projection issue first — the 2.0-era emit dropped decorator projection).

rahlk added 10 commits July 27, 2026 14:21
tests/resources/typescript/analysis_json/slim/analysis.json was caught by the
blanket *.json gitignore rule and never committed, even though the TS bulk
accessor tests assert exact-set constants against it and it was hand-built
from a src/external.ts that was itself never committed -- so a fresh clone
could neither run the suite nor regenerate the fixture. Add a narrow
.gitignore exception and track the file.
…298)
get x()/set x() pairs share one TSCallable.signature, so the in-memory
backend's last-writer-wins _callables map collapses the pair to a single
row while the Neo4j backend (one node per accessor) surfaces two -- and
duplicate decorator names diverge the same way via collect(DISTINCT ...).
Invisible on the current sample-app fixture (unpaired getter only), but the
live parity suite would catch it on any app with a real paired accessor.
Filed as #300; note it on the ABC and facade
get_callables_overview docstrings, and record that decorator order isn't
part of the cross-backend contract.
…st, decorator-order note (#298)
- test_overview_owner_pair_is_none_for_ownerless_callables: fix the
"owned_less" typo and assert the ownerless signature set exactly, not
just membership.
- get_method_bodies / get_callsites_for: replace the O(all callables) walk
via _iter_callables() with direct _callables.get(sig) lookups keyed on
the requested signatures; omission/empty-entry semantics unchanged
(covering tests stay green).
- test_facade_delegates_to_backend: replace the same-fixture double-call
(which only proved the fixture is deterministic) with a MagicMock-backed
facade asserting each bulk accessor calls the identical backend method
with the identical arguments and returns its exact object.
@rahlk
rahlk merged commit 26bdce2 into release/1.4Jul 27, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@rahlk