Repository navigation
Description
Summary
Track follow-up work that extends Strong mode so it closes the escape hatches agents and LLMs reach for most often. Originally assessed against main @ 621147d01 on 2026-09-10; progress below was verified against upstream main @ 8a4a2e087 on 2026-09-21 using merged PRs and the current compiler, regression tests, docs, scaffold, editor, and eval sources.
Progress as of 2026-09-21
All compiler diagnostic categories in A and B have landed. Twelve checklist entries are complete; the manual-memo prerequisite and the blanket list/index-key proposal have narrower implementations and remain marked partial below. Section C remains open, with docs/MCP updates landed but the website diagnostic catalog incomplete.
- Ref reads: #1029 (merged 2026-09-10).
- State getter calls: #1031 (merged 2026-09-10).
- Mutable module-state reads: #1033 (merged 2026-09-10).
- Ambient browser/global reads: #1036 (merged 2026-09-10).
- Remaining compiler checks,
trustHTML/TrustedHTML, dependency hints, and eligible hook-input caching: #1083 (merged 2026-09-14). - Follow-up analyzer scoping repair: #1040 (merged 2026-09-10).
Where Strong stands now. It is an opt-in, compiler-enforced render-snapshot contract with read-side checks as well as write-side checks. Errors are source-located in compiler/editor analysis. Equivalent explicit dependency arrays intentionally produce nonfatal redundancy hints. These are bounded static checks: supported aliases and known callbacks are followed, but opaque imported behavior, arbitrary mutable containers, and all asynchronous data flow are not proven. Strong still has no runtime phase guard or projection verification mode, and create-octane still does not enable it by default.
Accepted codegen change. #1083 intentionally changes emitted code for eligible Strong const object/array/callback hook inputs and normalizes proven built-in aliases and unshadowed undefined dependency placeholders. The original blanket requirement that valid Strong modules emit identical code is superseded by that landed contract. Compatibility behavior remains unchanged. See the shipped eligibility, migration, and type-checking contract.
Why this matters for agents. Render output must depend on immutable snapshots rather than live ref contents, scheduled state, mutable module state, or ambient browser values. Enforcement diagnostics are errors under Strong so an agent sees them through failed checks. Runtime coverage, structured fixes, defaults, and measured agent outcomes remain separate work in C.
A. Close the read side of the snapshot contract
- Ref reads during render (
OCTANE_STRONG_RENDER_REF_READ). Landed in #1029. ProvableuseRef.currentreads during render are errors, including supported aliases and synchronous helpers. Passing ref identities asref={ref}props and reading them in events, effects, cleanup, or deferred callbacks remains legal. - State getter called during render (
OCTANE_STRONG_RENDER_STATE_GETTER_CALL). Landed in #1031. Calls to the third tuple member ofuseState,useReducer, oruseLinkedStateduring render are errors, including supported tuple aliases. Render from the first tuple member; getter reads remain valid in deferred work. - Mutable module bindings read during render (
OCTANE_STRONG_RENDER_MODULE_STATE_READ). Landed in #1033. Render reads of provably reassigned module-scopelet/varbindings are errors. Use state, context, a subscribed snapshot, or an immutable prop instead. Unreassigned bindings and shadowed locals remain legal. - Ambient globals read during render (
OCTANE_STRONG_RENDER_AMBIENT_READ). Landed in #1036. Known browser handles and nonstandardglobalThisproperty reads during render are errors, including supported aliases andtypeofguards. Shadowed names, standard language builtins, scalar snapshots captured at module initialization, and lazy state/reducer initializers remain legal. Lazy initialization still needs SSR-safe initial output; useuseSyncExternalStorewith a server snapshot for changing browser state. - Effects that fetch and set state (
OCTANE_STRONG_EFFECT_DATA_FETCH). Landed in #1083. Known fetch-to-state effect continuations without returned cleanup are errors. Useuse()or a query binding for render data, or return cleanup for external synchronization. Returning cleanup does not prove that stale results are actually cancelled or ignored. - Effect chains (
OCTANE_STRONG_EFFECT_CHAIN). Landed in #1083. An effect reading state written by another effect's own execution or promise continuation in the same component is an error. External subscription/timer callbacks remain event-driven updates; nested component owners have separate effect graphs. - Unlinked prop state (
OCTANE_STRONG_UNLINKED_PROP_STATE). Landed in #1083. Eager prop-deriveduseStateand two-argumentuseReducerinitializers are errors. UseuseLinkedState(source, reconcile)to follow the source, or a lazy state initializer / explicit third reducer initializer for deliberate initial capture. The check does not generally propagate component prop intent through helper or custom-hook arguments.
B. Remove silent-degradation escape hatches
- Explicit dependency arrays (
OCTANE_STRONG_EXPLICIT_DEPENDENCIES). Landed in #1083. A built-in hook dependency argument that differs from inference, or cannot be proven equivalent, is an error. Equivalent arrays preserve authored behavior and produce labeled, nonfatal hints in compiler, editor, bundler, and CLI output. Effect Events remain excluded; unshadowedundefinedreceives inferred tracking. Callback-observable argument order and duplicates are respected. -
nulldependencies (OCTANE_STRONG_UNTRACKED_EFFECT). Landed in #1083. Known built-in dependency hooks rejectnullunder Strong; omit the argument for inferred tracking. Compatibility mode retains run-every-render behavior. - Manual
useMemo/useCallback— partial against the original prerequisite (OCTANE_STRONG_MANUAL_MEMO). The diagnostic and eligible hook-input caching landed in #1083: both hooks are errors, and eligibleconstobject/array/callback inputs gain stable identities until inferred inputs change. The landed cache pass deliberately excludes arbitrary calls, constructors, tagged templates, spreads, opaque imported custom-hook inputs, unknown helper escapes, and unsupported nested/manual-slot cases. The original requirement to cover every identity shape previously requiring manual memoization is therefore not established. Reconcile that prerequisite with the shipped bounded eligibility contract, or retain it as further caching work. -
.mapreturning JSX, and index keys — partial against the original blanket proposal (OCTANE_STRONG_MAP_JSX,OCTANE_STRONG_INDEX_KEY). #1083 rejects JSX-returning.map()in.tsrxand position-derived@forkeys, while allowing item-ID lookups such asitems[index].id. Standard keyed.tsx/.jsxmapping intentionally remains valid, and a general map-callback-index key check did not land. Reconcile the original cross-dialect requirement with this accepted.tsrxpolicy, or track broader index-key enforcement separately. - Suppression props (
OCTANE_STRONG_SUPPRESSION_PROP). Landed in #1083. DOM intrinsicsuppressHydrationWarningandsuppressNativeChangeWarningprops, including statically visible spreads, are errors. Native textOCTANE_NATIVE_TEXT_ONCHANGEis promoted to an error in Strong; useonInputfor per-edit changes. Component props and native checkbox/radio/selectonChangesemantics remain valid. Dynamic spreads/input types may still require the existing development diagnostic. -
dangerouslySetInnerHTMLrequires a branded value (OCTANE_STRONG_UNTRUSTED_HTML). Landed in #1083 through publictrustHTML/TrustedHTML, compiler rejection of visibly raw DOM values, and nominal Strong JSX types. Strong.tsrxselects those types automatically; plain.tsxneedsjsxImportSource: "octane/strong"or its pragma. Imported/dynamic values require typechecking as well as compilation.trustHTMLmarks an explicit trust decision; it does not sanitize HTML. - Imperative compatibility exports (
OCTANE_STRONG_COMPAT_IMPORT). Landed in #1083. Value imports and known namespace accesses forflushSync,unstable_batchedUpdates, andStrictModefrom Octane are errors, including supported aliases and theoctane/serverentrypoint. Use normal Octane scheduling and component semantics.
C. Enforcement, fix-its, defaults, and measurement
- Dev-only runtime phase guard for Strong components.
docs/strict-state-plan.mdproposed it and it did not ship, so Strong is purely static and the docs admit unknown call shapes do not fall back. Have the compiler stamp Strong components (a static marker on the component body, in the same spirit as$$singleRoot), and have the dev runtime throw on a state update,ref.currentwrite, or getter call while a Strong render or synchronous effect setup is on the stack. Throwing fails the agent's test run, where a static check only sees code the analyzer understands. Must be zero-cost in production and must not add work to non-Strong components; follow.rulesync/rules/core-engineering.mdfor hot-path evidence. - Strong verification mode. Octane rejects StrictMode double-invoke as a React feature, but a dev-only, opt-in mode that re-evaluates eligible Strong projections and asserts
Object.is-equal results is a different thing: it verifies the purity assertion that production memoization trusts, and catches the live-accessor-behind-stable-inputs case the docs currently handle with prose. Scope, cost, and the reporting channel need a design note before implementation. - Structured fix-its on every Strong diagnostic. Human-readable suggestions and compiler/editor diagnostics are present, but the source-range/replacement edit contract and Volar code actions have not landed. Give every existing and new Strong code at least one suggestion with a source range and replacement text, surface it through Volar as a code action, and document the shape so agents can apply it verbatim. The error message is the documentation the agent actually reads.
- Default-on in
create-octane. The scaffold does not mention Strong today. Containment is already solved because dependencies stay in compatibility mode unless they opt in, so the blast radius of a default is the application's own source. Enablecompiler.strongin generatedoctane.config.tsand in the website's getting-started path once section A and B items have landed and the eval family below is green. - Eval coverage in
@octanejs/evals. Add Strong tasks todatasets/train/user-apps-v1(or a new family) that target each new diagnostic's failure mode, so every code is checked against the behavior it claims to prevent. Behavioral claims about agent outcomes are not accepted without measurement in this repo. - Docs and catalog — partial. Strong sections in
docs/tsrx-basics.mdanddocs/differences-from-react.md, the newdocs/strong-compiler-checks.mdreference, and MCPreact-divergences.mdguidance landed with #1029, #1031, #1033, #1036, and #1083. The website build-tools guide includes the read-side checks, but its error catalog still covers numeric runtime errors rather thanOCTANE_STRONG_*diagnostics, andwebsite/public/llms.txtstill lists the older write-side set. Finish the Strong diagnostic catalog and bring the website/LLM reference into parity with the newly landed checks.
D. Close the nearest workaround for each rule
A probe on 2026-09-30 compiled 65 common agent patterns with "use strong" against main @ 85cb387fe. Strong rejected 12 of them. Most of the rest were one-line rewrites of patterns Strong already rejects. An agent that hits a Strong error makes the smallest edit that silences it, for example useEffect(() => { startTransition(() => setX(v)); }), or returning () => {} to satisfy the fetch check. So each diagnostic should ship with its nearest workarounds also rejected, and each new rule's fixtures should include the likely rewrite. Status below was checked on 2026-10-01.
Effects
- Zero-delay deferral and custom-hook setters (
OCTANE_STRONG_EFFECT_STATE_UPDATE). Landed in fix(compiler): require Strong effect cleanup to cancel or ignore async state updates #1482, which absorbed fix(compiler): count zero-delay effect callbacks and custom-hook updaters as Strong effect setup #1481.- These now count as effect setup:
startTransition, auseTransitionstart function,queueMicrotask, a continuation on an already-settled promise,setTimeout(fn)andsetTimeout(fn, 0), andawaitof a non-promise. - Setters returned from same-module custom hooks are now followed.
requestAnimationFrame, timers with a nonzero delay, and subscription callbacks stay legal.
- These now count as effect setup:
- Async updates need a cleanup that cancels or ignores them (
OCTANE_STRONG_EFFECT_DATA_FETCH). Landed in fix(compiler): require Strong effect cleanup to cancel or ignore async state updates #1482.- Any promise continuation in effect setup that writes state is covered, not only
fetch. - The cleanup must abort a controller whose signal reaches the call, or set a flag that guards the write.
return () => {}no longer passes. - The docs line admitting that returning cleanup does not prove stale results are ignored is replaced by an "Effect cleanup" section.
- Any promise continuation in effect setup that writes state is covered, not only
- Hidden dependencies in effect setup (
OCTANE_STRONG_EFFECT_HIDDEN_DEPENDENCY). Landed in feat(compiler): require Strong effect cleanup to release platform resources #1484, which included feat(compiler): reject hidden dependencies in Strong effect setup #1483.- Rejected in synchronous setup: state getter calls,
.currentreads on value refs (refs not attached throughref=), and reads of reassigned module bindings. These quietly drop an input from inference. - Replacement: the render snapshot, or
useEffectEventas the single declared non-reactive escape. - Attached DOM refs, cleanup, deferred callbacks, and Effect Event bodies stay legal.
- This also rejects
isFirstRenderanddidInitguards, which do nothing in Octane because there is no StrictMode double-invoke.
- Rejected in synchronous setup: state getter calls,
- Unreleased platform resources (
OCTANE_STRONG_EFFECT_RESOURCE_LEAK). Landed in feat(compiler): require Strong effect cleanup to release platform resources #1484.- Octane has no StrictMode double-invoke, so leaks never surface in development.
- These must be released in the returned cleanup: listeners on browser targets,
matchMedia, and attached elements;on*handler properties; intervals and self-rescheduling timers; observers;WebSocket,EventSource, andBroadcastChannel; geolocation watches. - Only platform APIs count.
subscribeoraddEventListeneron user objects, and one-shot timers, stay legal.
- Analyzer fix:
catchandfinallyafter a rejected await are deferred, not synchronous setup. Landed in fix(compiler): let Strong catch clauses run after an awaited call rejects #1488. - Dropped:
useLayoutEffectwithout DOM access. Opaque calls such asonLayout(),editor.focus(), or an importedmeasure()legitimately do layout work, so the check cannot be precise.
State
- Impure updaters and reducers (
OCTANE_STRONG_IMPURE_UPDATER). Landed with feat(compiler): reject write-only state in Strong mode #1497 (opened as feat(compiler): require pure state updaters and reducers in Strong mode #1495).- Octane can evaluate one updater more than once. A transition-staged update is evaluated when it is scheduled and again when the transition renders.
- An urgent update made while a transition is held is rebased onto the held value (
rebaseHeldTransitionUpdate). useOptimisticreapplies its reducer while an Action is pending.- Runtime tests pin each case.
- State mutation outside render (
OCTANE_STRONG_SNAPSHOT_MUTATION). Landed with feat(compiler): reject write-only state in Strong mode #1497 (opened as feat(compiler): reject state mutation outside render in Strong mode #1494). Follow-ups landed in feat(compiler): reject uncached useSyncExternalStore snapshots in Strong mode #1498 and feat(compiler): reject stale deferred state updates in Strong mode #1496.- Covers event handlers, effects, cleanup, timer and promise callbacks, helpers that receive the value, and updaters and reducers.
s.list.push(1); setS({ ...s })appears to work, but it changes the previous snapshot that transitions anduseOptimisticrevert to.
- Stale deferred updates (
OCTANE_STRONG_STALE_STATE_UPDATE). Landed with feat(compiler): reject write-only state in Strong mode #1497. Effect Event follow-ups landed in feat(compiler): reject stale deferred state updates in Strong mode #1496.- Rejects
await save(); setN(n + 1)and the same pattern in timer callbacks. - Runtime tests show two overlapping saves end at
1this way, and at2with the updater form. - The message names the updater form and the state getter. This mirrors
OCTANE_STRONG_RENDER_STATE_GETTER_CALL.
- Rejects
- Write-only state (
OCTANE_STRONG_WRITE_ONLY_STATE). Landed in feat(compiler): reject write-only state in Strong mode #1497.const [, force] = useState(0)is a force-update hack that misses changes made between render and subscription.- Replacement:
useSyncExternalStore.
- Uncached
useSyncExternalStoresnapshots (OCTANE_STRONG_UNCACHED_STORE_SNAPSHOT). Landed in feat(compiler): reject uncached useSyncExternalStore snapshots in Strong mode #1498.- Open question: an inline
subscriberesubscribes on every render in both modes, and Strong declaration caching does not cover it. A runtime test pins this behavior. Caching it needs identity and invalidation evidence first; meanwhile the docs recommend a module-levelsubscribe.
- Open question: an inline
Render and DOM
- Render determinism gaps (
OCTANE_STRONG_RENDER_IMPURE_CALL,OCTANE_STRONG_RENDER_LOCALE_FORMAT). Landed in feat(compiler): close Strong render determinism gaps #1489.- Callbacks of synchronous array methods and the
Array.frommapper now run as render. Previouslyitems.map((i) => <li key={Math.random()}>…</li>)compiled. crypto.randomUUID()andcrypto.getRandomValues()join the impure-call list.- Date and
Intlformatting during render without an explicit locale and time zone is rejected, because it guarantees a hydration mismatch.
- Callbacks of synchronous array methods and the
- Writes to DOM the template renders (
OCTANE_STRONG_MANAGED_DOM_WRITE,OCTANE_STRONG_RAW_HTML_WRITE). Landed in feat(compiler): reject Strong document queries for a component's own markup #1492, which included feat(compiler): reject Strong writes to DOM the template renders #1491.- Rejected when the ref provably attaches to one intrinsic element:
r.current.textContent = …on an element with rendered children, andclassNamewhen the template setsclass. - Raw
innerHTMLwrites point totrustHTMLwithdangerouslySetInnerHTML.
- Rejected when the ref provably attaches to one intrinsic element:
- Document queries for a component's own markup (
OCTANE_STRONG_OWN_MARKUP_QUERY). Landed in feat(compiler): reject Strong document queries for a component's own markup #1492.- Rejects
document.getElementById('x')orquerySelector('.box')when the same component renders that literalidorclass. The replacement is a ref. - Portal targets stay legal.
- Rejects
Tooling
- Strong repair eval family in
@octanejs/evals. Landed in feat(evals): add the Strong mode repair task family #1493. This partially addresses "Eval coverage" in C.- An agent receives failing code and its Strong error. The run is graded on whether the fix compiles and whether the bug is actually gone.
- Rewrites that compile but keep the bug become compiler fixtures. This is how the next round of workarounds should be found.
- Strong coverage ratchet (
OCTANE_STRONG_COVERAGE_REGRESSION,OCTANE_STRONG_COVERAGE_STALE). feat(cli): fail CI when a module stops compiling under Strong mode #1515.- The cheapest way around Strong is leaving it: deleting
"use strong", turningcompiler.strongoff, or moving code into another package. octane analyze --strong-baseline initrecords today's non-Strong modules in a checked-inoctane-strong-baseline.json. While it exists, everyoctane analyzerun fails on a module that is neither Strong nor listed, and on a listed name that is now Strong or gone.--strong-baseline updateonly removes names, so a new exception is always a reviewed edit to the file.- Which modules are Strong is decided by the compiler's new
strongModuleStatus, the same decisiontransformmakes. - Also fixes
octane analyzeignoringcompiler.strongfromoctane.config.ts. - Limitation: a bundler plugin's inline
strongoption is not visible to the CLI.
- The cheapest way around Strong is leaving it: deleting
Deliberately not pursued
- Rejecting
use(fetch(...)). The compiler memoizesuse()creations per call site, so this is valid Octane. - Rules keyed on names such as
onChangeorsubscribe. Naming heuristics stay a non-goal. - General lint such as empty
catchblocks or@ts-ignore. These belong in a linter, not the framework contract. - Treating
requestAnimationFramedeferral as synchronous. The enter-animation pattern is legitimate.
Non-goals
- Do not reintroduce Rules of Hooks or naming heuristics. The docs are explicit that
use*spelling is not a purity oracle; that is what keeps Strong honest. - Enforcement diagnostics are errors under Strong. Equivalent explicit dependency arrays intentionally produce nonfatal redundancy hints, as landed in feat: complete remaining Strong compiler checks #1083.
- Do not change compatibility-mode behavior. Every item is gated on
"use strong"orcompiler.strong. - Strong opt-in may change generated code for the landed caching and dependency-normalization contract. Preserve compatibility semantics, and require identity/invalidation evidence for new caches. Diagnostic-only fixtures should continue to pin unchanged client/server output.
Evidence required per PR
- Positive and negative fixtures in
strong-mode.test.ts, including shadowed names, aliases, namespace imports, optional chains, and plain.ts/.tsxcustom-hook modules, matching the existing test matrix. - Volar diagnostics parity with source-located errors.
- Compatibility behavior preserved; unchanged client/server output for diagnostic-only fixtures, with separate behavior and byte-cost evidence for intentional Strong caching/codegen changes.
- Compiler throughput check for the analyzer additions; section C runtime work also needs the standard render/mount benchmark evidence.
Activity
domgan-oai commentedon Sep 21, 2026
Updated the issue body and checklist against upstream
main @ 8a4a2e087(2026-09-21).Landed PRs: #1029, #1031, #1033, #1036, and #1083, plus the analyzer scoping follow-up #1040.
Twelve entries are now checked off. All A/B diagnostic categories have landed, with two entries kept partial against the original broader requirements: universal manual-memo replacement coverage and cross-dialect map/index-key enforcement. Docs and MCP guidance have also landed; the website Strong diagnostic catalog and LLM reference remain partial.
The five outstanding C items are runtime phase enforcement, projection verification, structured fix-its/Volar actions, default-on scaffolding, and Strong eval coverage. The body also now records #1083's intentional Strong caching/codegen changes instead of the original blanket output-parity assumption.
This update was prepared and posted by Codex at Dominic's request.