Skip to content

docs(agents): the seat report names a process, not the build it is running (TASK-174) - #1977

Merged
lilyshen0722 merged 1 commit into
mainfrom
kai/daemon-seat-build-visibility
Sep 28, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
kai/daemon-seat-build-visibility

Conversation

@lilyshen0722

@lilyshen0722 lilyshen0722 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Docs only: one file, docs/agents/daemon-seat-state-surfaces.md, +90 lines, no code, no version bump (the version guard diffs cli/src). Cut from main 1c883e46.

The gap this fills. Vera's live witness on TASK-174 (row note, 14:09Z) found the fix correct and the ship not reaching most seats: 13 of 15 commonly agent run supervisors predate the install and still hold the pre-upgrade module, so each still spawns through the shared _npx dir. The surfaces documented here are the ones an operator would read to answer "is this seat on the new build?", and none of them can answer it. That is a property of the surfaces, so it belongs in the surfaces doc.

What the doc now says (Trap 4, plus two lines in Verify and a cross-link):

  • state: running names a process, not a build. None of the ten reported fields carries a version, pid is the supervisor's, and the supervisor's argv is identical before and after an upgrade (/opt/homebrew/bin/commonly symlinks into the installed package) — so argv separates nothing.
  • The two signals that do separate them, both outside the report: the supervisor's start time against the installed file's mtime (cite: review-checklist rule 38, which explains why lsof has nothing to read), and the MCP child's argv shape while the child is alive — npm exec @commonlyai/mcp@latest from ~/.npm/_npx/6d82e98be466b586 is pre-TASK-174, node ~/.commonly/mcp/<version>/… is 0.1.77+.
  • The report's population is the seats this daemon supervises: the state file is rebuilt from the in-memory seats Map (daemon-supervisor.js:62, persisted at :67), so a hand-started supervisor never appears, and daemon restart SIGTERMs only the daemon's own children. The chain, read rather than assumed: commands/daemon.js:402-410 (supervisor.stop() at :406) -> daemon-supervisor.js:458 -> :118 -> kill('SIGTERM') at :126. :436 is the respawn on a changed record (:433), whose comment reads as if it were the restart path.
  • Consequence stated plainly: "install the cli, restart the daemon" reaches the daemon's two seats and no others, so a criterion like "no seat logs CONNECTION_CLOSED across the next publish" is a per-seat question. The version/gitHead field that would close it is named as a gap and deliberately not built — it crosses the deliberate boundary in publicDaemonState.

Reproduced independently before writing, on the host at 14:20Z (the Verify block re-derives each of these): 15 supervisors, 13 with ppid 1, 2 seats in state.json (quill, c4-smoke), install mtime 2026-09-27 07:04:06 -0700 for cli 0.1.79.

The discriminating probe is the one worth quoting, because both arms were live at the same moment — two children npm exec @commonlyai/mcp@latest (an old supervisor) and one node /Users/xcjsam/.commonly/mcp/0.3.13/node_modules/@commonlyai/mcp/src/index.js (a seat on the new path). That is a two-armed instrument rather than an inference from start times, and it is why the doc states the argv shape as a signal rather than a formula.

Disclosed. docs/ prose has no automated witness, so the evidence here is the commands in the new Verify block, run verbatim against the counts quoted. The counts (2/15/13) are a timestamped measurement, and the doc says so rather than implying a standing invariant. The rest of the file's field map still carries its older anchors (ac544d5c / cbc3fe38); the new re-anchor line in the header says which part is measured today and which is not.

Not in this PR. No code change: the seat-version field is a design question (security boundary + heartbeat whitelist), and the restart of the 13 supervisors is operator work, raised in the pod rather than here.


Head moved to 2c55b4d1 — the gate's three corrections (Vera, on f121340e)

The gate attacked the numbers rather than reading them back, and three did not survive. Each was re-measured here before it was written down; the rest of the section was re-derived and is unchanged, including the 2/15/13 counts, the state.json one-liner and the :62/:67 anchors.

  • The interpreter path is a wrong instrument that currently returns the right answer. The old text said a supervisor's argv is identical across an upgrade. The command is; the interpreter is not, on this host — 13 hand-started supervisors print /opt/homebrew/bin/node and the daemon's own two print /opt/homebrew/Cellar/node/26.0.0/bin/node. That difference tracks who launched the seat, not which cli it loaded, and the two partitions coincide today only because the hand-started ones are also the pre-install ones. A seat hand-started after an upgrade breaks the coincidence.
  • The Verify block's own grep over-counted, and this doc is what made it over-count. grep '[c]ommonly agent run' returns 16 here: the sixteenth is a claude -p seat whose prompt quotes the phrase. Anchored to a seat name (grep -E '[c]ommonly agent run [a-z0-9-]+$') it is 15. A doc that teaches an operator to grep a phrase has to assume agents will be quoting that phrase while they do it.
  • :436 was the wrong line. It is the per-seat respawn when a record changes; the restart runs through the service's unload/reload, the daemon's shutdown handler, stop() and stopSeat. Cited now as the full chain, with the reason :126 looks wrong on its own — its log line reads "no longer assigned here — stopping", i.e. de-assignment rather than restart.

…nning (TASK-174)

Trap 4 for docs/agents/daemon-seat-state-surfaces.md: `state: running` is
evidence about a process, never that a seat runs the new code. Measured on the
operator host at 14:20Z — 15 `commonly agent run` supervisors, 13 with ppid 1
started before the 14:04:06Z install, and `state.json` naming 2 seats.

Three of this section's claims are the gate's corrections, measured here before
being written down:

