@weftlet/toolkit 0.6.1 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +191 -18
- package/THIRD_PARTY_NOTICES.md +3 -1
- package/dist/application/application.d.ts +10 -0
- package/dist/application/application.js +20 -0
- package/dist/application/document-code-bindings.d.ts +11 -0
- package/dist/application/document-code-bindings.js +25 -0
- package/dist/application/document-obligations.d.ts +8 -0
- package/dist/application/document-obligations.js +11 -0
- package/dist/application/draft-facts.d.ts +3 -0
- package/dist/application/draft-facts.js +37 -0
- package/dist/application/extraction-identity.d.ts +2 -2
- package/dist/application/extraction-identity.js +7 -1
- package/dist/application/extractor-results.d.ts +6 -0
- package/dist/application/extractor-results.js +6 -0
- package/dist/application/hydrator.js +38 -18
- package/dist/application/mapping-proposals.d.ts +108 -0
- package/dist/application/mapping-proposals.js +142 -0
- package/dist/application/mapping-service.d.ts +2 -0
- package/dist/application/mapping-service.js +5 -0
- package/dist/application/overlay.js +43 -29
- package/dist/application/saved-code-coverage.d.ts +40 -0
- package/dist/application/saved-code-coverage.js +20 -0
- package/dist/application/saved-compatibility.d.ts +38 -0
- package/dist/application/saved-compatibility.js +20 -0
- package/dist/application/saved-evidence.d.ts +17 -11
- package/dist/application/saved-evidence.js +44 -40
- package/dist/application/saved-exploration.d.ts +57 -0
- package/dist/application/saved-exploration.js +21 -0
- package/dist/application/saved-paths.d.ts +58 -0
- package/dist/application/saved-paths.js +20 -0
- package/dist/application/semantic-run.d.ts +1 -1
- package/dist/extraction/call-syntax.d.ts +18 -0
- package/dist/extraction/call-syntax.js +61 -0
- package/dist/extraction/canonical-document-links.d.ts +5 -1
- package/dist/extraction/canonical-document-links.js +4 -4
- package/dist/extraction/code-inventory.d.ts +6 -0
- package/dist/extraction/code-inventory.js +26 -0
- package/dist/extraction/document-code-bindings.d.ts +14 -0
- package/dist/extraction/document-code-bindings.js +121 -0
- package/dist/extraction/document-obligations.d.ts +12 -0
- package/dist/extraction/document-obligations.js +112 -0
- package/dist/extraction/mapping-candidates.d.ts +13 -0
- package/dist/extraction/mapping-candidates.js +46 -0
- package/dist/extraction/mapping-output.d.ts +75 -0
- package/dist/extraction/mapping-output.js +53 -0
- package/dist/extraction/mapping-plan.d.ts +7 -0
- package/dist/extraction/mapping-plan.js +117 -0
- package/dist/extraction/mapping-prompt.d.ts +2 -0
- package/dist/extraction/mapping-prompt.js +17 -0
- package/dist/extraction/mapping-provider.d.ts +15 -0
- package/dist/extraction/mapping-provider.js +60 -0
- package/dist/extraction/mapping-request.d.ts +3 -0
- package/dist/extraction/mapping-request.js +32 -0
- package/dist/extraction/ontology.d.ts +2 -0
- package/dist/extraction/ontology.js +28 -13
- package/dist/extraction/routing.js +5 -20
- package/dist/extraction/scip-occurrences.d.ts +3 -0
- package/dist/extraction/scip-occurrences.js +102 -0
- package/dist/extraction/scip-ranges.d.ts +6 -0
- package/dist/extraction/scip-ranges.js +31 -0
- package/dist/extraction/scip-runtime.d.ts +39 -0
- package/dist/extraction/scip-runtime.js +8 -0
- package/dist/extraction/scip-symbols.d.ts +21 -0
- package/dist/extraction/scip-symbols.js +91 -0
- package/dist/extraction/semantic.d.ts +1 -1
- package/dist/extraction/semantic.js +5 -17
- package/dist/extraction/static-calls.d.ts +10 -0
- package/dist/extraction/static-calls.js +133 -0
- package/dist/extraction/static.d.ts +3 -20
- package/dist/extraction/static.js +8 -84
- package/dist/extraction/symbol-resolution.d.ts +12 -0
- package/dist/extraction/symbol-resolution.js +51 -0
- package/dist/extraction/symbol-selectors.d.ts +11 -0
- package/dist/extraction/symbol-selectors.js +51 -0
- package/dist/graph/binding-rdf.d.ts +7 -0
- package/dist/graph/binding-rdf.js +109 -0
- package/dist/graph/call-rdf.d.ts +4 -0
- package/dist/graph/call-rdf.js +94 -0
- package/dist/graph/call-shapes.d.ts +2 -0
- package/dist/graph/call-shapes.js +28 -0
- package/dist/graph/code-coverage-projection.d.ts +9 -0
- package/dist/graph/code-coverage-projection.js +117 -0
- package/dist/graph/code-coverage-renderer.d.ts +2 -0
- package/dist/graph/code-coverage-renderer.js +15 -0
- package/dist/graph/code-coverage-request.d.ts +6 -0
- package/dist/graph/code-coverage-request.js +19 -0
- package/dist/graph/code-coverage.d.ts +6 -0
- package/dist/graph/code-coverage.js +54 -0
- package/dist/graph/code-description.d.ts +4 -0
- package/dist/graph/code-description.js +24 -0
- package/dist/graph/code-rdf.d.ts +6 -0
- package/dist/graph/code-rdf.js +79 -0
- package/dist/graph/compatibility-context.d.ts +2 -0
- package/dist/graph/compatibility-context.js +18 -0
- package/dist/graph/compatibility-renderer.d.ts +2 -0
- package/dist/graph/compatibility-renderer.js +45 -0
- package/dist/graph/compatibility-request.d.ts +3 -0
- package/dist/graph/compatibility-request.js +18 -0
- package/dist/graph/compatibility.d.ts +7 -0
- package/dist/graph/compatibility.js +67 -0
- package/dist/graph/constraint-comparison.d.ts +7 -0
- package/dist/graph/constraint-comparison.js +49 -0
- package/dist/graph/coverage.d.ts +2 -2
- package/dist/graph/coverage.js +8 -3
- package/dist/graph/diagnostics.d.ts +1 -1
- package/dist/graph/diagnostics.js +10 -6
- package/dist/graph/evidence-description.d.ts +3 -0
- package/dist/graph/evidence-description.js +13 -0
- package/dist/graph/identity-preflight.js +1 -1
- package/dist/graph/neighborhood-renderer.d.ts +2 -0
- package/dist/graph/neighborhood-renderer.js +38 -0
- package/dist/graph/neighborhood-request.d.ts +9 -0
- package/dist/graph/neighborhood-request.js +37 -0
- package/dist/graph/neighborhood.d.ts +8 -0
- package/dist/graph/neighborhood.js +100 -0
- package/dist/graph/obligation-rdf.d.ts +5 -0
- package/dist/graph/obligation-rdf.js +67 -0
- package/dist/graph/obligation-shapes.d.ts +2 -0
- package/dist/graph/obligation-shapes.js +32 -0
- package/dist/graph/partitioned-shacl.d.ts +14 -0
- package/dist/graph/partitioned-shacl.js +66 -0
- package/dist/graph/path-request.d.ts +11 -0
- package/dist/graph/path-request.js +24 -0
- package/dist/graph/path-search.d.ts +45 -0
- package/dist/graph/path-search.js +101 -0
- package/dist/graph/paths-renderer.d.ts +2 -0
- package/dist/graph/paths-renderer.js +36 -0
- package/dist/graph/paths.d.ts +7 -0
- package/dist/graph/paths.js +74 -0
- package/dist/graph/query.js +23 -6
- package/dist/graph/rdf-partitions.d.ts +24 -0
- package/dist/graph/rdf-partitions.js +170 -0
- package/dist/graph/rdf-projection.d.ts +7 -0
- package/dist/graph/rdf-projection.js +27 -0
- package/dist/graph/rdf-records.d.ts +12 -0
- package/dist/graph/rdf-records.js +90 -0
- package/dist/graph/rdf.d.ts +10 -10
- package/dist/graph/rdf.js +84 -89
- package/dist/graph/shacl-shapes.js +70 -0
- package/dist/graph/snapshot-context.d.ts +3 -0
- package/dist/graph/snapshot-context.js +8 -0
- package/dist/graph/validation-progress.d.ts +4 -1
- package/dist/index.d.ts +23 -0
- package/dist/index.js +22 -0
- package/dist/infrastructure/json-digest.d.ts +3 -0
- package/dist/infrastructure/json-digest.js +3 -0
- package/dist/infrastructure/unique-json.d.ts +2 -0
- package/dist/infrastructure/unique-json.js +20 -0
- package/dist/interfaces/cli.js +33 -1
- package/dist/interfaces/code-coverage.d.ts +46 -0
- package/dist/interfaces/code-coverage.js +18 -0
- package/dist/interfaces/graph-compatibility.d.ts +35 -0
- package/dist/interfaces/graph-compatibility.js +21 -0
- package/dist/interfaces/graph-exploration.d.ts +59 -0
- package/dist/interfaces/graph-exploration.js +27 -0
- package/dist/interfaces/graph-paths.d.ts +77 -0
- package/dist/interfaces/graph-paths.js +31 -0
- package/dist/interfaces/graph-query-args.d.ts +2 -0
- package/dist/interfaces/graph-query-args.js +25 -0
- package/dist/interfaces/mapping-proposals.d.ts +204 -0
- package/dist/interfaces/mapping-proposals.js +74 -0
- package/dist/interfaces/mcp.js +31 -3
- package/dist/storage/mapping-proposals.d.ts +9 -0
- package/dist/storage/mapping-proposals.js +42 -0
- package/dist/storage/storage.d.ts +3 -0
- package/dist/storage/storage.js +37 -13
- package/dist/storage/streaming-json.d.ts +5 -0
- package/dist/storage/streaming-json.js +45 -0
- package/dist/visualization/evidence-sources.d.ts +6 -0
- package/dist/visualization/evidence-sources.js +19 -0
- package/dist/visualization/viewer-interaction.d.ts +5 -8
- package/dist/visualization/viewer-interaction.js +46 -44
- package/dist/visualization/visualization.js +14 -5
- package/docs/1.0-WORK-QUEUE.md +48 -0
- package/docs/ADR-029-exact-graph-neighborhoods.md +70 -0
- package/docs/ADR-030-bounded-evidence-paths.md +97 -0
- package/docs/ADR-031-code-extractor-selection.md +91 -0
- package/docs/ADR-032-scip-code-evidence.md +73 -0
- package/docs/ADR-033-document-symbol-bindings.md +83 -0
- package/docs/ADR-034-mapping-gaps.md +80 -0
- package/docs/ADR-035-static-call-evidence.md +78 -0
- package/docs/ADR-036-contract-obligation-declarations.md +124 -0
- package/docs/ADR-037-selected-contract-compatibility.md +93 -0
- package/docs/ADR-038-monorepo-code-coverage.md +105 -0
- package/docs/ADR-039-mapping-proposals.md +119 -0
- package/docs/ADR-040-bounded-graph-io.md +90 -0
- package/docs/GRAPHIFY-EVALUATION.md +21 -4
- package/docs/PRE-1.0-BASELINE.md +49 -2
- package/docs/RELEASE-1.0-PLAN.md +14 -2
- package/docs/RELEASING.md +3 -3
- package/docs/ROADMAP.md +27 -6
- package/docs/VALIDATION.md +521 -14
- package/docs/benchmarks/large-graph-2026-11-02/result.json +156 -0
- package/docs/extraction-manifest.json +266 -23
- package/package.json +10 -4
- package/templates/context-graph-development/SKILL.md +30 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# ADR 029: exact graph neighborhoods
|
|
2
|
+
|
|
3
|
+
Status: B1a implemented and locally checked; hosted/merge evidence is recorded in the change PR.
|
|
4
|
+
Not yet published in a candidate. B1b path exploration remains open.
|
|
5
|
+
|
|
6
|
+
`impact.scan` discovers relevant evidence with text/file selectors and bounded traversal. Agents
|
|
7
|
+
also need a precise follow-up from a returned node ID. Reusing a node ID as a search term can
|
|
8
|
+
match another node's label or citation and widen the result unexpectedly.
|
|
9
|
+
|
|
10
|
+
## Contract
|
|
11
|
+
|
|
12
|
+
Add `GraphExplorationService.neighbors`, `weftlet graph neighbors` and the read-only MCP tool
|
|
13
|
+
`graph.neighbors`. Require an explicit saved `snapshotId` and exact, case-sensitive `nodeId`.
|
|
14
|
+
Never resolve a new default/owner head during follow-up. Missing snapshots fail; missing node
|
|
15
|
+
IDs return `absent-from-snapshot`, meaning only that no assertion in this saved scope mentions
|
|
16
|
+
the ID. This does not prove the code/entity is absent from the repository or deleted.
|
|
17
|
+
|
|
18
|
+
Direction is incoming, outgoing or both (default). Empty predicate selection means all relations;
|
|
19
|
+
nonempty selection is an OR filter using the core predicate vocabulary. Unknown fields/relations,
|
|
20
|
+
invalid bounds and unsupported CLI arguments fail. A page defaults to 60 assertions, with a
|
|
21
|
+
maximum of 200. Snapshot IDs are bounded to 256 characters, node IDs to 8192 and continuations
|
|
22
|
+
to 2048. Exact IDs are operation inputs, not labels, shell commands or SPARQL fragments.
|
|
23
|
+
|
|
24
|
+
Read the same lossless RDF/SPARQL projection used by impact queries. Do not refresh, validate
|
|
25
|
+
the full graph again, call a provider or change any snapshot/artifact. Preserve each GraphFact
|
|
26
|
+
byte-for-value, including source and assertion authority, review state, confidence, citations,
|
|
27
|
+
document ownership and node attributes. Multiple citations of an edge remain separate facts;
|
|
28
|
+
labels and attributes from different assertions are not silently merged into an authoritative node.
|
|
29
|
+
Duplicate fact identities fail rather than being dropped during pagination.
|
|
30
|
+
|
|
31
|
+
## Bounds and continuation
|
|
32
|
+
|
|
33
|
+
Order by fact ID with locale-independent string comparison. A continuation binds the operation
|
|
34
|
+
version, normalized selectors/page size, snapshot manifest and actual projected facts. Reject
|
|
35
|
+
changed snapshots, filters, corrupted cursors, invalid offsets and stale versions. The token is
|
|
36
|
+
an integrity binding for query consistency, not an authentication or authorization credential.
|
|
37
|
+
|
|
38
|
+
Report total incident assertions, selected assertions, filtered assertions, page offset and
|
|
39
|
+
remaining assertions. Preserve complete assertions even when several share the same endpoints.
|
|
40
|
+
Self-links appear once and do not create a new neighbor. `truncated` describes pending pages of
|
|
41
|
+
the selected one-hop neighborhood; it never means the transitive product graph is exhausted.
|
|
42
|
+
|
|
43
|
+
Return a bounded frontier for neighbors on the current page, their supporting returned fact IDs,
|
|
44
|
+
and a count of their other incident assertions that do not touch the focus. Those counts ignore
|
|
45
|
+
the request's filters to make further branches visible. Also report how many distinct selected
|
|
46
|
+
neighbors have not appeared across this and earlier pages; continuation reaches their evidence.
|
|
47
|
+
The frontier does not recursively expand those nodes. Call the same operation with a returned
|
|
48
|
+
neighbor ID and the same snapshot to inspect another area. B1b owns multi-hop paths and budgets.
|
|
49
|
+
|
|
50
|
+
Responses reuse impact coverage semantics and the exact same checkout/overlay freshness helper.
|
|
51
|
+
Diagnostics match exact focus/returned-neighbor IDs or overlapping returned citations, with the
|
|
52
|
+
same per-kind bounds and explicit omitted/legacy counts as impact reports. A missing node can
|
|
53
|
+
still have a relevant extraction-gap diagnostic; unknown legacy text is counted, not dumped.
|
|
54
|
+
Historical evidence remains readable, excluded working changes remain explicit, and saved
|
|
55
|
+
evidence cannot satisfy a current-diff validation gate. Page coverage is not a repository coverage
|
|
56
|
+
percentage or proof of behavior. Extraction gaps and partial document scope remain visible.
|
|
57
|
+
|
|
58
|
+
## Compatibility and validation
|
|
59
|
+
|
|
60
|
+
This is an additive query API. Extraction, storage, semantic cache identity and existing
|
|
61
|
+
`impact.scan` behavior stay unchanged. The core predicate list becomes the shared runtime/type
|
|
62
|
+
vocabulary, frozen at runtime; semantic schema ordering and contents stay identical. No new
|
|
63
|
+
backend or language support is introduced. Existing snapshots can be explored without rebuilding.
|
|
64
|
+
|
|
65
|
+
Use focused graph tests for branching/cycles, exact IDs vs duplicate labels, direction/relations,
|
|
66
|
+
parallel provenance, self-links, page/frontier completeness and cursor rejection. Use actual
|
|
67
|
+
extraction/SCIP/RDF from the public monorepo fixture for cross-service follow-up and real CLI/MCP
|
|
68
|
+
transport. Verify dirty checkout/overlay state and provider-unavailable saved reads. Packed-consumer
|
|
69
|
+
tests must discover and call the new tool. B1a does not establish autonomous-agent usefulness,
|
|
70
|
+
private consumer acceptance, automatic rule-to-function binding or complete path exploration.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# ADR 030: bounded cited dependency paths
|
|
2
|
+
|
|
3
|
+
Status: B1b implemented for the next candidate. Hosted validation and merge identity are recorded
|
|
4
|
+
in the change PR; this entry does not announce npm publication or private consumer acceptance.
|
|
5
|
+
|
|
6
|
+
## Meaning and scope
|
|
7
|
+
|
|
8
|
+
`GraphPathQueryService.paths`, `weftlet graph paths` and MCP `graph.paths` take an explicit saved
|
|
9
|
+
snapshot ID and exact `fromNodeId`/`toNodeId`. They enumerate simple paths of cited assertions:
|
|
10
|
+
no node repeats, a target ends a path, parallel assertions produce distinct alternatives, and
|
|
11
|
+
self-links do not create cycles. Equal endpoints that occur in the saved graph yield one
|
|
12
|
+
zero-length identity path with no supporting assertion, even if a relation filter excludes all
|
|
13
|
+
their edges. An absent endpoint never establishes a path or absence from the actual product.
|
|
14
|
+
|
|
15
|
+
Outgoing (default), incoming and both directions refer to assertion subject/object order.
|
|
16
|
+
Following incoming or undirected evidence does not reverse or rewrite the original assertion.
|
|
17
|
+
An empty predicate list selects all relations; a nonempty list is an OR filter. Paths establish
|
|
18
|
+
cited associations, not causality, compatible business obligations or behavior verification.
|
|
19
|
+
They preserve authority, review state, source citations and node variants on every returned fact.
|
|
20
|
+
|
|
21
|
+
Read the same lossless RDF/SPARQL projection as other queries. Preserve its existing explicit
|
|
22
|
+
100,000-fact projection ceiling; exceeding it fails rather than truncating silently. No model,
|
|
23
|
+
indexer, SHACL rerun or graph write is involved. Duplicate fact IDs and mismatched stored snapshot
|
|
24
|
+
IDs fail. Responses reuse coverage, scoped diagnostic and checkout/overlay-state helpers.
|
|
25
|
+
Coverage describes the page's supporting evidence, not a repository completion percentage;
|
|
26
|
+
historical/draft evidence cannot validate the current diff. Document selection omissions remain
|
|
27
|
+
in snapshot metadata. An exhausted search says nothing about excluded or unextracted dependencies.
|
|
28
|
+
|
|
29
|
+
## Enumeration, work and continuation
|
|
30
|
+
|
|
31
|
+
Use deterministic depth-first traversal with adjacency sorted by assertion ID, independent of
|
|
32
|
+
locale. This is not a shortest-path or importance ranking: alternatives reached later can be
|
|
33
|
+
shorter or more relevant. Do not interpret the first path as the preferred design.
|
|
34
|
+
|
|
35
|
+
Defaults are depth 8 (maximum 32), five paths per page (maximum 20) and 1,000 new candidate-edge
|
|
36
|
+
examinations per page (maximum 10,000). Every considered edge counts, including cycles and depth
|
|
37
|
+
cuts. A search has a hard total ceiling of 100,000 examinations across continuations. Graph
|
|
38
|
+
loading, RDF projection and adjacency preparation are separate work, not included in that
|
|
39
|
+
candidate count. Adjacency sorts are O(E log E); the existing RDF projection also orders facts.
|
|
40
|
+
There is no wall-clock latency guarantee.
|
|
41
|
+
|
|
42
|
+
Continuations bind the operation version, normalized selectors and page budgets, saved manifest,
|
|
43
|
+
actual facts and diagnostics. A cursor carries only a step offset, never an external stack or
|
|
44
|
+
assertions. Bounded replay reconstructs state and verifies the offset is a valid page boundary.
|
|
45
|
+
Responses report replayed and new steps separately. Replay is at most the total ceiling; a DFS
|
|
46
|
+
stack is at most depth + 1. This trades bounded repeated CPU work for stateless continuation
|
|
47
|
+
without snapshot/cache writes or a large serialized queue. Tokens provide query consistency,
|
|
48
|
+
not authentication. Changing selectors, depth, budgets or saved evidence requires restarting.
|
|
49
|
+
Cumulative cost over many tiny pages can exceed one search's ceiling because replay is repeated;
|
|
50
|
+
clients should normally retain the default work budget.
|
|
51
|
+
|
|
52
|
+
The page includes only its completed paths and the union of their unchanged supporting facts.
|
|
53
|
+
Work-limited pages may be empty and still have a continuation. Returned path count is not a
|
|
54
|
+
count of all possible paths. A continuation can lead to a final empty page after dead ends/cycles.
|
|
55
|
+
|
|
56
|
+
Report every active DFS prefix with its fact-ID prefix, next candidate fact ID and remaining
|
|
57
|
+
adjacency-candidate count. These are not counts of valid paths. Depth cuts retain a total count,
|
|
58
|
+
up to 20 concrete extension examples and an explicit omitted-example count. Frontier IDs refer
|
|
59
|
+
to saved assertions; use `graph.neighbors` at that node/snapshot to retrieve their full citations.
|
|
60
|
+
|
|
61
|
+
`truncated` is true if pending work or any depth cut remains. A page/path limit supplies a
|
|
62
|
+
continuation. Exhausting the search within the requested depth can still have `truncated: true`
|
|
63
|
+
and no continuation: increase depth and restart, or explore a frontier node separately. Reaching
|
|
64
|
+
the total work ceiling likewise retains frontier and says `search-limit`, without continuation;
|
|
65
|
+
narrow relations or choose an intermediate node. None of these states silently reports no impact.
|
|
66
|
+
|
|
67
|
+
## Viewer parity and compatibility
|
|
68
|
+
|
|
69
|
+
The offline HTML viewer embeds the same dependency-free search function used by the service.
|
|
70
|
+
It searches only the displayed Context Pack and selected authority/relation layers; it cannot
|
|
71
|
+
fetch the full snapshot or turn a filtered page into complete repository evidence. Its first/next
|
|
72
|
+
path controls use one result per page, 1,000 new examinations, selectable direction/relation/depth
|
|
73
|
+
and the same total ceiling. Changing selection resets continuation. Targets show exact IDs next
|
|
74
|
+
to labels. Each highlighted edge is an unchanged fact from that displayed pack.
|
|
75
|
+
|
|
76
|
+
The prior viewer-only shortest-path implementation is replaced by shared deterministic
|
|
77
|
+
enumeration; labels now say "cited path" rather than promising a shortest route. `impact.scan`
|
|
78
|
+
and `graph.neighbors` remain unchanged. No extraction identity, semantic artifact/cache key,
|
|
79
|
+
snapshot format, dependency, rule policy or language support changes.
|
|
80
|
+
|
|
81
|
+
## Validation boundary
|
|
82
|
+
|
|
83
|
+
Compare against an independent oracle on every directed four-node graph; test parallel
|
|
84
|
+
assertions, cycles, self-links, competing branches, deep paths, relation/direction filters,
|
|
85
|
+
empty work pages, truncated depth, bounded frontier examples and the cumulative ceiling.
|
|
86
|
+
Reject malformed/stale/non-boundary continuations. Compare supporting facts with RDF queries
|
|
87
|
+
and preserve snapshots with deleted or excluded endpoints.
|
|
88
|
+
|
|
89
|
+
Exercise actual public prose extraction, SCIP and RDF/SHACL across services through CLI/MCP,
|
|
90
|
+
including unavailable providers/indexers, dirty checkouts and captured/stale overlays. Verify
|
|
91
|
+
fresh installed CLI/MCP assets and continuation. Execute rendered viewer controls in a small
|
|
92
|
+
DOM test harness and compare every highlighted path with the RDF service; this is script and
|
|
93
|
+
projection parity, not interactive browser rendering or autonomous-agent usefulness evidence.
|
|
94
|
+
|
|
95
|
+
B1a/B1b mechanisms are implemented; qualification and live product usefulness remain B6. B2's
|
|
96
|
+
Graphify/SCIP comparison is next. No backend replacement or business compatibility inference
|
|
97
|
+
is implied by paths through the existing evidence graph.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# ADR 031: retain SCIP and expose its code occurrences
|
|
2
|
+
|
|
3
|
+
Status: B2b decision recorded on 2026-10-29. Implementation belongs to B3a; no production
|
|
4
|
+
extractor, public schema, dependency or published package changes in this experiment.
|
|
5
|
+
|
|
6
|
+
## Decision
|
|
7
|
+
|
|
8
|
+
Keep SCIP TypeScript as the default. Build a versioned, richer projection of its declarations
|
|
9
|
+
and reference occurrences for explicit rule-to-symbol resolution. Do not replace it with
|
|
10
|
+
Graphify or require both indexers. Preserve an adapter seam for a future producer with a
|
|
11
|
+
measured capability that justifies its installation and maintenance cost.
|
|
12
|
+
|
|
13
|
+
The current Weftlet projection discards useful information already present in the index.
|
|
14
|
+
Improving it addresses the immediate need for cited function identities and document bindings
|
|
15
|
+
without introducing another runtime. SCIP references do not prove calls, execution, data flow
|
|
16
|
+
or business intent. Native calls remain unsupported by this projection; a separate measured
|
|
17
|
+
producer could address that gap later.
|
|
18
|
+
|
|
19
|
+
## Evidence and interpretation
|
|
20
|
+
|
|
21
|
+
Inputs were frozen at `f1844f31717341f5ff95314a68def80eae509734`; the unchanged baseline engine
|
|
22
|
+
is `f3b0f99cc7f01227925bf7372f3ab7a60f0de62c`. See the [complete measurement record](../evaluations/code-graph-results/2026-10-29/README.md),
|
|
23
|
+
including pinned versions, commands, exported native artifacts, exact citations, per-case results,
|
|
24
|
+
costs, retained failed attempts and scoring amendments. No paid/model calls or private inputs.
|
|
25
|
+
|
|
26
|
+
Cold results combine two public corpora, without counting repeats as more independent cases:
|
|
27
|
+
|
|
28
|
+
| Evidence requested | Current Weftlet projection | Richer raw SCIP | Pinned Graphify static API |
|
|
29
|
+
| --- | --- | --- | --- |
|
|
30
|
+
| Declaration families, 15 positive cases | Exact track unsupported; 7 coarse candidates | 15/15 | 14/15 |
|
|
31
|
+
| References, 16 positive cases | Exact track unsupported; 12 coarse candidates | 16/16 | 8/16, including one ambiguous re-export counted as missing |
|
|
32
|
+
| Native calls, 10 positive cases | Unsupported | Unsupported | 7/10; retains native inferred/extracted tags |
|
|
33
|
+
| Ten named false-join negatives | Unsupported in exact track | None asserted | None asserted |
|
|
34
|
+
| Citation/identity failures in these scored outputs | 0 | 0 | 0 |
|
|
35
|
+
|
|
36
|
+
These are labeled-case results, not whole-graph precision estimates. Hundreds of other references
|
|
37
|
+
are unjudged. Graphify's line-only evidence receives source credit only where the labeled token
|
|
38
|
+
has an unambiguous native target; it does not acquire column precision. Its overload implementation
|
|
39
|
+
counts as a family, while two missing signature spans remain missing. The ambient vendor declaration
|
|
40
|
+
is absent. Other misses include type-use occurrences, test top-level calls and an execution call;
|
|
41
|
+
raw artifacts retain coarser import edges even when exact-use credit is unavailable.
|
|
42
|
+
|
|
43
|
+
Graphify is faster and lighter on these tiny TypeScript fixtures. For the 21-file business corpus,
|
|
44
|
+
two-sample median extraction phases were 0.808 s for SCIP indexing and 0.035 s for Graphify static
|
|
45
|
+
extraction. Whole worker times were 2.056 s and 1.087 s respectively, including startup; the SCIP
|
|
46
|
+
worker also assembles the unchanged baseline graph. Sampled aggregate process RSS was about
|
|
47
|
+
335 MiB versus 75 MiB, with shared pages potentially counted more than once. Cgroup peaks are
|
|
48
|
+
recorded separately. Small unequal sample counts, warm host caches and different phase boundaries
|
|
49
|
+
do not establish production speed ratios or large-monorepo behavior.
|
|
50
|
+
|
|
51
|
+
All 96 corrected experimental graph assemblies pass strict SHACL and exact RDF/SPARQL fact
|
|
52
|
+
projection parity. Every arm retrieves the documented collection → execution → notifications →
|
|
53
|
+
mobile chain, relevant test and both freshness rules, and loses the chain when its handoff sentence
|
|
54
|
+
is removed. Billing remains unrelated. Shared Status connects API and mobile in every arm.
|
|
55
|
+
Fixed-document/routing dispatch retrieves 16/16 expected files with zero of seven named distractions;
|
|
56
|
+
code-only retrieves 13/16. Some dispatch queries retain explicit continuation after the three-page
|
|
57
|
+
budget: these are successful labeled retrievals, not exhaustive graph searches.
|
|
58
|
+
|
|
59
|
+
The fixed business layer is identical across arms. Its documents are declared fixture intent;
|
|
60
|
+
grammar-derived assertions remain inferred/unreviewed. None of these results proves model
|
|
61
|
+
extraction quality, rule compatibility, delivery over a queue, or a function implementing a rule.
|
|
62
|
+
Both tools leave dynamic-target and undeclared-queue gaps silent. Only the richer SCIP adapter
|
|
63
|
+
explicitly reports the external implementation as declaration-only. B3–B5 must address binding,
|
|
64
|
+
obligations and coverage rather than treating absent edges as zero impact.
|
|
65
|
+
|
|
66
|
+
Repeat and dirty committed-source runs preserve normalized content and identities. Graphify's raw
|
|
67
|
+
dirty output differs only in its absolute `extracted_sources` inventory; nodes/edges are unchanged.
|
|
68
|
+
Edits preserve unrelated identities, rename/delete remove old current spans, omitted worker inputs
|
|
69
|
+
are explicitly excluded, and old snapshots remain unchanged. This tests full re-extraction with
|
|
70
|
+
cached document artifacts, not incremental code indexing. Graphify's pinned JS/TS path does not
|
|
71
|
+
prove useful incremental parse reuse merely because it accepts a cache directory.
|
|
72
|
+
|
|
73
|
+
## Limits and next implementation boundary
|
|
74
|
+
|
|
75
|
+
The comparison used Linux, Python 3.12.14, Node 24.19.0, SCIP TypeScript 0.4.0, and pinned Graphify
|
|
76
|
+
source `0a8cd4e1e342235fe53e881fb5d591bf0460071f`. Its source API imports with 30 locked runtime
|
|
77
|
+
distributions; the manifest/lock project-version mismatch is explicitly handled without installing
|
|
78
|
+
a project distribution. This is not a Graphify package, Windows/macOS, multi-language or managed
|
|
79
|
+
service validation. No upstream code or dependency enters the npm packages.
|
|
80
|
+
|
|
81
|
+
B3a will add first-class code entities and cited occurrences with stable identities, containing
|
|
82
|
+
file/project, declaration spans, references and explicit unresolved/declaration-only states. It
|
|
83
|
+
must retain canonical physical-file kinds, distinguish overload families from spans, and avoid
|
|
84
|
+
joining duplicate names. Explicit document bindings must preserve both source revisions/spans,
|
|
85
|
+
source approval and assertion-review authority. Rename/delete, dirty overlays, cache/version
|
|
86
|
+
identity, historical snapshots, RDF/query parity and fresh installation need regressions before
|
|
87
|
+
publication. Do not copy this experiment's legacy file-to-symbol projection into the public schema
|
|
88
|
+
and call that function-level binding. B3b separately assesses remaining inferred-mapping needs.
|
|
89
|
+
|
|
90
|
+
The next candidate remains unreleased until the agreed B1–B5 increments and B6 qualification.
|
|
91
|
+
This decision does not mark official 1.0 or private consumer acceptance complete.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# ADR 032: Preserve native SCIP symbols and occurrences
|
|
2
|
+
|
|
3
|
+
Status: accepted for B3a's first increment. Explicit document-to-symbol bindings and static
|
|
4
|
+
call analysis remain separate work. This implements the projection decision in ADR 031;
|
|
5
|
+
Graphify does not become a runtime dependency.
|
|
6
|
+
|
|
7
|
+
## Evidence model
|
|
8
|
+
|
|
9
|
+
`@weftlet/core` exposes `CodeSymbol`, its descriptor, `CodeOccurrence`, `CodeRange` and the
|
|
10
|
+
`codeSymbolNode` factory. The neutral package adds no dependencies. Global symbol IDs hash
|
|
11
|
+
provider, repository identity and the native SCIP symbol. Native `local N` IDs additionally
|
|
12
|
+
include the document path and normalized SCIP index digest: native local ordinals cannot be
|
|
13
|
+
trusted across index revisions. Labels and resolution status are evidence, not ID inputs.
|
|
14
|
+
Renames, package-version changes and tool-native symbol changes can change global IDs; this
|
|
15
|
+
is not automatic identity continuity across refactors.
|
|
16
|
+
|
|
17
|
+
The toolkit retains every distinct native definition/reference occurrence. Definitions connect
|
|
18
|
+
`CodeSymbol —definedBy→ physical file`. References connect the narrowest unambiguous native
|
|
19
|
+
declaration range's symbol to the target; without such a range, the subject is the cited file
|
|
20
|
+
and enclosure is `file` or `ambiguous`. Multiple spans, overload signatures, recursive references,
|
|
21
|
+
private/local symbols and repeated same-line uses remain separate assertions. Exact duplicate
|
|
22
|
+
native entries deduplicate. Existing file-to-Contract relationships remain for compatibility.
|
|
23
|
+
This is additive evidence, not a claim that the two node types are interchangeable.
|
|
24
|
+
|
|
25
|
+
Citations carry one-based UTF-16 start/end columns with an exclusive end, committed source digest
|
|
26
|
+
and SHA. A leading UTF-8 BOM stripped by TypeScript is mapped back into committed first-line
|
|
27
|
+
columns. Source files are read as UTF-8; UTF-16 here describes column units, not file encoding.
|
|
28
|
+
Native declaration/body ranges are retained separately; arrow initializer extents may
|
|
29
|
+
exclude the variable name. A zero-width module anchor can precede
|
|
30
|
+
its declaration extent; `locationKind: zero-width-anchor` distinguishes it from an actual name.
|
|
31
|
+
Invalid source ranges fail extraction. Test files retain canonical Evidence identity; static
|
|
32
|
+
inspection is `implemented`/`deterministic`, not proof of a passed test. Overlays are `draft`.
|
|
33
|
+
|
|
34
|
+
Resolution is `indexed-definition`, `declaration-only` or `no-indexed-definition`. The latter
|
|
35
|
+
includes external or unselected implementations; it does not assert that the target is missing
|
|
36
|
+
from the product. Enclosure is lexical, not execution: SCIP 0.4.0 supplies no declaration extent
|
|
37
|
+
for some local arrow variables, so a nested reference may be attributed to the enclosing outer
|
|
38
|
+
range. Neither a function kind nor a call is inferred from hover text or symbol spelling.
|
|
39
|
+
|
|
40
|
+
## Shared queries, validation and limits
|
|
41
|
+
|
|
42
|
+
The complete typed JSON facts and queryable RDF properties use the same snapshot. SHACL checks
|
|
43
|
+
code metadata, scopes, resolution, predicate/role/enclosure structure and column completeness;
|
|
44
|
+
deterministic consistency checks verify role flags, canonical cited files, range ordering and
|
|
45
|
+
zero-width anchor consistency. Existing kind cardinality and intent authority constraints remain intact.
|
|
46
|
+
The optimized union and original named-dataset paths agree on new shape failures.
|
|
47
|
+
|
|
48
|
+
`graph.neighbors` and `graph.paths` expose exact symbols, spans and bounded continuation through
|
|
49
|
+
the existing API/CLI/MCP. The viewer and Markdown show columns and static-evidence labels.
|
|
50
|
+
Automatic `impact.scan` leaves unresolved code targets terminal, so shared built-ins do not
|
|
51
|
+
create a false impact path between co-users. It reports `codeTraversalVersion: indexed-symbols-v1`
|
|
52
|
+
and `unexpandedCodeTargetCount`, with at most 100 `unexpandedCodeTargets` example IDs and an
|
|
53
|
+
explicit truncation flag; exact neighborhood/path exploration remains available. Continuation
|
|
54
|
+
identity includes this traversal policy. Shared unresolved import behavior is otherwise unchanged.
|
|
55
|
+
|
|
56
|
+
Occurrence retention increases graph size and can require more query pages. The existing
|
|
57
|
+
100,000-fact projection ceiling still fails explicitly rather than truncating; this is not
|
|
58
|
+
qualification for arbitrary monorepos. Indexing remains full, not incremental SCIP or incremental
|
|
59
|
+
SHACL. B5/B6 must assess project coverage, volume and useful bounded retrieval on the candidate.
|
|
60
|
+
|
|
61
|
+
## Compatibility and validation
|
|
62
|
+
|
|
63
|
+
`scip-symbol-extractor` advances from 1.1.0 to 2.0.0 and graph assembly from 7 to 8. Existing saved
|
|
64
|
+
snapshots remain readable, but freshness checks require refresh for current validation. Semantic
|
|
65
|
+
extractor/cache identity is unchanged. Protocol loading, symbol projection and range handling are
|
|
66
|
+
separate modules behind the retained `static.ts` exports; runtime assets are checked in packed installs.
|
|
67
|
+
|
|
68
|
+
Tests use actual committed public source, real SCIP, hydration, strict RDF/SHACL, SPARQL projection,
|
|
69
|
+
agent-facade pagination and paths, unchanged repeat, dirty saved querying and draft rename/delete.
|
|
70
|
+
The 3,000-line fixture uses explicit comment padding around meaningful functions; it is a location
|
|
71
|
+
and isolation regression, not a production-size performance claim. Unit negatives cover malformed
|
|
72
|
+
ranges, ambiguous scopes, missing targets, native local identity and invalid metadata. The prior
|
|
73
|
+
frozen comparison and scores are unchanged. See VALIDATION.md for executed gates.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# ADR 033: Resolve explicit document declarations to indexed code symbols
|
|
2
|
+
|
|
3
|
+
Status: accepted for B3a's second increment; npm candidate pending. This builds on ADR 032,
|
|
4
|
+
without a new indexer, model inference, prompt change or semantic cache invalidation.
|
|
5
|
+
|
|
6
|
+
## Explicit selection and mapping
|
|
7
|
+
|
|
8
|
+
An ordinary CommonMark link opts in with `#weftlet-symbol=<exact-name>`. The destination names
|
|
9
|
+
one regular committed repository file. Match an exact name, public symbol ID or qualified name
|
|
10
|
+
built solely from indexed lexical parents. There is no basename search, fuzzy match or inferred
|
|
11
|
+
call. Duplicate identities are a gap, not a first-match selection. Missing native enclosure can
|
|
12
|
+
prevent qualification; an exact indexed occurrence remains available.
|
|
13
|
+
|
|
14
|
+
Optional `weftlet-line` and `weftlet-column` select a particular definition/reference, using
|
|
15
|
+
one-based UTF-16 start positions. Both are required. The source token must equal the selector
|
|
16
|
+
(or the exact symbol ID must match). This resolves aliases and re-exports through native evidence,
|
|
17
|
+
then cites every indexed definition for that identity, including overloads. Without any indexed
|
|
18
|
+
definition, the target is unresolved. `.d.ts` targets remain explicitly declaration-only.
|
|
19
|
+
|
|
20
|
+
A link without a mapping title creates Document→references→CodeSymbol. A title of
|
|
21
|
+
`weftlet:implementedBy <business-id>` or `weftlet:verifiedBy <business-id>` instead declares that
|
|
22
|
+
relationship from an existing Capability, Workflow, Contract or Invariant. The ID must already
|
|
23
|
+
be present in non-binding facts in this assembly. Nearby prose and link labels do not declare
|
|
24
|
+
mappings implicitly. Reference-style Markdown retains both use and destination citations;
|
|
25
|
+
conflicting destinations or mapping titles produce diagnostics. Images, code blocks, ordinary
|
|
26
|
+
heading fragments and traversal's existing treatment of titles retain their behavior.
|
|
27
|
+
|
|
28
|
+
## Authority and evidence
|
|
29
|
+
|
|
30
|
+
The dependency-free public `DocumentCodeBinding` metadata retains the explicit selector, document
|
|
31
|
+
citations, selected occurrence proofs, all target definition proofs and original business-subject
|
|
32
|
+
proofs. Each proof names an actual fact and exact provenance. Source digest/SHA checks require
|
|
33
|
+
committed regular files and the same indexed revision; stale/missing definitions never resolve.
|
|
34
|
+
|
|
35
|
+
Bindings have `inferred` authority: a declaration of mapping is not proof of fulfillment. Source
|
|
36
|
+
approval/classification is retained independently. A binding involving unreviewed subject evidence
|
|
37
|
+
remains unreviewed; otherwise resolution is deterministic, never an approval workflow. Validation
|
|
38
|
+
sources can declare `verifiedBy` or reference code, but cannot declare `implementedBy`. No test
|
|
39
|
+
execution is inferred. Contradictory declarations remain evidence; this increment does not resolve
|
|
40
|
+
product-policy conflicts or assess semantic truth. Inferred mapping proposals are B3b.
|
|
41
|
+
|
|
42
|
+
RDF has queryable binding selectors and citation/proof relationships plus lossless JSON records.
|
|
43
|
+
SHACL checks metadata cardinalities/types, supported relationships, target kinds and authority.
|
|
44
|
+
Deterministic consistency checks compare proof IDs/provenance/review to actual same-snapshot
|
|
45
|
+
assertions, selector positions and revision consistency. No kind constraint is weakened.
|
|
46
|
+
Neighborhoods, paths, impact scans, Markdown and the viewer consume the same facts; the viewer
|
|
47
|
+
exposes navigation to document, selected occurrence, target definition and subject-proof sources.
|
|
48
|
+
|
|
49
|
+
## Scope, bounds and lifecycle
|
|
50
|
+
|
|
51
|
+
Only sources already selected for hydration are examined. Read traversal-selected validation
|
|
52
|
+
sources are also checked for explicit links without including them in semantic extraction. Source
|
|
53
|
+
selection/SCIP scope omissions still matter; a missing binding is not evidence of no impact.
|
|
54
|
+
Ordinary file links coexist with symbol bindings. Missing/ambiguous selectors report cited
|
|
55
|
+
`implementationGaps`. Diagnostics include at most 100 candidate IDs and the total count. An
|
|
56
|
+
annotated subject with more than 100 supporting facts, or a binding requiring more than 1,000
|
|
57
|
+
selected/definition proofs, reports an explicit gap instead of publishing a partial binding.
|
|
58
|
+
These are conservative first-release bounds, not a silent best-effort coverage claim.
|
|
59
|
+
|
|
60
|
+
Assembly advances from 8 to 9 and records `document-code-binding-extractor@1.0.0`. Existing
|
|
61
|
+
snapshots remain readable, but current validation requires refresh. Semantic provider, prompt
|
|
62
|
+
and artifact keys are unchanged; unchanged extraction is reused. Clean comparison reproduces
|
|
63
|
+
bindings. Refresh remains a full assembly/indexing operation, not incremental SHACL.
|
|
64
|
+
|
|
65
|
+
Draft overlays regenerate all bindings against reindexed captured bytes and only retained semantic
|
|
66
|
+
subjects. Changed/deleted/renamed source documents and targets invalidate old mappings. Draft
|
|
67
|
+
fact IDs and proof references are rewritten together, retain the base SHA plus draft digests, and
|
|
68
|
+
never expose temporary checkout SHAs. A changed rule needs semantic re-extraction before an
|
|
69
|
+
annotated binding to it can return. Old committed evidence stays queryable and cannot become
|
|
70
|
+
current validation merely because it is still useful.
|
|
71
|
+
|
|
72
|
+
## Validation and boundaries
|
|
73
|
+
|
|
74
|
+
Public acceptance runs real TypeScript SCIP, offline deterministic prose extraction, hydration,
|
|
75
|
+
RDF/SHACL, SPARQL, agent query facades, repeat/clean reuse and draft edits/renames/deletes. Negative
|
|
76
|
+
cases include stale source/target digests, ambiguous names, conflicting titles, missing definitions
|
|
77
|
+
and subject IDs, malformed positions and authority/provenance tampering. Fresh packed-consumer
|
|
78
|
+
smoke uses the public API and actual installed code evidence. See VALIDATION.md for executed gates.
|
|
79
|
+
|
|
80
|
+
This completes explicit B3a resolution. It does not provide inferred mappings, actual call edges,
|
|
81
|
+
producer/consumer obligation compatibility or monorepo completeness; those retain separate queue
|
|
82
|
+
items and acceptance criteria. The frozen B2 study is unchanged. No private source or paid model
|
|
83
|
+
run is required by this increment.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# ADR 034: Remaining business-to-symbol mapping gaps
|
|
2
|
+
|
|
3
|
+
Status: B3b deterministic assessment complete, 2026-10-29. A bounded inference proposal is
|
|
4
|
+
justified for review; no model quality result or inference implementation is claimed.
|
|
5
|
+
|
|
6
|
+
## Evidence
|
|
7
|
+
|
|
8
|
+
The [public study](../evaluations/mapping-gaps/README.md) froze ten cases and source hashes in
|
|
9
|
+
`01f7cb6` before measurement. [The recorded run](../evaluations/mapping-gaps/results/2026-10-29.json)
|
|
10
|
+
used clean evaluator commit `e3a3d375733121c1c9a3006ce17a5b765dbafc8d`, real SCIP and ordinary
|
|
11
|
+
hydration/publication through strict RDF/SHACL. Its offline prose grammar recognizes only the
|
|
12
|
+
inventoried rule/workflow and file-claim sentences; it does not evaluate language-model quality.
|
|
13
|
+
|
|
14
|
+
All ten observed classifications match the predeclared states. The graph has 111 facts.
|
|
15
|
+
Cold hydration extracted eight documents in 849 ms; the repeat extracted zero, reused eight
|
|
16
|
+
and retained snapshot identity/content digest in 841 ms. These tiny-fixture timings are not a
|
|
17
|
+
monorepo performance claim. Exact neighborhoods returned every direct binding within budget,
|
|
18
|
+
with no forbidden misleading-name mappings. Structural paths were intentionally bounded;
|
|
19
|
+
seven searches report truncation, one exhausts with an absent rule and two are skipped for
|
|
20
|
+
ambiguous or unindexed targets. No completeness claim is made for truncated paths.
|
|
21
|
+
|
|
22
|
+
| Observed case | Count | Meaning / appropriate response |
|
|
23
|
+
| --- | ---: | --- |
|
|
24
|
+
| Explicit implementation binding | 1 | Rule points to the declared indexed function, with both source proofs. Still a declaration, not proof of compliance. |
|
|
25
|
+
| Explicit test binding | 1 | Rule points to a test function. No test execution is claimed. |
|
|
26
|
+
| Declaration-only binding | 1 | Declaration resolves; the implementation body is absent. Index the implementation before claiming coverage. |
|
|
27
|
+
| File-only claims | 2 | A file association survives. Neither a misleading matching name nor ordinary prose supplies an exact selector. |
|
|
28
|
+
| Document-symbol reference only | 1 | Two rules share a document; proximity does not assign either rule to either function. |
|
|
29
|
+
| Unresolved selectors | 3 | Ambiguous name, excluded source and stale selector remain cited gaps. Qualify, index or repair the source respectively. |
|
|
30
|
+
| Missing intent | 1 | Code exists without an owner rule. Owner intent must be supplied; the evaluator cannot approve inferred business policy. |
|
|
31
|
+
|
|
32
|
+
The file-only and co-located cases can have structural paths to the desired symbol. Those
|
|
33
|
+
paths are not equivalent to an `implementedBy` assertion. This distinction prevents graph
|
|
34
|
+
reachability or returned implementation counts from overstating semantic mapping coverage.
|
|
35
|
+
All explicit bindings remain inferred/unreviewed assertions with declared source authority and
|
|
36
|
+
retained subject evidence. Neither source approval nor syntax upgrades their review state.
|
|
37
|
+
|
|
38
|
+
## Decision and next boundary
|
|
39
|
+
|
|
40
|
+
Keep explicit bindings as the deterministic path. Do not automatically add mapping edges based
|
|
41
|
+
on name similarity, document co-location or shortest paths. Three cases justify evaluating an
|
|
42
|
+
optional proposal pass: the two file claims and the shared-document reference. Repair missing
|
|
43
|
+
evidence/configuration before invoking a model for the other gaps.
|
|
44
|
+
|
|
45
|
+
A separate, opt-in proposal experiment should:
|
|
46
|
+
|
|
47
|
+
- Limit candidates to existing cited business IDs and current indexed code definitions in an
|
|
48
|
+
explicit repository/domain scope. Preserve document and code revisions, spans and digests.
|
|
49
|
+
- Run coverage checks first; distinguish ambiguous, stale, excluded, external/declaration-only
|
|
50
|
+
and missing-intent cases. Permit abstention; never synthesize approved intent.
|
|
51
|
+
- Emit a separate inferred, unreviewed mapping proposal with rationale and supporting evidence.
|
|
52
|
+
A proposal is neither an approved mapping nor proof that code satisfies the rule.
|
|
53
|
+
- Use a distinct extraction/cache identity, bounded candidates/output/cost, cancellation and
|
|
54
|
+
privacy-safe progress. Retain unchanged artifacts without allowing stale code evidence.
|
|
55
|
+
- Predeclare positive and misleading-name/cross-domain negatives before a live evaluation.
|
|
56
|
+
Report precision, misses, abstentions, citation validity, retrieval usefulness and cost
|
|
57
|
+
separately. Compare against explicit bindings and file-level context; require evidence that
|
|
58
|
+
the additional pass improves agent decisions.
|
|
59
|
+
|
|
60
|
+
This is a proposal specification, not authorization for paid runs or automatic promotion. The
|
|
61
|
+
B3b inference implementation/evaluation or a scoped deferral remains a maintainer decision
|
|
62
|
+
before 1.0 qualification. Continue the already requested B3c static-call work independently.
|
|
63
|
+
Bulk intent generation, document backfill, approval UI and hosted AI remain in the 2.0 plan.
|
|
64
|
+
|
|
65
|
+
## CI reliability follow-up
|
|
66
|
+
|
|
67
|
+
PR #58's successful retry and main checks resolved its immediate failed run. Older Windows
|
|
68
|
+
runs also hit the 30-second frozen-study test limit and worker-update timeout. The verifier now
|
|
69
|
+
reads selected immutable Git blobs in one length-framed batch instead of launching Git once
|
|
70
|
+
per file. Test fixture inputs are cached only where immutable; each disposable repository's
|
|
71
|
+
dirty-content/CRLF checks still read fresh bytes. Yielding between synchronous cases lets worker
|
|
72
|
+
updates flush. Binary/CRLF/empty blobs and malformed frames are covered. The original timeout,
|
|
73
|
+
negative assertions, frozen B2 labels and Git-content safety checks are retained.
|
|
74
|
+
|
|
75
|
+
## November 2 implementation decision
|
|
76
|
+
|
|
77
|
+
The maintainer approved the bounded opt-in proposal recommendation. [ADR 039](ADR-039-mapping-proposals.md)
|
|
78
|
+
records its separate operation, authority, exact code/source eligibility, provider and immutable
|
|
79
|
+
cache contract. This supersedes the earlier pending implementation/deferral decision. It does not
|
|
80
|
+
supply a live model-quality result or close B6 acceptance.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# ADR 035: Static call evidence from TypeScript syntax and SCIP
|
|
2
|
+
|
|
3
|
+
Status: implemented for the next candidate, 2026-10-29. Live consumer acceptance remains B6.
|
|
4
|
+
|
|
5
|
+
## Decision
|
|
6
|
+
|
|
7
|
+
Use the TypeScript parser to recognize `CallExpression`/`NewExpression` sites in the exact
|
|
8
|
+
committed documents already read by the SCIP extractor. Join callee tokens to exact SCIP
|
|
9
|
+
occurrence positions, and callable names to indexed definitions. Keep native identities.
|
|
10
|
+
This adds no second indexer or type-resolution program and rereads no source files. The parser
|
|
11
|
+
is an explicit pinned runtime dependency (`typescript@5.5.4`), included in license notices and
|
|
12
|
+
the packed-consumer test. Existing SCIP indexing continues to supply resolution.
|
|
13
|
+
|
|
14
|
+
Each `calls` assertion retains caller, selected target, full invocation span, optional/member/
|
|
15
|
+
construction syntax and proofs of caller definitions, target occurrences and all indexed target
|
|
16
|
+
definitions. Caller proof selection uses the actual AST callable, including assigned arrows;
|
|
17
|
+
native lexical enclosure alone does not identify a caller. Repeated callsites remain separate.
|
|
18
|
+
Top-level calls use the canonical physical-file node. Imports/re-exports follow SCIP identities.
|
|
19
|
+
CodeSymbol IDs and ordinary `references`/`definedBy` evidence remain available independently.
|
|
20
|
+
|
|
21
|
+
`codeCall.target` distinguishes an indexed body, indexed class construction, bodyless declaration
|
|
22
|
+
and external symbol. A member call selects the declaration referenced by the index; it does not
|
|
23
|
+
prove runtime receiver type or rule out overrides, monkey-patching, proxies or reassignment.
|
|
24
|
+
Even lexical calls are static evidence, not guaranteed execution. Authority is implemented
|
|
25
|
+
(draft in overlays), extraction review is deterministic and runtime is explicitly not observed.
|
|
26
|
+
|
|
27
|
+
Callbacks passed as values, type uses and ordinary references do not become calls to those
|
|
28
|
+
values. Invocation through a parameter, computed dispatch, value alias or unsupported expression
|
|
29
|
+
produces a cited gap rather than an invented concrete target. Anonymous callbacks/initializers
|
|
30
|
+
without an exact indexed callable identity do not inherit the enclosing method as their caller.
|
|
31
|
+
Decorators/computed names remain in their enclosing evaluation context; instance field and static
|
|
32
|
+
block initializers currently report gaps. Defaults are attributed to their callable. Ambient files/namespaces provide declarations only; their decorator/default syntax produces no
|
|
33
|
+
runtime call assertions. Syntax errors cause explicit file-level abstention. Implicit JSX factory, getter, operator and framework
|
|
34
|
+
invocations are not synthesized. This is neither complete data flow nor whole-program analysis.
|
|
35
|
+
|
|
36
|
+
## Shared evidence and compatibility
|
|
37
|
+
|
|
38
|
+
The same assertions and proofs are projected into RDF, SPARQL, `graph.neighbors`, `graph.paths`,
|
|
39
|
+
impact packs and viewer source links. A `calls` predicate requires typed metadata; SHACL rejects
|
|
40
|
+
missing fields, invalid kinds/ranges and authority promotion. Consistency checks compare proof
|
|
41
|
+
IDs, endpoints, revisions and source spans against actual same-snapshot code facts. Validation
|
|
42
|
+
targets call records directly rather than scanning every ordinary fact through a new disjunction.
|
|
43
|
+
The validator remains JavaScript and still validates the complete published graph.
|
|
44
|
+
|
|
45
|
+
`FactExtractor.extractWithDiagnostics(context)` is an additive optional core contract returning
|
|
46
|
+
facts and gaps together without mutable last-result state. Hydration and overlays prefer it;
|
|
47
|
+
existing adapters implementing only `extract` remain supported. The built-in SCIP extractor's
|
|
48
|
+
legacy `extract` returns facts; callers needing its gap report should use the complete method.
|
|
49
|
+
|
|
50
|
+
SCIP projection is version 2.1.0, call extraction 1.0.0 and graph assembly 10. These identities
|
|
51
|
+
require refreshed code evidence for current validation while historical snapshots stay queryable.
|
|
52
|
+
The semantic schema still has its original predicate list: model output cannot invent `calls`.
|
|
53
|
+
Prompt/provider/artifact identity is unchanged. No semantic-cache rewrite or forced paid run is
|
|
54
|
+
required. Draft proof IDs and revisions are remapped after code extraction; renamed/deleted
|
|
55
|
+
relationships are replaced while committed snapshots retain their original bytes.
|
|
56
|
+
|
|
57
|
+
## Acceptance and limits
|
|
58
|
+
|
|
59
|
+
The public fixture/expectations were introduced in `0afbd19` and its data representation bounded
|
|
60
|
+
in `d69d65c`, before extraction. Later supplements cover import aliases and evaluation scopes.
|
|
61
|
+
The roughly 3,000-line file contains a real public string catalog between meaningful helper
|
|
62
|
+
chains and distant definitions. It tests location/isolation, not 3,000 lines of algorithmic
|
|
63
|
+
complexity or representative monorepo performance. Budgets: 800 total facts, 90-second hydration,
|
|
64
|
+
four two-fact neighborhood pages and 80,000 response bytes; helper-to-rule paths have explicit
|
|
65
|
+
depth six, three-path and 500-step limits. Truncation is retained, never treated as completeness.
|
|
66
|
+
|
|
67
|
+
Real indexing/hydration tests cover repeated sites, recursion, private/local functions, shadowed
|
|
68
|
+
names, overloads, re-export/import aliases, TSX, BOM/Unicode columns, cross-file callers, values
|
|
69
|
+
and callbacks, declarations without bodies, decorators/defaults/initializers and unresolved
|
|
70
|
+
dispatch. Actual query follow-ups reach a cited rule with its unreviewed mapping authority intact.
|
|
71
|
+
RDF projection and named/union SHACL agree, negative provenance/approval cases fail, and repeat,
|
|
72
|
+
dirty querying, line shifts, rename/delete and draft proof regeneration are exercised.
|
|
73
|
+
|
|
74
|
+
Run `pnpm evaluate:calls` in a development checkout for the public observation report. It uses
|
|
75
|
+
the fixed offline grammar provider, never private inputs or a model. Reports retain original
|
|
76
|
+
assertions, requests/responses, budgets, source hashes, configuration and runtime identity. Tests
|
|
77
|
+
provide the full acceptance assertions; this observation command is not a model-quality grader.
|
|
78
|
+
Browser interaction and live TradePilot usefulness remain separate evidence.
|