Skip to content

feat(compiler): reject hidden dependencies in Strong effect setup - #1483

Closed
trueadm wants to merge 69 commits into
mainfrom
feat/strong-effect-hidden-dependencies
Closed

trueadm wants to merge 69 commits into
mainfrom
feat/strong-effect-hidden-dependencies

Conversation

@trueadm

@trueadm trueadm commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

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-value last.current, or a first.current first-run guard. The effect then does not re-run when that input changes. Octane never double-invokes effects, so didInit/isFirstRender guards 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.

  • A state getter call. This includes the tuple index [2], aliases, local helpers, and getters returned by same-module custom hooks.
  • A current read from a value ref. This includes reads through aliases, destructuring, and local helpers, plus compound +=/++.
    • A value ref is a useRef whose identity is only used for property access, stable aliases, and explicit dependency lists.
    • Any other use makes it an instance ref that setup may read: ref={r} or ref={[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.
  • A reassigned module-scope let or var. This covers let 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, and useInsertionEffect.

These stay legal: .current writes; reads in cleanup, in deferred callbacks (events, timers, subscriptions, promise continuations), and in useEffectEvent bodies, 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:check on this layer.
  • pnpm typecheck: full run on the complete stack. pnpm typecheck:files on the changed tests shows only the TS7016 errors main already has.
  • pnpm test: run on the complete stack through the four CI shards. All passed except the known hmr.test.ts load timeout, which passes in isolation (details in fix(compiler): count zero-delay effect callbacks and custom-hook updaters as Strong effect setup #1481).
  • targeted tests: the five Strong suites pass on this layer (1322 tests).
    • The item-4 snippets are rejected.
    • Fixtures cover getter, ref, and module forms, namespace Octane.useRef, optional and computed current, .tsx, and plain .ts hooks.
    • Legal cases are pinned too: element refs (including array refs and refs attached through a reassignable alias), refs passed to components and calls, container refs, cleanup, subscriptions, Effect Events, unreassigned module let, and module constants.
    • A dependency-list reference does not exempt a ref.
  • pnpm sync produced no changes.

Risk / follow-ups

  • Intended fixture flips:
    • Existing "getters/module reads legal in effects" fixtures now read inside Effect Events.
    • Two dependency-hint fixtures with an unattached ref now attach it.
  • Consequences in repo code that is not Strong today (152 hits, spot-checked; no attached ref was misclassified):
    • timer refs cleared in setup, which belongs in cleanup;
    • instance refs shared between effects, such as a Monaco editor ref;
    • ++generationRef.current.
  • Passing a ref to any call exempts it, including a same-module helper such as read(ref). That is the approved conservative boundary.

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. 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_DEPENDENCY when 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, and useInsertionEffect (including same-module helpers and zero-delay callbacks from earlier Strong work) is rejected for state getter calls (tuple index, aliases, custom hooks), .current reads on value refs (with a lazy module walk that treats attached/passed/escaped refs as instance refs), and reads of reassigned module let/var. Writes, cleanup, deferred callbacks, and useEffectEvent bodies 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-effects test 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.

trueadm and others added 3 commits October 1, 2026 00:50
…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]>
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent feat PR: new feature or capability labels Sep 30, 2026
@github-actions
github-actions Bot marked this pull request as draft September 30, 2026 23:55

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Create PR

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.

trueadm and others added 10 commits October 1, 2026 09:33
…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]>
… 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]>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Create PR

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.

trueadm and others added 5 commits October 1, 2026 10:24
… 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]>
@trueadm
trueadm marked this pull request as ready for review October 1, 2026 09:27
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]>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

trueadm and others added 2 commits October 1, 2026 10:38
…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]>
trueadm and others added 8 commits October 1, 2026 13:12
…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]>
… 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]>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

trueadm and others added 2 commits October 1, 2026 13:33
…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]>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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).

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Continue skips for-update abort proof
    • Separated unlabeled continue flows into a dedicated continueFlows list on the jump target and merged them into the current flow before visiting the update (for for) or test (for do-while), so those post-body expressions' abort proofs correctly apply to the continue path.

