Repository navigation
fix(compiler): count zero-delay effect callbacks and custom-hook updaters as Strong effect setup - #1481
fix(compiler): count zero-delay effect callbacks and custom-hook updaters as Strong effect setup#1481trueadm wants to merge 16 commits into
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]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Autofix Details
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Shape merge uses reference equality
- Replaced reference equality (===) in mergeShapes with a shapesEqual helper that structurally compares returned-array elements and returned-object property maps, so two branches returning the same repacked tuple now merge correctly.
- ✅ Fixed: Zero-delay await misses compounds
- Extended zeroDelayPromise to recurse through AwaitExpression, SequenceExpression, ConditionalExpression, and LogicalExpression, checking each leaf with nonPromise || zeroDelayPromise so compound forms that settle before the next paint are correctly recognized.
Or push these changes by commenting:
@cursor push 0c29294ec4
Preview (0c29294ec4)
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
@@ -179,6 +179,22 @@
if (node?.type === 'Identifier') {
return depth < 8 && zeroDelayPromise(stableInitOf(node), depth + 1);
}
+ if (node?.type === 'AwaitExpression')
+ return nonPromise(node.argument) || zeroDelayPromise(node.argument, depth);
+ if (node?.type === 'SequenceExpression')
+ return zeroDelayPromise(node.expressions?.at(-1), depth);
+ if (node?.type === 'ConditionalExpression') {
+ return (
+ (nonPromise(node.consequent) || zeroDelayPromise(node.consequent, depth)) &&
+ (nonPromise(node.alternate) || zeroDelayPromise(node.alternate, depth))
+ );
+ }
+ if (node?.type === 'LogicalExpression') {
+ return (
+ (nonPromise(node.left) || zeroDelayPromise(node.left, depth)) &&
+ (nonPromise(node.right) || zeroDelayPromise(node.right, depth))
+ );
+ }
if (node?.type !== 'CallExpression') return false;
const callee = unwrap(node.callee);
if (callee?.type !== 'MemberExpression' || keyOf(callee.object) !== 'g:Promise') return false;
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
@@ -2739,9 +2739,28 @@
return shapeMember(node, scope);
}
+ function shapesEqual(a, b) {
+ if (a === b) return true;
+ if (a == null || b == null || a.kind !== b.kind) return false;
+ if (a.kind === 'returned-array') {
+ return (
+ a.elements.length === b.elements.length &&
+ a.elements.every((element, index) => element === b.elements[index])
+ );
+ }
+ if (a.kind === 'returned-object') {
+ if (a.properties.size !== b.properties.size) return false;
+ for (const [key, value] of a.properties) {
+ if (b.properties.get(key) !== value) return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
function mergeShapes(shapes) {
const [first] = shapes;
- return first != null && shapes.every((shape) => shape === first) ? first : null;
+ return first != null && shapes.every((shape) => shapesEqual(shape, first)) ? first : null;
}
function bindReturnedShape(pattern, shape, bind) {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]>
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: Logical await misclassified as zero-delay
- Added an explicit AwaitExpression case to settled() that recurses into the argument, so settled(await load()) is false when load() is an opaque promise, preventing await (null ?? await load()) from being misclassified as zero-delay.
Or push these changes by commenting:
@cursor push 145f0b66ec
Preview (145f0b66ec)
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
@@ -204,6 +204,8 @@
function settled(expression, depth = 0) {
const node = unwrap(expression);
switch (node?.type) {
+ case 'AwaitExpression':
+ return settled(node.argument, depth);
case 'SequenceExpression':
return settled(node.expressions?.at(-1), depth);
case 'ConditionalExpression':You can send follow-ups to the cloud agent here.
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]>
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]>
This comment has been minimized.
This comment has been minimized.
…eck every await path - Derive state identity per call for setters, tuples, and returned callbacks, including nested hooks; values passed in keep the caller's identity. Forward nested call shapes and useTransition tuples. - Keep updater purity checks on custom-hook state. - An await ends synchronous setup only when every path waits: a branch that resumes in a microtask, a literal-decided operand, or a bare undefined operand is decided like `if (c) await work;`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`const p = flag ? await load() : pending; await p` waits on every path, like the inline form. A local `const` initialized in the same function keeps the paths of its initializer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This comment has been minimized.
This comment has been minimized.
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: Var initializers credited before they run
- Added a guard in
localInitto return null when the binding's declaration kind isvar, since var hoisting means the initializer may not have executed at the point of reference, unlike const/let which have TDZ guarantees.
- Added a guard in
Or push these changes by commenting:
@cursor push 509f453c3f
Preview (509f453c3f)
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
@@ -276,14 +276,17 @@
return maySettle(argument);
},
// The stable initializer of a binding declared in the function that reads
- // it: that initializer ran earlier on the same path.
+ // it: that initializer ran earlier on the same path. `var` is excluded
+ // because its hoisted binding is `undefined` before the declaration runs.
localInit(expression) {
const node = unwrap(expression);
if (node?.type !== 'Identifier') return null;
const scope = nodeScopes.get(node);
const binding = bindingOf(node);
if (scope === undefined || binding == null || binding.scope == null) return null;
- return functionScopeOf(binding.scope) === functionScopeOf(scope) ? stableInit(binding) : null;
+ if (functionScopeOf(binding.scope) !== functionScopeOf(scope)) return null;
+ if (declarator(binding)?.kind === 'var') return null;
+ return stableInit(binding);
},
// A provably known operand value, as `{ value }`, or null.
literal(expression) {You can send follow-ups to the cloud agent here.
…t awaits A `var` is hoisted and holds undefined until its declaration runs, so only `const` and `let` keep their initializer's paths, and a `var` read above its declaration in the same function may resume before paint. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This comment has been minimized.
This comment has been minimized.
`awaitYields` re-entered through `alwaysAwaits` with a fresh depth, so `const ready = await ready` overflowed the stack. Track the initializers being followed instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…await A `var` declared directly in the function body above the read has run on every path, so `var ready = flag ? await load() : pending; await ready` waits like the `const` form. A `var` declared in a branch still does not count. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…has run An unbraced `if (c) var ready = …` shares the function body scope, so scope and position could not prove it ran. A `var` now counts as initialized only in the rest of the statement list that holds it, the body of a loop whose head declares it, the rest of a `for` that initializes it, or anywhere for a module-level declaration. 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: Export var skipped by region marking
- Added an ExportNamedDeclaration unwrap at the top of the mark() function so that
export vardeclarations at module scope are correctly registered in varRegions and treated as initialized.
- Added an ExportNamedDeclaration unwrap at the top of the mark() function so that
Or push these changes by commenting:
@cursor push 5a10e3d110
Preview (5a10e3d110)
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
@@ -234,6 +234,7 @@
if (varRegions === null) {
varRegions = new Map();
const mark = (declaration, start, end) => {
+ if (declaration?.type === 'ExportNamedDeclaration') declaration = declaration.declaration;
if (declaration?.type !== 'VariableDeclaration' || declaration.kind !== 'var') return;
for (const decl of declaration.declarations ?? []) {
varRegions.set(decl, [start ?? decl.end, end]);You can send follow-ups to the cloud agent here.
…effects `export var` wraps the declaration in ExportNamedDeclaration, so it missed the module-wide region of a bare module `var`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Bugbot Autofix prepared a fix for the issue found in the latest run.
Or push these changes by commenting: Preview (52f91fd46c)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
@@ -53,6 +53,22 @@
export function createStrongEffectPolicy({ ast, analysis, callNames, report }) {
const { nodeScopes, declarators } = analysis;
let declaratorInfo = null;
+ let directBodyVars = null;
+ function isDirectBodyVar(decl) {
+ if (directBodyVars === null) {
+ directBodyVars = new WeakSet();
+ const mark = (statements) => {
+ for (const stmt of statements) {
+ if (stmt.type === 'VariableDeclaration' && stmt.kind === 'var') {
+ for (const d of stmt.declarations ?? []) directBodyVars.add(d);
+ }
+ }
+ };
+ mark(ast.body ?? []);
+ for (const { node } of analysis.functions ?? []) mark(node.body?.body ?? []);
+ }
+ return directBodyVars.has(decl);
+ }
// undefined: not an analyzed reference; null: an unshadowed global.
function bindingOf(identifier) {
const scope = nodeScopes.get(identifier);
@@ -300,10 +316,7 @@
const fn = functionScopeOf(scope);
if (info === null || functionScopeOf(binding.scope) !== fn) return null;
if (info.kind === 'var') {
- // The function body is a block scope directly inside the function scope.
- const declScope = nodeScopes.get(info.decl);
- const direct = declScope === fn || (declScope?.kind === 'block' && declScope.parent === fn);
- if (!direct || node.start < info.decl.end) return null;
+ if (!isDirectBodyVar(info.decl) || node.start < info.decl.end) return null;
} else if (info.kind !== 'const' && info.kind !== 'let') {
return null;
}You can send follow-ups to the cloud agent here. |
Keep the custom-hook return collector and per-call state owners around main's visitSynchronousCall, which runs helpers called from an Effect Event with current values. 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 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Hook setters missed on member bindings
- Added returnedShapeElement helper to resolve member accesses on call shapes and returned-shape bindings, extended bindDeclaration to re-trigger binding for member expressions on calls, removed the identifier exclusion in bindReturnedShape for returned-array/returned-object, and used the helper in callableValue for callee resolution.
- ✅ Fixed: Destructured globals skip zero-delay checks
- Applied the same g:window member flattening in keyOf's declarator path that the MemberExpression path already uses, so destructured globals like
const { queueMicrotask } = windowproduceg:queueMicrotaskinstead ofg:window.queueMicrotaskand are correctly recognized by globalFunction.
- Applied the same g:window member flattening in keyOf's declarator path that the MemberExpression path already uses, so destructured globals like
Or push these changes by commenting:
@cursor push a8f31512a9
Preview (a8f31512a9)
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
@@ -123,7 +123,12 @@
const init = info === null ? null : unwrap(info.decl.init);
if (init?.type === 'Identifier' || init?.type === 'MemberExpression') {
const base = keyOf(init, depth + 1);
- if (base !== null) return info.path.length === 0 ? base : `${base}.${info.path[0]}`;
+ if (base !== null) {
+ if (info.path.length === 0) return base;
+ if (base === 'g:window')
+ return GLOBAL_OBJECTS.has(info.path[0]) ? base : `g:${info.path[0]}`;
+ return `${base}.${info.path[0]}`;
+ }
}
}
return `b${binding.id}`;
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
@@ -2745,8 +2745,11 @@
} else if (prop) bindPropPattern(declaration.id, bind);
}
}
- const shape = initial?.type === 'CallExpression' ? callShapes.get(initial) : undefined;
- if (shape !== undefined && stateTuple === null) {
+ let shape = initial?.type === 'CallExpression' ? callShapes.get(initial) : undefined;
+ if (shape === undefined && stateTuple === null && initial?.type === 'MemberExpression') {
+ shape = returnedShapeElement(initial, scope);
+ }
+ if (shape != null && stateTuple === null) {
bindReturnedShape(declaration.id, shape, scope, bind);
}
}
@@ -2895,11 +2898,37 @@
return null;
}
+ function returnedShapeElement(node, scope) {
+ if (node?.type !== 'MemberExpression') return undefined;
+ const object = unwrap(node.object);
+ const shape =
+ object?.type === 'CallExpression'
+ ? callShapes.get(object)
+ : object?.type === 'Identifier'
+ ? resolve(scope, object.name)
+ : null;
+ if (shape?.kind === 'returned-array') {
+ if (!node.computed) return undefined;
+ const key = staticPrimitiveValue(node.property, scope);
+ const index = typeof key === 'number' ? key : typeof key === 'string' ? Number(key) : NaN;
+ return Number.isInteger(index) && index >= 0 ? shape.elements[index] : undefined;
+ }
+ if (shape?.kind === 'returned-object') {
+ const key = node.computed
+ ? staticPrimitiveValue(node.property, scope)
+ : node.property?.type === 'Identifier'
+ ? node.property.name
+ : null;
+ return typeof key === 'string' ? shape.properties.get(key) : undefined;
+ }
+ return undefined;
+ }
+
function bindReturnedShape(pattern, shape, scope, bind) {
if (shape === TRANSITION_TUPLE_BINDING) {
bindTransitionPattern(pattern, scope, bind);
} else if (pattern?.type === 'Identifier') {
- if (shape.kind !== 'returned-array' && shape.kind !== 'returned-object') bind(pattern, shape);
+ bind(pattern, shape);
} else if (pattern?.type === 'ArrayPattern' && shape.kind === 'returned-array') {
pattern.elements?.forEach((element, index) => {
const value = shape.elements[index];
@@ -3105,7 +3134,11 @@
bindDeclarationValue(declaration, declarationKind, scope);
visit(declaration.init, scope, phase);
// Visiting a local call records what it returned; bind that provenance.
- if (callShapes.has(unwrap(declaration.init))) {
+ const initNode = unwrap(declaration.init);
+ if (
+ callShapes.has(initNode) ||
+ (initNode?.type === 'MemberExpression' && callShapes.has(unwrap(initNode.object)))
+ ) {
bindDeclarationValue(declaration, declarationKind, scope);
}
return visitPatternExpressions(
@@ -3489,6 +3522,8 @@
const setter = stateTupleUpdater(node, scope);
if (setter !== null) return setter;
if (stateTupleGetter(node, scope)) return STATE_GETTER_BINDING;
+ const member = returnedShapeElement(node, scope);
+ if (isCallableValue(member)) return member;
if (node?.type === 'SequenceExpression') {
return callableValue(node.expressions?.[node.expressions.length - 1], scope);
}You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 388bbb7. Configure here.
… 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]>
…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]>
#1482 landed on main as a squash that contains this branch's changes in their latest form, so every conflict resolves to main's side. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Closing as superseded: #1482 landed on main as a squash (1c44df5) that includes all of this PR's changes in their latest form, and this branch now has no diff against main. 🤖 Closed by Claude Code |


Summary
First of four stacked PRs that stop agents from getting around Strong mode's effect rules with trivial rewrites (tracking issue #1027). Each PR is one diagnostic family and targets
mainso CI runs on it; each later branch contains the commits below it. Please merge in order.OCTANE_STRONG_EFFECT_STATE_UPDATE)OCTANE_STRONG_EFFECT_DATA_FETCH)OCTANE_STRONG_EFFECT_HIDDEN_DEPENDENCY)OCTANE_STRONG_EFFECT_RESOURCE_LEAK)What changed here. A synchronous state update in effect setup was an error, but deferring it by zero delay compiled cleanly. Callbacks that run before the next paint now count as effect setup:
startTransition, including import aliases,Octane.startTransition, local aliases, and optional calls;useTransitionstart function, from a tuple pattern, an index, or an alias;queueMicrotask, includingwindow./globalThis.members and aliases;.then/.catch/.finallyon a promise that may already be settled:Promise.reject(), orPromise.resolve(value)of a value that is not a promise on some path;setTimeout(fn)orsetTimeout(fn, delay)whose delay is statically<= 0,NaN, orundefined;awaitthat resumes without waiting on some path, includingawait null,await Promise.resolve(), andawait (flag ? load() : null). Likeif (flag) await load();, the code after an await counts as deferred only when every path waits. Literal andconstoperands, including a bareundefined, decide&&,||,??, and?:.requestAnimationFrame, timers with a positive or unknown delay, and external subscription callbacks stay legal, as specified.Strong also follows what a same-module custom hook returns:
return useState(0), a tuple binding, a repacked[value, setValue]array, a{ value, setValue }object, a returned updater, a toggle callback, a transition start, or auseTransition()tuple. This works through nested and aliased hooks, in.tsrx,.tsx, and plain.ts. Each call gets its own derived state identity, including state read by callbacks the hook returns, so two calls of one hook never form a falseOCTANE_STRONG_EFFECT_CHAIN. A value the hook received from its caller keeps the caller's identity. As a consequence, getters and updaters returned by custom hooks are now also caught by the existing render-phase checks.The classification lives in a new
packages/octane/src/compiler/strong-effects.jspolicy module, called from a few hooks instrong-mode.js. That limits conflicts with the parallel Strong work on state purity and render/DOM checks.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. On this layer,pnpm typecheck:fileson the changed tests shows only the TS7016 errorsmainalready has.pnpm test: run on the complete stack through the four CI shards (vitest.ci-sharded.config.js).hmr.test.ts('preserves state and live events … consecutive vite replacements'). That file compiles no Strong code, and it passes 74/74 three times in isolation.pnpm testruns out of memory in the Vitest main process on this machine, which is a known local limit.strong-effects,strong-mode,strong-hook-policy,strong-html, andstrong-template-policypass on this layer (1243 tests). Every reported snippet for this family is rejected, and snippets for later families still compile..tsrx,.tsx, plain.tscustom hooks, and the likely agent rewrites..tsoutput with and without Strong. Editor diagnostics are source-located.pnpm syncproduced no changes.Compiler throughput, complete stack. I timed
analyzeStrongModeon pre-parsed ASTs of 506 repo.tsrx/.tsxmodules that use effects, with HEAD and candidate in interleaved processes on a loaded machine. The Strong analyzer is about 3% slower: best-min 776 ms vs 803 ms, and a median ratio of 1.03 over 6 rounds. The analyzer is a fraction of a full compile, and modules that are not Strong pay nothing because the analyzer returns early.Risk / follow-ups
setTimeout(fn, 0),queueMicrotask,Promise.resolve().then, orawait Promise.resolve()inside an effect as deferred. The yield-matrix fixtures now await an opaque pending load instead.setTimeout(fn, 1)andrequestAnimationFramestill defer by design.for awaitover an array, and.thenchains beyond a settled root, are not treated as zero-delay.await (flag ? Promise.resolve() : props.pending)is rejected; one fixture that kept it legal flipped. This matches howif (flag) await pending;was already treated.Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Changes compile-time Strong diagnostics and intentionally rejects patterns that previously compiled; runtime output is unchanged but existing Strong-enabled code may need fixture/test updates.
Overview
Tightens Strong mode so state updates can’t be smuggled past effect-setup rules with “deferred” scheduling that still runs before paint.
A new
strong-effects.jspolicy module centralizes classification of zero-delay continuations—startTransition/useTransitionstarters (including aliases),queueMicrotask,setTimeoutwith delay≤ 0/undefined/NaN,.then/.catch/.finallyon promises that may already be settled, andawaitpaths that don’t actually wait on every branch—so updates inside them reportOCTANE_STRONG_EFFECT_STATE_UPDATElike a direct synchronous write.requestAnimationFrame, positive/unknown timer delays, and external subscription callbacks stay allowed.The same work threads custom-hook return shapes (tuple/object updaters, repacked state, transition starters, nested/aliased hooks across
.ts/.tsx/.tsrx) into Strong’s state identity so hook-returned updaters are attributed correctly and duplicate hook calls don’t false-triggerOCTANE_STRONG_EFFECT_CHAIN.strong-mode.jsdelegates to the policy via a small hook surface; fixtures and tests are expanded for common agent rewrites.Reviewed by Cursor Bugbot for commit 16bd6c3. Bugbot is set up for automated code reviews on this repo. Configure here.