Repository navigation
v0.2.52.0 feat: /codebook sends server and API questions to the live server run, and a stop never signals a process it cannot confirm (Cycle 0057 pt3) - #142
Conversation
…node-server, with accurate tool text and help (Issue #139)
… orphan-sweep fixes (Issue #139)
…nds by 5 s, retried stops confirm the group, each request limit names itself (Issue #139)
# Conflicts: # extension/README.md # extension/src/tests/ownedNodeServerRun.test.ts
# Conflicts: # extension/README.md
…s the run, content type and body size, never the body (integration of tasks 22 and 13, Issue #139)
…ing review) - confirmLaunchedGroup: unreadable facts are 'unverifiable' unless the group certainly has no member left (a failed ps/lsof read looks like an absent process), and a process readable at the pid of a leader the launcher saw exit is 'replaced' (Step 11 Codex adversarial C1; Claude adversarial #3). - The run tells its close that a stop is a retry, so a close that runs for the first time after a failed SIGKILL still confirms the group before each signal (Codex adversarial C2). - isGroupCertainlyGone: the one "a failing probe is not gone" check, now shared by the run, the launcher's identity check and the orphan sweep. - Packaged README: what a retried stop signals. - Tests: red first (4 failed before the fix); the coverage audit's dialog test; gstack-timing-ok notes on the real-fixture kill-bound assertions. Refs #139
… ended, body text kept /ship stopped at its frozen cap (pass 4 with a blocking finding); under the owner's ship review limit every last-round finding is fixed here: - confirmLaunchedGroup: a group with no member left is 'gone', which neither the run nor the close signals, so an id taken after the check is never hit (Codex adversarial round 2, High; Claude adversarial round 2 #2). - After the launcher saw the leader exit, a group that still has members while no process has the leader's id is the leader's survivors and is ended by a retried stop (pass 3 red team); a readable process there is another one. - A matching start time identifies the leader whatever its folder now, and a folder change alone proves nothing (Codex structured S1). - The run records the launch folder at the spawn, so a stop admitted before the leader's start was read can still be retried (Claude round 2 #1). - The response body hides only private roots (hidePrivateRoots); spacing, lines and a leading error name stay as the server sent them (S3). - codebook_start promises no request only for a node-server start and its title no longer does (S2). - Packaged README: retried stops, the two request time limits, the shown body, the tool titles. Refs #139
Refs #139 Co-Authored-By: Claude <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
… signals in named helpers (pnpm health: CRAP of the close attempt) No behavior change: resolveCloseOptions fills the clock, bounds, signal and probe; endGroupBySignals sends SIGTERM, then SIGKILL by the kill bound, each after the identity check. The close attempt fell to the health limits (it scored cyclomatic 12, CRAP 43.1 after the retried-stop fix). Refs #139
…run (local CodeRabbit CLI) Skill 1.0.51 narrowed the presentation rule to browser requests while it meant to exclude server runs only; a test run opens the Study presentation before its first input again. Red first. The root README names Cycle 0057 as the active cycle. Refs #139
Results before merge (head
|
| Check | Result |
|---|---|
format:check, typecheck, lint, health:static, dupes, dead-code |
exit 0 |
pnpm test |
7,895 tests: 7,885 pass, 0 fail, 10 skipped |
| Reader DOM (five checks) | all cases pass |
pnpm test:package |
1,081 tests: 1,071 pass, 0 fail, 10 skipped |
pnpm health |
exit 0 (score 86 A) |
| Context-restore test | pass |
| Required CI | 23 pass, 2 skipped (hosted CodeRabbit off by the owner's rule; the main-only split-files job) |
Pinned-clone real-process tests (AC 2(c)) on 3afe07d7 |
4/4 pass |
Found after /ship and fixed before merge
- The first gate run on
edf4a33bfailed two checks.pnpm healthscored the launcher's close attempt at CRAP 43.1 after the retried-stop fix;17fd9794splits it into named helpers without a behaviour change (the real-process close tests pass).pnpm testhad one timing failure inllmWikiView.test.js("the message changes only when the tree reads the new rows…"), the flake carried from N57 (O-4); it passed in the second gate run and in CI. - The local CodeRabbit CLI (round 1,
origin/main..edf4a33b) found that skill 1.0.51 narrowed the Study-presentation rule to browser requests, so a test run would no longer open the Study presentation;3afe07d7restores it for test runs (red first) and the root README now names Cycle 0057 as the active cycle.
Local CodeRabbit CLI on the final range (origin/main..3afe07d7, round 2, completed): 12 findings, none critical. With the round 1 findings that remain, they are carried to the next bug-fix cycle under the feature-cycle rule:
codebook_actionsays a GET changes nothing (its handler may still change data), and its protocol test pins that sentence.- A
sanitizeexception in the request sender would leave the response unsettled. - With no start time readable at launch or now, a matching folder reads unverifiable.
- The
… n more bytescount mixes the original and the redacted lengths, and its test pins the mixed value. - The close records
killed: truebefore its second identity check. - A continue while stopping with a held learner pause answers
LEARNER_PAUSED, notSTALE_PAUSE. - The help says
REQUEST_TIMEOUTcounts running time only, while a 15-minute wall-time limit exists; the README and the 0.2.52.0 entry name that 15-minute limit, which the run's 10-minute deadline reaches first. - Test hygiene: the launcher test's SIGTERM upper bound, fixture cleanup on a failed start, the journal-bounds test's computed expectation, and two test helpers without an
@example. - No defect (evidence): the README's recovery table already names a stop's file for
NODE_SERVER_SOURCE_REFUSED.
The package: the VS Code smoke ran on edf4a33b's package. The final source differs from it by the close refactor (no behaviour change, covered by the real-process tests) and the skill sentence for test runs (no change to the server route the smoke exercised).
Review loop: converged:false under the ship review limit; no Critical or Major defect from the /ship rounds stays open, so no Issue records one.
Refs #139
Summary
A learner who asks
/codebookhow the repository's API handles a request now gets the real server started, one declared request sent and the handler paused in its TypeScript source, without the chat opening the Study workspace or reading the server's.env. Pull request two offered thenode-serverprofile through MCP; the bundled skill did not route to it, so the chat had to findcodebook://help/node-serveron its own. Skill 1.0.51 routes server and API questions there, says that the application's own clocks keep running during a pause, and stops after two starts that fail with the same code.Stopping is safer. A server paused in the debugger when you stop it is ended before the debugger lets go, so the paused code does not run on, and SIGKILL lands within 5 s of the stop's start. A retried stop now signals only a process group it can confirm. A group that already ended gets nothing, a reused process id gets nothing, a server that changed its working folder is still recognised by its start time, and the processes a server started that outlive it are ended. The confirmation dialog names the body's size and content type, the two request time limits have their own messages, and the response body reaches the chat as the server sent it, with only credentials and private folders hidden.
Native trial N57 passed in VS Code (Copilot Chat, GPT-6.1 Terra) and Cursor (Agent, Grok 4.6 High) on a pinned clone of
laststance/switch-time, and a VS Code smoke ran on this pull request's final package. This is the third and last pull request of Cycle 0057. Refs #139Blast radius
The change touches the node-server run's stop path, the launcher's close, the orphan sweep at activation, the response shaping, the MCP tool text of
codebook_start(shared by every profile) and the bundled skill. Browser and test runs only see the start tool's new title and description; their behaviour is unchanged, and the full suite (7,894 tests) passed on the final tree, real-process tests included (script ran).Test Coverage
Coverage 24 of 24 traced paths tested (100%). Covered: the launcher's close budget, kill bound and retried close (
launchNodeServer.test.ts); the group identity verdicts (confirmLaunchedGroup.test.ts); D14 v3 kill-first, retried-stop checks, the real run against the state × call table, the wall-time and running-time messages, the response sanitizer (ownedNodeServerRun.test.ts,nodeServerStateTableRealRun.test.ts); the orphan sweep (nodeServerOrphans.test.ts); the journal's early return (nodeServerJournalBounds.test.ts); the UTF-8 note and the pre-cut sanitizing (shapeResponseBody.test.ts); the dialog's size, content type, typeless body and 256-character bound (askToSendStateChangingRequest.test.ts); the tool titles (nodeServerProtocol.test.ts); the help sentences; the skill 1.0.51 route (bundledSkillServerRuns.test.ts).Coverage: 100% value-weighted (100% including 0 weakly covered paths)
Test value: 0 tests written, 2 rejected by the authoring gate, 1 existing test extended, 0 paths weakly covered (weak = ★, gate-failing or unrated).
The review fixes after the audit added red-first tests: 4 for the first review round (they failed before the fix) and 9 for the last round (they failed before the fix).
Tests ran: tests count unavailable
Pre-Landing Review
Pass 1 (full diff, core checklist, testing, maintainability, security, performance, simplification, state machines, red team): 4 informational findings, answered Skip under the feature-cycle rule and carried. Step 11 (Claude adversarial, Codex adversarial, Codex structured): Codex found that a retried stop could signal a process group that reused the id (C1, C2); both were taken as critical and fixed in pass 2 with red-first tests. Pass 3 converged with one note. Step 11's second round found that a group found gone was still treated as permission to signal (Codex adversarial, High; Claude adversarial agreed); pass 4 reached the frozen review cap with that blocking finding, so
/shipstopped withconverged:false.Under the owner's ship review limit, every finding of the last round (pass 3 and Step 11's second round) is fixed in
9f6fd621, Minor included: agoneverdict that is never signalled; the survivors of a leader that exited are ended when no process holds its id; the launch folder is recorded at the spawn; a matching start time decides and a folder change alone proves nothing;codebook_startpromises no request only for a node-server start; the response body hides only private roots. No Critical or Major defect stays open, so no Issue records one. These fixes were verified by their red-first tests, the full suite, the pinned-clone real-process tests and a VS Code smoke on the final package; no fourth review round ran.REVIEW_LOOP: passes=4 blocking_found=4 deferred=0 noted=9 fixed=3 scope=frozen
Gate edits: none detected (41 listed, 12 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: Codex adversarial completed (round 1: 2 High and 1 Medium among 4 findings; round 2: 1 High); Codex structured completed with P2 findings only in both rounds (gate PASS).
Review notes
Recorded below the blocking floor in passes 1 to 3 and carried to the next bug-fix cycle unless marked fixed:
extension/src/utils/launchNodeServer.ts:274The close recordskilled: truebefore its second identity check, so a close that left a replaced group alone still says it killed.extension/src/utils/shapeResponseBody.ts:97The… n more bytescount subtracts a cut taken on the redacted text from the original length.extension/src/utils/confirmLaunchedGroup.tsWith no launch start time recorded, the folder alone identifies the leader.extension/src/ownedNodeServerRun.ts:758A pause that arrives after a non-paused stop began its detach (outside the request window) is resumed by the detach and runs until SIGTERM.extension/src/utils/launchNodeServer.ts:272A retried close runs its identity check after the 5 s kill bound was spent, so SIGKILL can land later than 5 s.extension/src/utils/reapNodeServerOrphans.ts:127An orphan whose start matches but whose folder changed or could not be read is kept and never signalled, with no age-out.9f6fd621: a folder change alone read as another process (pass 1);codebook_startpromised no request for every profile (pass 2); a retried stop of a leaderless group with surviving members failed on every retry (pass 3).Exploratory QA
Functional surface (repository-native
node --testruns), report-only:edf4a33b: AC 2(c) 4/4 again.apps/api/src/auth.ts:69with the native Variables view, the response was a500from the application's own request deadline during the pause (the chat said the normal answer was not observed and sent nothing more), and the stop freed the port. PASS. Stills are private.Not run: Express (P07) native trial; Cursor smoke on the final package (N57 ran in Cursor on
a0481750).Design Review
No frontend files changed — design review skipped.
Eval Results
The bundled skill changed; the project has no eval suite. Its route is covered by
bundledSkillServerRuns.test.tsand by the native trial N57 and the smoke above.Greptile Review
Not configured for this repository (Step 10 skipped).
Scope Drift
Scope Check: CLEAN
Plan Completion
Plan: Issue #139, pt3 scope (tasks 13 to 35, the pt3 part of task 14, task 15): 23 items, 22 done, 1 partial (task 14, the CHANGELOG entry and root README status, completed in this pull request), 0 not done.
Issues
Refs #139
Verification Results
Step 8.1 obligations: the 15-check exact-HEAD gate, required CI and the local CodeRabbit CLI on the final range run after this pull request opens and are reported in a comment; AC 10
health:staticpassed on every fix; AC 2(b) real-process fixture tests and AC 2(c) pinned clones PASS on the final head; AC 6 skill 1.0.51 tests PASS; AC 7 N57 PASS in both editors ona0481750, with a VS Code smoke on the final package.TODOS
No TODO items completed in this PR.
Documentation
Status: current. The audit made no edits and found no blockers.
Scope: base 6ce0908 to HEAD 9f6fd62 plus unstaged working-tree changes (CHANGELOG.md, README.md, VERSION, extension/README.md, package.json, package.test.mjs, constants.ts). Other tracked docs were inventoried (AGENTS.md, PRODUCT_GOAL.md, docs/agents/*, SKILL.md, test fixtures). AGENTS.md and PRODUCT_GOAL.md were not edited.
Documentation health:
NODE_SERVER_SOURCE_REFUSEDstop-file cause.Coverage debt: no critical gaps. The README states a node-server start sends no request but does not repeat the CHANGELOG's contrast with browser and test starts in the tool description (minor, optional). Tutorial and explanation coverage was not assessed. No diagram drift (no diagrams in the changed docs).
Test plan
cd extension && corepack pnpm teston the final tree: 7,894 tests, 7,884 pass, 0 fail, 10 skippededf4a33b: 4 pass, 0 skippedformat:check,typecheck,lint,health:static,dupes,dead-codeafter each fix: exit 0🤖 Generated with Claude Code