Create PR

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.

@cursor

cursor Bot commented Oct 1, 2026

Copy link
Copy Markdown

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Assignment destructure misses value refs
    • Added an AssignmentExpression case to classify() in strong-effects.js so ObjectPattern left-side destructuring does not mark the ref as escaped, and added the matching hiddenDependency check in the AssignmentExpression visitor in strong-mode.js to mirror bindDeclaration's existing VariableDeclarator logic.

Create PR

Or push these changes by commenting:

@cursor push af380a4796
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.

trueadm and others added 6 commits October 1, 2026 18:12
`({ 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]>
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]>
#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]>
@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
octane-website Skipped Skipped Oct 1, 2026 6:19pm UTC
octane-website-mcp Skipped Skipped Oct 1, 2026 6:19pm UTC

Request Review

@vercel
vercel Bot temporarily deployed to Preview – octane-website October 1, 2026 18:19 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp October 1, 2026 18:19 Inactive
trueadm added a commit that referenced this pull request Oct 1, 2026
…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]>
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

🟢 No size increases and no timing regressions outside noise.

Compares 196cb6570 with 73d9eed27 on the same runner. Timing verdicts require a change beyond the combined margin of error (at least 5%) and one 0.1ms timer tick, with the fastest sample moving the same way. Workflow run

js-framework: 1k/10k row operations (ms, lower is better)

All 20 timed operations (20 within noise)
target operation base head Δ noise
octane-tsrx run 5.11 5.99 +17.2% ±35% ⚪ within noise
octane-tsrx replace 11.48 13.92 +21.3% ±31% ⚪ within noise
octane-tsrx add 4.50 5.72 +27.1% ±32% ⚪ within noise
octane-tsrx update 0.95 1.05 +10.5% ±68% ⚪ within noise
octane-tsrx select 0.36 0.32 −11.1% ±70% ⚪ within noise
octane-tsrx swap 0.82 0.73 −11.0% ±59% ⚪ within noise
octane-tsrx remove 0.82 0.81 −1.2% ±77% ⚪ within noise
octane-tsrx runlots 39.03 51.34 +31.5% ±33% ⚪ within noise
octane-tsrx select_lots 0.35 0.42 +20.0% ±37% ⚪ within noise
octane-tsrx clear 71.50 59.28 −17.1% ±43% ⚪ within noise
octane-jsx run 6.43 5.50 −14.5% ±42% ⚪ within noise
octane-jsx replace 18.35 12.43 −32.3% ±48% ⚪ within noise
octane-jsx add 6.88 5.25 −23.7% ±35% ⚪ within noise
octane-jsx update 1.26 1.46 +15.9% ±80% ⚪ within noise
octane-jsx select 0.85 0.77 −9.4% ±60% ⚪ within noise
octane-jsx swap 1.70 1.22 −28.2% ±57% ⚪ within noise
octane-jsx remove 1.83 1.30 −29.0% ±88% ⚪ within noise
octane-jsx runlots 55.72 47.30 −15.1% ±35% ⚪ within noise
octane-jsx select_lots 6.47 4.78 −26.1% ±67% ⚪ within noise
octane-jsx clear 93.31 66.57 −28.7% ±61% ⚪ 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

  • 🟡 5 job(s) slower than every recent main run: heavy integration (package builds, eval corpus, runtime loaders, Astro), React parity shard (1/4), example apps (1/3), website integration suite, validate publishable packages

Compares the CI run for a099b7be0 (run) with the last 5 successful main push runs. A job is only slower or faster outside the whole main range, by at least 10% and 15s.

job main median main range this PR Δ
wall clock (first job start to last job end) 17m 05s 12m 35s–23m 15s 34m 24s +17m 19s (+101%) 🟡 slower
total job time 184m 21s 144m 08s–242m 49s 248m 58s +64m 37s (+35%) 🟡 slower
heavy integration (package builds, eval corpus, runtime loaders, Astro) 5m 28s 4m 36s–16m 52s 33m 39s +28m 11s (+516%) 🟡 slower
React parity shard (1/4) 14m 25s 10m 05s–18m 11s 25m 43s +11m 18s (+78%) 🟡 slower
example apps (1/3) 3m 36s 3m 07s–9m 27s 10m 03s +6m 27s (+179%) 🟡 slower
website integration suite 7m 24s 5m 45s–11m 41s 12m 12s +4m 48s (+65%) 🟡 slower
validate publishable packages 4m 32s 3m 45s–5m 20s 6m 26s +1m 54s (+42%) 🟡 slower
All 26 timed jobs
job main median main range this PR Δ
heavy integration (package builds, eval corpus, runtime loaders, Astro) 5m 28s 4m 36s–16m 52s 33m 39s +28m 11s (+516%) 🟡 slower
React parity shard (1/4) 14m 25s 10m 05s–18m 11s 25m 43s +11m 18s (+78%) 🟡 slower
example apps (1/3) 3m 36s 3m 07s–9m 27s 10m 03s +6m 27s (+179%) 🟡 slower
example apps (2/3) 4m 15s 3m 26s–9m 58s 9m 47s +5m 32s (+130%) ⚪ within noise
website integration suite 7m 24s 5m 45s–11m 41s 12m 12s +4m 48s (+65%) 🟡 slower
heavy integration (browser - chromium) 12m 52s 11m 12s–19m 08s 17m 22s +4m 30s (+35%) ⚪ within noise
React parity shard (4/4) 13m 38s 11m 39s–22m 17s 17m 21s +3m 43s (+27%) ⚪ within noise
React parity shard (3/4) 13m 10s 10m 59s–18m 01s 16m 49s +3m 39s (+28%) ⚪ within noise
React parity shard (2/4) 10m 50s 9m 32s–19m 40s 13m 28s +2m 38s (+24%) ⚪ within noise
lint checks 8m 49s 7m 43s–12m 27s 11m 02s +2m 13s (+25%) ⚪ within noise
validate publishable packages 4m 32s 3m 45s–5m 20s 6m 26s +1m 54s (+42%) 🟡 slower
typecheck checks 9m 23s 7m 20s–11m 01s 10m 52s +1m 29s (+16%) ⚪ within noise
test shard (Node 24, 3/4) 11m 56s 9m 44s–15m 12s 12m 42s +46s (+6%) ⚪ within noise
Three compatibility 3m 28s 2m 51s–4m 23s 4m 04s +36s (+17%) ⚪ within noise
example apps (3/3) 3m 49s 3m 34s–5m 33s 4m 21s +32s (+14%) ⚪ within noise
Lynx compatibility 2m 00s 1m 34s–2m 55s 2m 30s +30s (+25%) ⚪ within noise
test shard (Node 24, 4/4) 12m 54s 10m 24s–16m 16s 13m 20s +26s (+3%) ⚪ within noise
test shard (Node 24, 2/4) 13m 32s 10m 24s–15m 53s 13m 47s +15s (+2%) ⚪ within noise
classify changeset release 16s 14s–21s 17s +1s (+6%) ⚪ within noise
examples 4s 4s–4s 5s +1s (+25%) ⚪ within noise
CI provenance 4s 3s–4s 5s +1s (+25%) ⚪ within noise
typecheck 4s 3s–4s 4s ±0s (±0%) ⚪ within noise
lint 4s 4s–5s 4s ±0s (±0%) ⚪ within noise
React parity checks 15s 14s–16s 15s ±0s (±0%) ⚪ within noise
test (24) 4s 3s–5s 4s ±0s (±0%) ⚪ within noise
test shard (Node 24, 1/4) 14m 01s 11m 10s–17m 32s 12m 36s −1m 25s (−10%) ⚪ within noise

#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]>
@trueadm

trueadm commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

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

@trueadm trueadm closed this Oct 1, 2026
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 feat PR: new feature or capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant