Skip to content

fix(cli): follow a Strong dependency's own imports in Strong reports - #2061

Merged
trueadm merged 1 commit into
mainfrom
fix/strong-dependencies-transitive
Oct 14, 2026
Merged

trueadm merged 1 commit into
mainfrom
fix/strong-dependencies-transitive

Conversation

@trueadm

@trueadm trueadm commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This fixes a gap in octane analyze --strong-dependencies that the investigation on #2059 found. The report followed imports from the project's own Strong modules only. For every module it reached in a dependency, it treated that module's imports as implementation and never looked behind them.

So when a Strong dependency module imported a non-Strong module, the report said nothing, and the same was true when that import reached octane/react. The case from the reply on #2059 (Strong app → Strong dependency → non-Strong implementation that imports octane/react) produced an empty report. As a result, an empty report did not prove that everything the project renders is Strong, which #2059's done criteria rely on.

A Strong module the walk reaches in another package is now checked the same way as the project's own Strong modules: its own imports are followed. The check therefore continues through every Strong layer until it reaches the first module that isn't Strong. Imports of non-Strong dependency modules are still treated as their implementation, so nothing beyond the first non-Strong layer is reported.

Validation

  • pnpm format:check: not run repo-wide. pnpm format:files:check on the changed files passes.
  • pnpm typecheck: not run repo-wide. pnpm typecheck:files on strong-dependencies.js passes.
  • pnpm test: not run locally; CI runs it.
  • targeted tests: vitest run packages/cli/tests/analyze.test.js --project cli, 28 passed. The @kit/ui fixture's Strong Dialog.tsrx now imports a non-Strong Backdrop.tsx that uses octane/react. The assertion fails on main, where neither the module nor the boundary is reported.
  • pnpm sync: no generated changes.
  • perf-review: not applicable. The change is confined to packages/cli: no runtime code, compiler output or binding hot path.
  • concise-code:
    • Size: src +18 −10, runtime +0 −0.
    • New files and exports: none apart from the changeset.
    • Alternative rejected: adding each Strong dependency module to roots as a separate walk. That would report findings under the dependency module as the importer rather than the project module that reached it. It would also need its own seen set and its own package as home, which would skip non-Strong modules in the same package. Those are exactly the modules a package that adopts Strong one module at a time still has.
    • Bytes: not applicable.

Risk / follow-ups

  • Within one package, a Strong module's non-Strong imports are now reported when the walk reaches that package from the project. Run the website in Strong mode #2059 notes that a future per-directory form of the octane.strong declaration would need compile-time enforcement of the same rule; this report only previews it.

Provenance

  • An agent produced this diff (agent-authored)

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Note

Low Risk
CLI-only static analysis for Strong dependency reporting; no runtime, compiler output, or auth/data paths.

Overview
octane analyze --strong-dependencies now walks imports through Strong modules inside dependencies, not only from the app’s own Strong entrypoints. When the graph hits a Strong module in another package, its imports are followed the same way as project roots, continuing through Strong layers until the first module that is not Strong.

Non-Strong modules in a dependency are still treated as implementation detail (their imports are not expanded). The visit logic uses an isStrong check and extends import following when strong === true, so non-Strong modules and octane/react boundaries behind a Strong dependency (e.g. Strong Dialog → non-Strong Backdrop) show up in packages and reactCompat. An empty report is closer to meaning “everything rendered is Strong.”

Tests extend the @kit/ui fixture so Strong Dialog.tsrx imports Backdrop.tsx using octane/react; expectations include that module and boundary. @octanejs/cli patch changeset documents the behavior change.

Reviewed by Cursor Bugbot for commit a1e443d. Bugbot is set up for automated code reviews on this repo. Configure here.

`--strong-dependencies` followed only the project's own Strong modules'
imports, then treated every dependency module's imports as its
implementation. A Strong dependency module that imported a non-Strong
module, or one that reached `octane/react`, was never looked past, so
an empty report did not prove that everything the project renders is
Strong. A Strong module the walk reaches in another package now answers
to the same rule as the roots, so its own imports are followed through
every Strong layer to the first module that is not Strong.

Reported in #2059.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the agent-authored Diff or issue body substantially produced by an AI agent label Oct 14, 2026
@trueadm
trueadm marked this pull request as ready for review October 14, 2026 19:24
@github-actions github-actions Bot added the fix PR: bug fix label Oct 14, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
⚠️ Deployment skipped
View logs
octane-website a1e443d Oct 14 2026, 07:23 PM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
⚠️ Deployment skipped
View logs
octane-website-mcp a1e443d Oct 14 2026, 07:23 PM

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark report

