Skip to content

review: correct #133's overstated recursion depth, tighten a vacuous assertion - #135

Merged
NagyVikt merged 1 commit into
mainfrom
fix/classifier-review-followups
Aug 7, 2026
Merged

review: correct #133's overstated recursion depth, tighten a vacuous assertion#135
NagyVikt merged 1 commit into
mainfrom
fix/classifier-review-followups

Conversation

@NagyVikt

@NagyVikt NagyVikt commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #133. Comment/test-only — no behavior change.

#133 merged while the /code-review pass on it was still running, so these three
review findings never made it onto main. The functional fix landed correctly; this
carries the corrections.

What this changes

1. Corrects an overstated claim (MEDIUM). #133's description and both source
comments read as though the classifier recursed 10 process levels deep.
MAX_LAUNCH_DEPTH = 3 (launch.ts:1579) already bounds process nesting via the
CUE_LAUNCHING counter, so it never did. The real shape:

  • the 10 repetitions were of the prompt template inside a single 67KB argv
  • the 7 concurrent classifier processes came from several sessions launching at
    once
    , not one 7-deep chain

It is a waste bug, not a runaway. The measured memory (~2.9GB across those 7) is
unchanged — only the mechanism description was wrong. Comments now say so.

2. Documents a known gap (HIGH, deliberately deferred). CUE_BYPASS is
documented in docs/launch.md:207 and docs/shell-install.md:77-82 as "exec the
real binary directly; no resolve, no materialize, no profile"
— and nothing
implements it
. Before #133 the only reader was launch-loader.ts:160 (spinner
suppression); #133 added a second, narrower one. So CUE_BYPASS=1 claude --version
still runs the full pipeline. Implementing the real contract is a behavioral change
that does not belong in a memory fix, so this just records the gap where the next
reader will hit it.

3. Tightens a vacuous assertion (LOW). expect(order).not.toHaveLength(0) could
not fail given the line above it → now toEqual([realBin, "claude"]).

Verification

  • bun run typecheck — clean
  • bun test src/lib/claude-classifier.test.ts src/commands/launch.parse.test.ts — 40/40 pass
  • Cherry-picked onto current main (ca492fb8), auto-merged with no conflicts

🤖 Generated with Claude Code

…ertion

Self-review findings on this PR.

MAX_LAUNCH_DEPTH already bounds the process nesting at 3 via the CUE_LAUNCHING
counter, so the original wording ("10 nested levels") was wrong about the
mechanism: the 10 repetitions were of the prompt template inside a single 67KB
argv, and the 7 concurrent classifier processes came from several sessions
launching at once, not one 7-deep chain. The measured memory is unchanged; the
bug is waste, not runaway recursion. Comments corrected to say so.

Also notes, in the code where it matters, that CUE_BYPASS is documented as a
full bypass ("exec the real binary directly; no resolve, no materialize, no
profile") that nothing implements — this PR's guard is deliberately narrower.
Tracked as a follow-up rather than widened here.

`expect(order).not.toHaveLength(0)` asserted nothing useful; replaced with an
exact `toEqual([realBin, "claude"])`.
@NagyVikt
NagyVikt merged commit cb40661 into main Aug 7, 2026
6 checks passed
@NagyVikt
NagyVikt deleted the fix/classifier-review-followups branch August 7, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant