Skip to content

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

Merged
ryota-murakami merged 13 commits into
mainfrom
codex/cycle-0057-pt3
Oct 27, 2026
Merged

ryota-murakami merged 13 commits into
mainfrom
codex/cycle-0057-pt3

Conversation

@ryota-murakami

@ryota-murakami ryota-murakami commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
{
  "schema_version": 1,
  "pr": 142,
  "head": "edf4a33b40cd30d29226c07a51c430d4dd3a2ab9",
  "version": "0.2.52.0",
  "base": "main",
  "gate": {
    "tests": {
      "pass": 7884,
      "fail": 0,
      "skip": 10
    }
  },
  "session_kind": "interactive",
  "pregate": "warn @be160601f9bb (6 checks, current for edf4a33b40cd)",
  "issues": {
    "fixes": [],
    "refs": [
      139
    ],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "AGENTS.md, CHANGELOG.md, PRODUCT_GOAL.md, README.md, extension/README.md, extension/skills/codebook/SKILL.md and the v9 PNG"
  },
  "review_loop": {
    "passes": 4,
    "blocking_found": 4,
    "deferred": 0,
    "noted": 9,
    "fixed": 3,
    "scope": "frozen"
  }
}

Summary

A learner who asks /codebook how 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 the node-server profile through MCP; the bundled skill did not route to it, so the chat had to find codebook://help/node-server on 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 #139

Blast 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 /ship stopped with converged: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: a gone verdict 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_start promises 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:

  • INFORMATIONAL extension/src/utils/launchNodeServer.ts:274 The close records killed: true before its second identity check, so a close that left a replaced group alone still says it killed.
  • INFORMATIONAL extension/src/utils/shapeResponseBody.ts:97 The … n more bytes count subtracts a cut taken on the redacted text from the original length.
  • INFORMATIONAL extension/src/utils/confirmLaunchedGroup.ts With no launch start time recorded, the folder alone identifies the leader.
  • INFORMATIONAL extension/src/ownedNodeServerRun.ts:758 A pause that arrives after a non-paused stop began its detach (outside the request window) is resumed by the detach and runs until SIGTERM.
  • INFORMATIONAL extension/src/utils/launchNodeServer.ts:272 A retried close runs its identity check after the 5 s kill bound was spent, so SIGKILL can land later than 5 s.
  • INFORMATIONAL extension/src/utils/reapNodeServerOrphans.ts:127 An orphan whose start matches but whose folder changed or could not be read is kept and never signalled, with no age-out.
  • Fixed in 9f6fd621: a folder change alone read as another process (pass 1); codebook_start promised 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 --test runs), report-only:

  • Pass 1: real-process launcher and run loop 11/11; kill-first, identity checks and the real state table 118/118; skill, help, tool titles and dialog text 70/70; plan check AC 2(c) on the pinned clones 4/4 (switch-time health 200 and sign-in 401; nsx health 200, then 503 with the database down).
  • Pass 2 range 22/22; after the pass 2 fixes 147/147; pass 3 range 116/116.
  • Final head edf4a33b: AC 2(c) 4/4 again.
  • VS Code smoke on the final package (Space VS Code 1.142.0, Copilot Chat, GPT-6.1 Terra; skill 1.0.51): a new natural question about a sign-up with a too-short password. The start was accepted on the chat's first declaration under the new title, the dialog named the run and "94 bytes of application/json", the server paused at apps/api/src/auth.ts:69 with the native Variables view, the response was a 500 from 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.ts and 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:static passed 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 on a0481750, 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:

  • README.md: current. The status line matches 0.2.52.0 and PR v0.2.51.0 feat: the chat explains a repository's own Node HTTP server live, paused in its route handler (Cycle 0057 pt2) #141, skill 1.0.51 and the three-PR description of Cycle 0057.
  • extension/README.md: current. It covers the skill's server route, kill-first stop, retried-stop signalling, the dialog's content type and size, separate time-limit messages, the shown body and the NODE_SERVER_SOURCE_REFUSED stop-file cause.
  • CHANGELOG.md: current. The 0.2.52.0 entry was already written and was not mutated.
  • extension/skills/codebook/SKILL.md: current. Version 1.0.51 with the server-run guidance.
  • AGENTS.md, PRODUCT_GOAL.md, docs/agents/*: reviewed as unchanged; no edits.

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 test on the final tree: 7,894 tests, 7,884 pass, 0 fail, 10 skipped
  • Pinned-clone real-process tests (AC 2(c)) on edf4a33b: 4 pass, 0 skipped
  • format:check, typecheck, lint, health:static, dupes, dead-code after each fix: exit 0
  • Package and package check of the final candidate: OK
  • VS Code smoke on the final package: PASS
  • 15-check exact-HEAD gate, required CI and the local CodeRabbit CLI on the final range (reported in a comment before merge)

🤖 Generated with Claude Code

ryota-murakami and others added 11 commits October 28, 2026 04:17
…node-server, with accurate tool text and help (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
…e typeless body; the status names 0.2.52.0 (Issue #139)

Refs #139
Refs #139

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

… 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
@ryota-murakami

Copy link
Copy Markdown
Contributor Author

Results before merge (head 3afe07d7)

Exact-HEAD gate on 3afe07d7 (tree ba924f11): 15/15 exit 0, tree clean before and after.

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

  1. The first gate run on edf4a33b failed two checks. pnpm health scored the launcher's close attempt at CRAP 43.1 after the retried-stop fix; 17fd9794 splits it into named helpers without a behaviour change (the real-process close tests pass). pnpm test had one timing failure in llmWikiView.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.
  2. 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; 3afe07d7 restores 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_action says a GET changes nothing (its handler may still change data), and its protocol test pins that sentence.
  • A sanitize exception 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 bytes count mixes the original and the redacted lengths, and its test pins the mixed value.
  • The close records killed: true before its second identity check.
  • A continue while stopping with a held learner pause answers LEARNER_PAUSED, not STALE_PAUSE.
  • The help says REQUEST_TIMEOUT counts 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

@ryota-murakami
ryota-murakami merged commit 333c781 into main Oct 27, 2026
25 checks passed
@ryota-murakami
ryota-murakami deleted the codex/cycle-0057-pt3 branch October 27, 2026 21:46
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