Repository navigation
Conversation
…ters as Strong effect setup OCTANE_STRONG_EFFECT_STATE_UPDATE could be bypassed by deferring the update by zero delay or by returning the state tuple from a same-module custom hook. Callbacks that run before the next paint now count as synchronous effect setup: startTransition (imports, aliases, namespaces, optional calls), a useTransition start function, queueMicrotask, .then/.catch/.finally on Promise.resolve(value) or Promise.reject(), setTimeout without a positive delay, and code after awaiting a value that is not a pending promise. requestAnimationFrame, positive-delay timers, and external subscription callbacks remain event-driven. Synchronous calls to local functions now record what they return, so state tuples, updaters, callbacks, and transition starts returned by same-module custom hooks keep their provenance in the caller. Each call gets its own state identity so separate calls never read as one state in effect graphs. The classification lives in a new strong-effects.js policy module. Emitted code and compatibility modules are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…c state updates OCTANE_STRONG_EFFECT_DATA_FETCH only recognized fetch, and any returned cleanup satisfied it, so an imported client, axios, or an empty cleanup silenced the check. Any state update that runs after an await, or in a .then/.catch/.finally callback, of effect-owned work now needs proof that the returned cleanup cancels or ignores it: - the cleanup aborts an AbortController created in the effect whose signal reaches the request (directly, through aliases or destructuring, in an options object, or through a same-module helper parameter), or the update is guarded by that signal's aborted flag; or - the cleanup assigns a let flag declared in the effect, and the update is guarded by that flag after the last await (if tests, early returns, &&/||). Empty, opaque, and unconnected cleanups, component- or module-scoped flags, ref flags, and guards checked before a later await are errors. Async effect callbacks cannot return cleanup and get a message that says so. This replaces the fetch-only continuation tracking in strong-mode.js with guard, flow-segment, and source tracking in strong-effects.js. Deferred constructors and tagged templates in effect-owned work are now followed like calls. Emitted code and compatibility modules are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reading a state getter, a value ref's current, or a reassigned module variable in synchronous effect setup hides that input from dependency inference, so the effect does not re-run when it changes. The common previous-value and first-run ref guards rely on exactly this. Add OCTANE_STRONG_EFFECT_HIDDEN_DEPENDENCY for those reads in effect setup, including synchronous local helpers, zero-delay callbacks, compound updates, destructuring, and getters returned by same-module custom hooks. A value ref is a useRef whose identity is only used for property access, stable aliases, and explicit dependency lists; attaching it with ref=, passing it to a call, component, or hook, storing it in a container, or returning it keeps it readable. Reads in cleanup, deferred callbacks, and useEffectEvent callbacks remain valid. The message points to the render snapshot or useEffectEvent and notes that Octane never double-invokes effects. Emitted code and compatibility modules are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Dep arrays miss TS wrappers
- The ArrayExpression case in classify() now peels transparent wrappers (as const, satisfies, !, parens) above the dependency array before looking up the enclosing call in callNames, so wrapped dependency lists are correctly recognized and refs inside them are not marked as escaped.
Or push these changes by commenting:
@cursor push 3a7a60a386
Preview (3a7a60a386)
diff --git a/packages/octane/src/compiler/strong-effects.js b/packages/octane/src/compiler/strong-effects.js
--- a/packages/octane/src/compiler/strong-effects.js
+++ b/packages/octane/src/compiler/strong-effects.js
@@ -611,9 +611,16 @@
return;
case 'ArrayExpression': {
// A dependency list is not a use of the ref's identity.
- const call = parents[index - 1];
+ // Peel transparent wrappers (as const, satisfies, !, parens)
+ // around the array to reach the enclosing call.
+ let arg = parent;
+ let callIndex = index - 1;
+ while (callIndex >= 0 && TRANSPARENT.has(parents[callIndex].type)) {
+ arg = parents[callIndex--];
+ }
+ const call = parents[callIndex];
const position = DEPENDENCY_ARGUMENTS.get(callNames.get(call));
- if (position !== undefined && call.arguments?.[position] === parent) return;
+ if (position !== undefined && call.arguments?.[position] === arg) return;
break;
}
}
diff --git a/packages/octane/tests/compiler/strong-effects.test.ts b/packages/octane/tests/compiler/strong-effects.test.ts
--- a/packages/octane/tests/compiler/strong-effects.test.ts
+++ b/packages/octane/tests/compiler/strong-effects.test.ts
@@ -987,6 +987,15 @@
});
it.each([
+ ['as const', `useEffect(() => { props.log(last.current); }, [last] as const);`],
+ ['satisfies', `useEffect(() => { props.log(last.current); }, [last] satisfies any);`],
+ ['non-null assertion', `useEffect(() => { props.log(last.current); }, [last]!);`],
+ ['parenthesized', `useEffect(() => { props.log(last.current); }, ([last]));`],
+ ])('does not treat a dependency list wrapped with %s as attaching a ref', (_label, setup) => {
+ expect(errors(app(`const last = useRef(0); ${setup}`))).toContain(HIDDEN);
+ });
+
+ it.each([
['ref writes', `const last = useRef(0); useEffect(() => { last.current = count; });`],
[
'an element ref',You can send follow-ups to the cloud agent here.
…y awaits Two review findings on the Strong zero-delay and custom-hook checks: - mergeShapes required every return of a custom hook to yield the same shape object, but each `return [value, setValue]` or object literal builds a fresh shape, so a hook returning its tuple on two paths lost updater provenance. Array and object shapes now merge element by element, keeping each value that every path returns. - Zero-delay awaits only matched a direct Promise.resolve/reject call. Sequence, conditional, and logical forms now recurse, and an await result counts as a non-promise, so `await (await null)`, `await (0, Promise.resolve())`, and `await (flag ? Promise.resolve() : null)` stay in effect setup. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… path
Review finding: abort controllers found on one await stayed on the flow for
later awaits that carried no signal, and if/switch visits never restored the
flow, so an abort belonging to one request could count as cleanup for a
different update, including one on an exclusive branch.
Each yield now replaces the abort proof with its own request's controllers,
including a request whose result it reads (`(await fetch(url, { signal })).json()`).
Branches, logical operands, switch cases, try/catch, and loops join their
flows: only controllers shared by every path survive, and a join after any
yield starts a new segment. Loop bodies that yield start from a fresh
segment because a later iteration follows the previous iteration's yield.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ct-hidden-dependencies # Conflicts: # packages/octane/src/compiler/strong-effects.js
…ue-ref check Review finding: a ref listed in a parenthesized or cast dependency list (`([ref])`, `[ref] as const`, `[ref] satisfies unknown[]`) counted as an escape, so effect setup could read its current value without OCTANE_STRONG_EFFECT_HIDDEN_DEPENDENCY. The dependency-list check now climbs transparent wrappers to the hook call. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review finding: an await result counts as settled, so the outer await in `await (null ?? await load())` or `await (true ? await load() : null)` is zero-delay, and the yield belongs to the inner await. alwaysAwaits only inspected the left operand of a logical expression and required both branches of a conditional, so it missed that inner await and a later update was rejected as effect setup. A literal left operand or literal test now selects the operand that always runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ct-hidden-dependencies
… loops normally Review findings on the flow joins added for Strong abort proofs: - A catch handler that always returns or throws no longer joins into the code after the try, so the try block's proof survives. - A switch case ending in continue leaves the enclosing loop and no longer joins the flow after the switch. - A loop test that always yields runs right before every iteration, so its proof is kept instead of starting the body from a fresh segment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ct-hidden-dependencies
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Ternary await drops abort proof
- Extended sourceOf to unwrap SequenceExpression and pass ConditionalExpression/LogicalExpression through to requestControllers, which intersects controller sets from each branch, so await over ternary/sequence/logical expressions now correctly finds abort controllers.
Or push these changes by commenting:
@cursor push 13af307020
Preview (13af307020)
diff --git a/packages/octane/src/compiler/strong-effects.js b/packages/octane/src/compiler/strong-effects.js
--- a/packages/octane/src/compiler/strong-effects.js
+++ b/packages/octane/src/compiler/strong-effects.js
@@ -373,19 +373,40 @@
node = unwrap(callee.object);
}
if (depth < 8 && node?.type === 'AwaitExpression') return sourceOf(node.argument, depth + 1);
+ if (depth < 8 && node?.type === 'SequenceExpression')
+ return sourceOf(node.expressions?.at(-1), depth + 1);
if (node?.type === 'Identifier' && depth < 8) {
const init = stableInitOf(node);
if (init !== null) return sourceOf(init, depth + 1);
}
+ if (node?.type === 'ConditionalExpression' || node?.type === 'LogicalExpression') return node;
return node?.type === 'CallExpression' || node?.type === 'NewExpression' ? node : null;
}
+ // Intersect two controller sets: keeps only controllers present in both.
+ function intersectControllers(left, right) {
+ if (left === null || right === null) return null;
+ let controllers = null;
+ for (const c of left) if (right.has(c)) (controllers ??= new Set()).add(c);
+ return controllers;
+ }
+
// Controllers whose abort rejects the promise a continuation follows: the
// request's own signal, or the signal of the request whose result it reads,
// as in `(await fetch(url, { signal })).json()`.
function requestControllers(expression, depth = 0) {
const source = depth > 8 ? null : sourceOf(expression);
if (source === null) return null;
+ if (source.type === 'ConditionalExpression')
+ return intersectControllers(
+ requestControllers(source.consequent, depth),
+ requestControllers(source.alternate, depth),
+ );
+ if (source.type === 'LogicalExpression')
+ return intersectControllers(
+ requestControllers(source.left, depth),
+ requestControllers(source.right, depth),
+ );
let controllers = signalsIn(source.arguments, null);
const callee = unwrap(source.callee);
if (callee?.type === 'MemberExpression') {
diff --git a/packages/octane/tests/compiler/strong-effects.test.ts b/packages/octane/tests/compiler/strong-effects.test.ts
--- a/packages/octane/tests/compiler/strong-effects.test.ts
+++ b/packages/octane/tests/compiler/strong-effects.test.ts
@@ -257,6 +257,15 @@
],
['a while test', `while (await fetch('/a', { signal })) { setData(1); }`],
['a for test', `for (; await fetch('/a', { signal }); ) { setData(1); }`],
+ [
+ 'a ternary request',
+ `const r = await (props.fast ? fetch('/a', { signal }) : fetch('/b', { signal })); setData(r);`,
+ ],
+ ['a sequence expression request', `const r = await (0, fetch('/a', { signal })); setData(r);`],
+ [
+ 'a logical-or request',
+ `const r = await (fetch('/a', { signal }) || fetch('/b', { signal })); setData(r);`,
+ ],
])('accepts an abort proof that covers %s', (_label, body) => {
accepts(app(aborted(body)));
});You can send follow-ups to the cloud agent here.
… Strong abort proofs
Review findings on the Strong abort-proof flow:
- When a catch handler always exits, the code after the try keeps the try
block's proof, but the finally block also runs after the handler (or a
throw part way through either), so it now starts from the joined flow.
Code after the finally keeps the normal-completion proof unless finally
yields.
- Awaiting or chaining a conditional, sequence, or logical request, such as
`await (fast ? fetch(a, { signal }) : fetch(b, { signal }))`, now keeps
the controllers every possible request carries.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ct-hidden-dependencies
…ct-hidden-dependencies
Resolve conflicts with the Strong state checks (#1497): keep both the effect and state policies, visit non-zero-delay synchronous callbacks in the event phase, and render the state in effect fixtures so they are not write-only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ong-effect-async-cleanup Keep fetch identity for the Strong updater-purity check from #1497, drop the removed fetch-control save in pure callbacks, keep the instance-field ownership toggle with the new event phase, and render the state written by async-effect fixtures. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…trong-effect-hidden-dependencies Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ong stale-update fixture `load().then(() => tick())` updates state after work the effect started, which OCTANE_STRONG_EFFECT_DATA_FETCH requires cleanup to cancel or ignore. Guard it with a cleanup flag so the fixture keeps testing only stale-update freshness. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ct-hidden-dependencies
… Strong effects
- A stored same-module hook result keeps its returned array or object, so
`thing[1](x)`, `thing.setValue(x)`, aliases of those members, and a
stored transition start are tracked.
- `const { queueMicrotask } = window` names the global like
`window.queueMicrotask`, so destructured zero-delay APIs are checked.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ct-hidden-dependencies
…ing early - A falsy left operand of `&&` is the awaited value and is never a thenable, so `await (cond && work)` and `Promise.resolve(cond && p)` may resume before paint. - Aliases of a stored hook result, and a stored result passed to a local helper, keep its returned array or object. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…roofs
- A `break` or `continue` nested in a branch now contributes its flow
to the switch or loop it leaves, so an exit after an unsigned request
is no longer hidden by a later signed one.
- A literal test or left operand selects the request whose signal
protects the result, as in `await (null ?? fetch(url, { signal }))`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ct-hidden-dependencies
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Continue skips for-update abort proof
- Separated unlabeled
continueflows into a dedicatedcontinueFlowslist on the jump target and merged them into the current flow before visiting the update (forfor) or test (fordo-while), so those post-body expressions' abort proofs correctly apply to the continue path.
- Separated unlabeled
Or push these changes by commenting:
@cursor push 9d9bb07332
Preview (9d9bb07332)
diff --git a/packages/octane/src/compiler/strong-mode.js b/packages/octane/src/compiler/strong-mode.js
--- a/packages/octane/src/compiler/strong-mode.js
+++ b/packages/octane/src/compiler/strong-mode.js
@@ -3925,7 +3925,7 @@
// Only paths that reach the next statement share its flow.
function enterJumpTarget(loop) {
if (currentEffect === null) return null;
- jumpTargets = { loop, flows: [], next: jumpTargets };
+ jumpTargets = { loop, flows: [], continueFlows: null, next: jumpTargets };
return jumpTargets;
}
@@ -3940,11 +3940,25 @@
: target.flows.reduce(effectPolicy.joinFlow, flow);
}
+ // A `continue` in a `for` still runs the update, and in a `do-while` it
+ // still runs the test. Merge continue flows into the current flow before
+ // visiting that post-body code so its proofs apply to the continue path.
+ function flushContinueFlows(target) {
+ if (target === null || target.continueFlows === null) return;
+ effectPolicy.restoreFlow(
+ target.continueFlows.reduce(effectPolicy.joinFlow, effectPolicy.saveFlow()),
+ );
+ }
+
function recordJump(node) {
if (currentEffect === null) return;
const flow = effectPolicy.saveFlow();
for (let target = jumpTargets; target !== null; target = target.next) {
if (node.type === 'ContinueStatement' && !target.loop) continue;
+ if (node.type === 'ContinueStatement' && node.label == null) {
+ (target.continueFlows ??= []).push(flow);
+ return;
+ }
target.flows.push(flow);
// A labeled jump may leave any enclosing target.
if (node.label == null) return;
@@ -5383,6 +5397,7 @@
}
const forTarget = enterJumpTarget(true);
visit(node.body, loop, executionPhase);
+ flushContinueFlows(forTarget);
visit(node.update, loop, executionPhase);
// The body may not run.
if (before !== undefined) {
@@ -5477,6 +5492,7 @@
} else {
effectPolicy.restoreFlow(effectPolicy.joinFlow(before, effectPolicy.saveFlow()));
}
+ flushContinueFlows(iterationTarget);
effectPolicy.restoreFlow(exitJumpTarget(iterationTarget, effectPolicy.saveFlow()));
}
return;
@@ -5492,6 +5508,7 @@
const whileTarget = enterJumpTarget(true);
visit(node.body, scope, executionPhase);
if (before !== undefined) {
+ flushContinueFlows(whileTarget);
effectPolicy.restoreFlow(
exitJumpTarget(whileTarget, effectPolicy.joinFlow(before, effectPolicy.saveFlow())),
);
@@ -5502,6 +5519,7 @@
if (currentEffect !== null) effectPolicy.enterLoopBody([node.body, node.test]);
const doTarget = enterJumpTarget(true);
visit(node.body, scope, phase);
+ flushContinueFlows(doTarget);
const executionPhase =
currentFunctionIsAsync &&
phase !== 'deferred' &&
diff --git a/packages/octane/tests/compiler/strong-effects.test.ts b/packages/octane/tests/compiler/strong-effects.test.ts
--- a/packages/octane/tests/compiler/strong-effects.test.ts
+++ b/packages/octane/tests/compiler/strong-effects.test.ts
@@ -298,6 +298,10 @@
],
['a for test', `for (; await fetch('/a', { signal }); ) { setData(1); }`],
[
+ 'a do-while test after continue',
+ `await api.warm(); do { if (props.skip) continue; } while (await fetch('/a', { signal })); setData(1);`,
+ ],
+ [
'a switch case that breaks inside a branch after a signed request',
`switch (props.mode) { case 'a': await fetch('/a', { signal }); if (props.fast) break; await fetch('/b', { signal }); break; default: await fetch('/c', { signal }); } setData(1);`,
],You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit dba4555. Configure here.
|
Bugbot Autofix prepared a fix for the issue found in the latest run.
Or push these changes by commenting: Preview (af380a4796)diff --git a/packages/octane/src/compiler/strong-effects.js b/packages/octane/src/compiler/strong-effects.js
--- a/packages/octane/src/compiler/strong-effects.js
+++ b/packages/octane/src/compiler/strong-effects.js
@@ -802,6 +802,9 @@
if (parent.id === child || parent.id?.type === 'ObjectPattern') return;
if (references.declarations.has(parent.id)) return;
break;
+ case 'AssignmentExpression':
+ if (parent.left?.type === 'ObjectPattern') return;
+ break;
case 'LabeledStatement':
case 'BreakStatement':
case 'ContinueStatement':
diff --git a/packages/octane/src/compiler/strong-mode.js b/packages/octane/src/compiler/strong-mode.js
--- a/packages/octane/src/compiler/strong-mode.js
+++ b/packages/octane/src/compiler/strong-mode.js
@@ -5218,6 +5218,20 @@
case 'AssignmentExpression': {
if (node.left?.type === 'ArrayPattern' || node.left?.type === 'ObjectPattern') {
visit(node.right, scope, phase);
+ if (
+ hiddenEffectRead(phase) &&
+ node.left.type === 'ObjectPattern' &&
+ node.left.properties?.some(
+ (property) =>
+ property.type === 'RestElement' ||
+ (property.computed
+ ? staticPrimitiveValue(property.key, scope)
+ : (property.key?.name ?? property.key?.value)) === 'current',
+ ) &&
+ valueRefRead(node.right, scope)
+ ) {
+ effectPolicy.hiddenDependency(unwrap(node.right), 'ref');
+ }
visitPatternExpressions(
node.left,
scope,You can send follow-ups to the cloud agent here. |
`({ current } = ref);` reads the ref like `const { current } = ref`,
so it no longer counts as an escape and is reported in effect setup.
An assignment whose value is used still shares the ref.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A `continue` reaches the loop's update and test rather than leaving the loop, so its flow joins the exit only when the test (or a for update) does not await. A test that always awaits runs again before every normal exit, so the loop exits with that test's flow plus any breaks. Labeled jumps now go to the loop or switch they name. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ct-hidden-dependencies
A labeled `continue outer` or `break outer` skips the switches and loops
between it and its label, so it no longer joins the flow after them. A
labeled block is now a jump target too, so `break done` joins the flow
after `done: { … }`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ct-hidden-dependencies
#1482 landed on main as a squash of the branch this one already contains, so every conflict resolves to this branch's side. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
…dden-dependencies
…resource-leaks Both branches merged main's #1482 squash separately, so the merge had two bases. This branch already contains #1483's changes, so conflicts keep this side; the only new content is main's tiptap fix (#1502). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…dden-dependencies
Benchmark report🟢 No size increases and no timing regressions outside noise. Compares js-framework: 1k/10k row operations (ms, lower is better)All 20 timed operations (20 within noise)
Application bundle size (bytes)No changes across 45 measured values. Public-import reachability bundles (bytes)No changes across 105 measured values. CI job durations
Compares the CI run for
All 26 timed jobs
|
#1484 landed on main as a squash of a branch that contained this one, so main already has these changes; every conflict resolves to main's side. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Closing as superseded: #1484 landed on main as a squash (f151614) of a branch that contained all of this PR's changes, and this branch now has no diff against main. 🤖 Closed by Claude Code |


Summary
Third of four stacked Strong effect PRs (tracking issue #1027). #1481 and #1482 have landed on main (as #1482), so this diff is only this layer. The change for this PR is the top commit, "reject hidden dependencies in Strong effect setup".
Some reads in synchronous effect setup quietly drop an input from dependency inference:
log(getC()), a previous-valuelast.current, or afirst.currentfirst-run guard. The effect then does not re-run when that input changes. Octane never double-invokes effects, sodidInit/isFirstRenderguards buy nothing here.What changed. A new code,
OCTANE_STRONG_EFFECT_HIDDEN_DEPENDENCY, rejects three kinds of read in synchronous effect setup. This follows the boundary the maintainer approved in the task conversation.[2], aliases, local helpers, and getters returned by same-module custom hooks.currentread from a value ref. This includes reads through aliases, destructuring, and local helpers, plus compound+=/++.useRefwhose identity is only used for property access, stable aliases, and explicit dependency lists.ref={r}orref={[r, …]}on any element or component, passing it to a call, component prop, or hook, storing it in a container, returning it, or flowing it through a reassignable alias.letorvar. This coverslet didInit, module counters, and helpers that read one."Synchronous setup" covers the effect body, synchronous same-module helpers, and the zero-delay callbacks from #1481, in
useEffect,useLayoutEffect, anduseInsertionEffect.These stay legal:
.currentwrites; reads in cleanup, in deferred callbacks (events, timers, subscriptions, promise continuations), and inuseEffectEventbodies, which are the single declared non-reactive escape.The message points to the render snapshot or
useEffectEvent, and says Octane never double-invokes effects. The ref classification is one lazy module walk over the shared lexical analysis, and it only runs for modules that read a ref in an effect.Validation
pnpm format:check: repo-wide, run on the complete stack;pnpm format:files:checkon this layer.pnpm typecheck: full run on the complete stack.pnpm typecheck:fileson the changed tests shows only the TS7016 errorsmainalready has.pnpm test: run on the complete stack through the four CI shards. All passed except the knownhmr.test.tsload timeout, which passes in isolation (details in fix(compiler): count zero-delay effect callbacks and custom-hook updaters as Strong effect setup #1481).Octane.useRef, optional and computedcurrent,.tsx, and plain.tshooks.let, and module constants.pnpm syncproduced no changes.Risk / follow-ups
++generationRef.current.read(ref). That is the approved conservative boundary.Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Adds new Strong-mode compile errors across common effect patterns (getters, value refs, module guards); misclassification of refs could false-positive, though boundaries are intentionally conservative and scoped to
"use strong".Overview
Strong mode now reports
OCTANE_STRONG_EFFECT_HIDDEN_DEPENDENCYwhen synchronous effect setup reads inputs that dependency inference cannot track, so effects that would silently stop re-running are caught at compile time.Setup in
useEffect,useLayoutEffect, anduseInsertionEffect(including same-module helpers and zero-delay callbacks from earlier Strong work) is rejected for state getter calls (tuple index, aliases, custom hooks),.currentreads on value refs (with a lazy module walk that treats attached/passed/escaped refs as instance refs), and reads of reassigned modulelet/var. Writes, cleanup, deferred callbacks, anduseEffectEventbodies stay allowed; diagnostics steer authors toward the render snapshot or Effect Events and note that Octane does not double-invoke effects.Docs, changeset, and a large
strong-effectstest suite pin rejections and legal cases (element refs, refs passed to calls/components, dependency lists not attaching refs, etc.).Reviewed by Cursor Bugbot for commit 0b2cbfa. Bugbot is set up for automated code reviews on this repo. Configure here.