- the interpreter path is a wrong instrument that currently returns the right
  answer: 13 `/opt/homebrew/bin/node` (hand-started, ppid 1) vs 2
  `/opt/homebrew/Cellar/node/26.0.0/bin/node` (the daemon's own), so it tracks
  who launched the seat, not which cli it loaded;
- the Verify block's `grep '[c]ommonly agent run'` over-counts to 16 because an
  agent quoting this doc carries the phrase in its prompt; anchored to a seat
  name it is 15;
- `:436` is the respawn on a changed record, not the restart path. The restart
  runs `commands/daemon.js:402-410` -> `daemon-supervisor.js:458` -> `:118` ->
  `kill('SIGTERM')` at `:126`, whose own log line reads "no longer assigned
  here", which is what makes `:126` look wrong on its own.
@samxu01
samxu01 force-pushed the kai/daemon-seat-build-visibility branch from f121340 to 2c55b4d Compare September 27, 2026 14:41
@lilyshen0722
lilyshen0722 added this pull request to the merge queue Sep 28, 2026
Merged via the queue into main with commit 95cf8d8 Sep 28, 2026
22 checks passed
samxu01 pushed a commit that referenced this pull request Sep 28, 2026
…d, and spell out that test-only is code-touching (rule 32)

Vera's HOLD was that the earned note described the `at`/`ms` divergence as "a
defect neither reviewer could see". It was hers: 75185 carries the measurement
(`at=04:00:00.000Z`, `ms` 31 ms behind it, every consumer taking `.at` while
`formatCursor` falls back to `ms`) and the prescription `ms: mark`. The note now
names all three findings and who earned each, which is what the file's authority
rests on — an earned clause that names an unidentifiable defect teaches a reader
the pattern is decorative.

Rider extended, at her request and one citation short of it: a **test**-only move
counts as code-touching, because the arms are much of what a clearance is about.
She cited #1986 `5c068c37`->`0cfd8c0f` and #1977 `f121340e`->`2c55b4d1`; the
first checks out (two commits inside the guard's own test file), the second is
`docs/agents/daemon-seat-state-surfaces.md` +67-0 then +90-0 — a docs move, which
the rule already calls a re-stamp. Only the verified pair is cited.

Docs prose: no automated witness. `docReferences.test.js` scans code dirs, and no
test reads this file (grep for it finds two comments that mention it, neither an
assertion).
lilyshen0722 added a commit to thantiklermcirony/commonly that referenced this pull request Oct 9, 2026
…r it (rule 32) (Team-Commonly#1991)

* docs(review-checklist): a clearance is spent when the head moves under it (rule 32)

* docs(review-checklist): name the three findings rule 32's rider earned, and spell out that test-only is code-touching (rule 32)

Vera's HOLD was that the earned note described the `at`/`ms` divergence as "a
defect neither reviewer could see". It was hers: 75185 carries the measurement
(`at=04:00:00.000Z`, `ms` 31 ms behind it, every consumer taking `.at` while
`formatCursor` falls back to `ms`) and the prescription `ms: mark`. The note now
names all three findings and who earned each, which is what the file's authority
rests on — an earned clause that names an unidentifiable defect teaches a reader
the pattern is decorative.

Rider extended, at her request and one citation short of it: a **test**-only move
counts as code-touching, because the arms are much of what a clearance is about.
She cited Team-Commonly#1986 `5c068c37`->`0cfd8c0f` and Team-Commonly#1977 `f121340e`->`2c55b4d1`; the
first checks out (two commits inside the guard's own test file), the second is
`docs/agents/daemon-seat-state-surfaces.md` +67-0 then +90-0 — a docs move, which
the rule already calls a re-stamp. Only the verified pair is cited.

Docs prose: no automated witness. `docReferences.test.js` scans code dirs, and no
test reads this file (grep for it finds two comments that mention it, neither an
assertion).

* docs(review-checklist): the mutation label in rule 32's earned note is the author's find, not a reviewer's

Vera's second HOLD on the same sentence, and the mirror of the first: I had
attributed the mislabeled mutation to her. It was mine. Her 75177 asks for the
pair of arms (carry and reset) and says nothing about a label; my own 75186
reports the label defect unprompted, and it surfaced from the ledger's named-arm
check on the author's side. Verified both messages at the source before changing
it, because the previous clause failed for exactly this reason.

The three attributions are now Wren / the author's own ledger / Vera, which is a
better argument for the rider than two of three belonging to one reviewer: a
reviewer, the builder's instrument, and the clearance itself.

* docs(review-checklist): state rule 32's TASK-177 findings once, where the count is (sprint-impl review)

The rider named the same two findings twice and the two counts disagreed: the
first list held "two further findings" and the second, introduced by "all three
folded", added the `at`/`ms` divergence that the first never mentioned. A reader
was told two, then three, then handed a list whose third item was new. The fold
carries one list — Wren's paging defect, the mutation label the author's own
ledger caught, and Vera's `at`/`ms` divergence — and then the count, so "three"
has an antecedent.

`two further findings` also had nothing to be further than, since the paragraph
never says what the clearance's own finding was; it is now `two other findings`.

The rider's length and the burial of the clause a presser needs (a stamp names
the head it was taken against) are noted and left alone: that is a question about
the file's shape, not about this sentence, and moving it would change the text the
existing clearance was taken against.

Found by sprint-impl reading the head, not by any witness in this file: docs
prose has none. `verify-numbered-rules.js` still reports 40 rules, 1..40 with no
gap and 17 citations resolving.
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