🟢 No byte growth, no added work, and no timing changes beyond ±3%.

Compares a1330167c, the merge commit's first parent with f92e9cdbd on the same runner. Any increase in a js-framework work counter fails this check; byte changes are a report. Wall time is a report: base and head samples alternate in one browser, and an operation is called slower or faster only when the 95% confidence interval of its ratio excludes ±3%. Workflow run

js-framework: 1k/10k row operations

All 20 timed operations (20 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 3.350 3.408 −1.7% −6.4% … +3.3% ⚪ within noise
octane-tsrx replace 9.858 10.200 +13.5% −2.6% … +19.4% ⚪ within noise
octane-tsrx add 3.500 3.292 −3.3% −6.7% … +0.0% ⚪ within noise
octane-tsrx update 0.149 0.149 +2.1% −4.5% … +5.3% ⚪ within noise
octane-tsrx select 0.008 0.009 +1.2% −2.9% … +8.8% ⚪ within noise
octane-tsrx swap 0.027 0.025 −7.4% −13.7% … +0.6% ⚪ within noise
octane-tsrx remove 0.020 0.021 −2.2% −5.2% … +2.3% ⚪ within noise
octane-tsrx runlots 32.300 30.400 −0.9% −5.5% … +1.2% ⚪ within noise
octane-tsrx select_lots 0.007 0.008 +2.5% +0.3% … +4.1% ⚪ within noise
octane-tsrx clear 63.917 61.950 −3.9% −8.7% … +1.8% ⚪ within noise
octane-jsx run 4.575 4.992 +1.8% −4.0% … +2.5% ⚪ within noise
octane-jsx replace 10.875 10.117 −6.4% −15.2% … +2.3% ⚪ within noise
octane-jsx add 4.308 4.433 −3.1% −10.9% … +9.1% ⚪ within noise
octane-jsx update 0.363 0.351 −6.2% −20.1% … +2.9% ⚪ within noise
octane-jsx select 0.180 0.194 +4.8% −6.8% … +7.2% ⚪ within noise
octane-jsx swap 0.230 0.240 −0.3% −5.6% … +7.1% ⚪ within noise
octane-jsx remove 0.246 0.226 −4.1% −12.2% … +24.0% ⚪ within noise
octane-jsx runlots 39.550 37.467 −3.6% −10.8% … +1.3% ⚪ within noise
octane-jsx select_lots 3.043 3.173 −5.5% −15.0% … +7.3% ⚪ within noise
octane-jsx clear 85.283 80.892 +0.2% −9.6% … +7.5% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

No changes across 93 measured values.

Public-import reachability bundles (bytes)

No changes across 120 measured values.

@trueadm
trueadm merged commit 74f22dd into main Oct 14, 2026
50 of 53 checks passed
@trueadm
trueadm deleted the fix/strong-dependencies-transitive branch October 14, 2026 19:45
trueadm added a commit that referenced this pull request Oct 15, 2026
Brings in #2047-#2051 (Strong literal stabilisation), #2054 (checked
compiled boundaries and a compiled router entry), #2055/#2057 (Strong
rejects descriptor APIs and .tsx/.jsx), #2056/#2060/#2061 (CLI Strong
reports), #2062 (Strong in the website and devtools), #2065 (no
browser-translation DOM accommodations) and Version Packages.

Conflicts, resolved so main's behaviour lands on the redesign's commit model:
- runtime.ts, #2065: setText keeps main's legacy host-only convention and the
  redesign's hydration writeText. The translator recovery is gone from
  renderText/commitText, setRenderText/commitSetText, commitHole,
  childTextHoleUpdate, recordHole and bindSignalChild; removeOnlyChildText
  still removes a committed Text at commit. resetOnlyChildHost and
  PENDING_HOST_TEXTS (which served only the host-only text writes) are deleted.
- compile.js, #2065: text updates call setRenderText(_txt, v), commit
  functions setText(_txt, v), and commitHole takes no host.
- runtime.server.ts, #2054: a compiled-only frame checks its output;
  ordinary frames keep the redesign's returned-value normalization.
- codes.json: main's 344-346 (CompiledContext, CompiledOutlet) keep their
  numbers; the redesign's codes move to 347 (server boundary error), 348
  (hydration protocol skew) and 349 (frontier rehome). Generated tables and
  CLI data are regenerated; docs/ssr.md names #348.

Adaptations:
- compiled-boundaries.test.ts: the server runs no error boundary (React's
  model), so an invalid CompiledOutlet under a catch-only @Try fails
  renderToString with the CompiledOutlet error; the client still shows the
  catch arm.
- scripts/render-writers.mjs drops resetOnlyChildHost.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant