Skip to content

fix(layering): parse static imports from OXC AST - #3317

Merged
thymikee merged 4 commits into
refactor/ws10-shared-graph-traversalsfrom
refactor/oxc-static-import-ast-parity
Oct 8, 2026
Merged

thymikee merged 4 commits into
refactor/ws10-shared-graph-traversalsfrom
refactor/oxc-static-import-ast-parity

Conversation

@thymikee

@thymikee thymikee commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Validation

  • Head 5f411172f460e2d16eabf97e94ca749f565ca554: pnpm check:affected --run passed every runnable check; pnpm check:fallow --base origin/main also passed. CI pending.
  • Against parent 8ed2225f0: all 10,182 prior resolved edges retain identical symbols/kinds/lines/residue. No edges removed. Layering stdout, 22 cycle paths/kinds and all seven ownership sets (3,813 assignments) match exactly; R75 remains 13 shape / 22 authority files.
  • Malformed-parse and template-text regressions fail before their fixes and pass afterward. The named import-type/R75 regression passes; the production-edge test also fails with TSImportType extraction disabled.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.12 MB 5.12 MB 0 B
Package (unpacked) 5.12 MB 5.12 MB 0 B
Package (download) 1.54 MB 1.54 MB -2 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 19.2 ms 21.7 ms +2.5 ms
CLI --help 58.3 ms 55.2 ms -3.2 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread scripts/layering/model.ts Outdated
@thymikee
thymikee force-pushed the refactor/oxc-static-import-ast-parity branch from 9a804db to aa8e691 Compare October 8, 2026 09:12
@thymikee

thymikee commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

This PR is ready at 1c517f3, and the code looks good. All 14 checks pass on this head, including the jobs behind check:layering, package boundaries and mutation ownership. I did not run those checks myself, so the identical layering output and the unchanged ownership and R75 counts rest on that green CI and your description. I also did not confirm that the old regex scanner never made edges from import-like text inside template literals in production sources. No conflicts.

Not blocking: parseImports in scripts/layering/model.ts ignores parsed.errors, so a file OXC fails to parse would silently lose edges instead of failing the gate (typecheck makes this unreachable today), and the nine-pair test in scripts/layering/model.test.ts pins the live repository, so it breaks when one of those imports moves even if the parser is right. Take or leave both.

The cubic-dev-ai thread on the importTypeSourceName qualifier is fixed at this head, so you can resolve it: #3317 (comment)

This PR merges after its stacked base #3316 lands.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 8, 2026
@thymikee
thymikee added this pull request to stack #3320 October 8, 2026 11:06
@thymikee
thymikee force-pushed the refactor/oxc-static-import-ast-parity branch from 1c517f3 to 65c5b40 Compare October 8, 2026 13:42

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread scripts/layering/model.test.ts
@thymikee

thymikee commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

Addressed both broader review suggestions and rebased onto the corrected #3316 head. Final head: 65c5b4041f583d08278bf9acf33371ae8d18cf1f.

  • parseImports now throws on OXC parse errors instead of returning an incomplete graph. The malformed-import regression failed with “Missing expected exception” before the fix and passes afterward.
  • The nine recorded import-type shapes now use isolated source/export-map fixtures. They retain the real relative/workspace/typeof import forms and assert source-side symbols, without reading live declaration files. This matters on the new base: the contracts shutdown declaration moved upstream, so eight of the original nine pairs are newly missing from the regex scanner now.
  • Removed the redundant ordering counter; the comparator preserves line, dynamic-before-static, and source-offset order with the language’s stable sort.
  • Added a comments/template-text regression: the old scanner invented three edges from the fixture; the AST scanner returns none.

Explicit production comparison against parent 98b6e832c42edfa9a9a2c31efacf8bca0c3a1d82:

Measurement Result
Previously resolved edges All 10,182 retained byte-identically, including symbols, kinds, lines and residue
Added edges 104 type-only occurrences; eight new file pairs; zero value/dynamic additions
Removed edges Zero — no production template-text phantom edges were lost
Layering stdout, including R75 counts Byte-identical; 13 shape / 22 authority files
Cycle paths/kinds All 22 identical
Mutation ownership sets All seven identical, 3,813 assignments

Every new edge is a type dependency permitted by the existing rules; there are no new findings to suppress or repair. R6/R75 still inspect type edges under their existing semantics; eager closure/R4 use evaluated value edges, so their budgets do not grow. Ownership includes type edges but these do not add owners.

The eight new pairs are runner-provider → runner-artifact; interaction/index → gesture-runtime and touch-runtime; interaction/internal/interaction → contracts/android-observation; snapshot-runtime-binding → contracts/focus-runtime, interactor-types and type-text-runtime; sdk/artifacts → platform-android/mechanics. Other added occurrences are type references between file pairs already represented by existing imports.

The qualifier-symbol/R75 inline thread remains resolved. pnpm check:affected --run passed every runnable check on the exact pushed head. CI is running.

@thymikee
thymikee force-pushed the refactor/oxc-static-import-ast-parity branch from 65c5b40 to 5f41117 Compare October 8, 2026 13:49
@thymikee
thymikee merged commit bf4cfb5 into main Oct 8, 2026
25 of 28 checks passed
@thymikee
thymikee deleted the refactor/oxc-static-import-ast-parity branch October 8, 2026 14:57
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-08 14:58 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Architecture WS8: parse static imports on the existing OXC AST (fix the nine missed type-import pairs)

1 participant