Skip to content

fix(registry): the install intro is a snapshot, so it has to scope itself (TASK-178) - #1997

Merged
lilyshen0722 merged 1 commit into
mainfrom
kai/attach-intro-snapshot
Sep 29, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
kai/attach-intro-snapshot

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

The defect

composeInstallIntro is posted once, by POST /api/registry/install, for every install — commonly agent attach reaches the registry through the same route, so "the attach template" and "the install intro" are one message and its copy lives server-side (backend/routes/registry/helpers.ts), not in cli/src. Nothing later edits or retracts it, and nothing dates it.

Measured, 2026-09-29 (connector-ops, TASK-178). A seat was attached at 11:15:3xZ; the intro said "Nothing is running me yet, so mentioning me won't reach anyone." Its launchd runner came up, and its first real turn posted at 11:15:52 — the sentence was stale before it scrolled. At ~11:5xZ a peer routed a docs-only PR away from that seat because "she isn't running"; it had been running 53 minutes and had already stamped another PR. The process and the derived state both said otherwise throughout, and the derived state is exactly what the reader could have consulted — deriveAgentState, surfaced in the mention typeahead's subtitle and the direct-room reach banner, the same verdict the roster uses.

The sentence was not wrong when it was written, which is why nothing caught it: never-connected is structurally certain (no token has ever been used), so the flat declarative was a fact at post time. What is wrong is that a chat message cannot be superseded. It is not stale data — stale data degrades with age and an audit can find it. It is a permanent answer that never becomes wrong, so nothing ever corrects it, and it is in the seat's own voice, which is the most authoritative artifact in the pod for a reader that cannot see the process.

The fix

Both arms that assert a state now do the two things this shape requires:

  • scope the claim to its own moment — "As I post this…";
  • name the surface that does change — "type @handle and the pod shows my current state."

Either half alone leaves the trap open: a scoped claim with no pointer still ends the reader's search, and a pointer on an unscoped claim still reads as present tense. The invitation arm is deliberately unchanged — it asserts no state, so a caveat there is noise.

The other legal shape already exists in this codebase, which is why this is a scoping fix rather than a redesign: stalledConnectCopy makes the same kind of claim and keeps a forward commitment ("I'll post here the moment I connect") with a resolution post that supersedes it. A claim with no resolution to close it has to be self-limiting instead.

Evidence

  • Arms: registry.install-intro-honesty.test.js, (1, 9), 0 failed. The new arm asserts both halves on both state-bearing arms and uses the invitation arm as the negative control ("no state asserted ⇒ no caveat added").
  • Mutation ledger /tmp/kai-178-ledger.py: baseline (1, 9) asserted before every run; 8 mutations, 8 killed, NO SURVIVORS, NO NAMED-ARM MISSES, NO NOT-APPLIED. Six target the new scoping and the pointer (removing it from either arm, un-scoping either arm, dropping "never updates", replacing the pointer text); two restore the old flat claims, M07 (never-connected falls through to the invitation) and M08 (the gone-dark arm asserts "Nothing is running me yet" again) — they prove the pre-existing arms still bite after the copy moved, rather than that the new arm is the only thing holding the file up.
  • Regression: all 33 unit/routes/registry* suites green (131 tests). tsc:check clean. ESLint on the changed file: 0 errors, and the same 6 pre-existing warnings as main (verified by linting main's copy through --stdin).
  • AX audit entry 72 records the trap and the reader's half — liveness comes from the process or the derived state, never from a sentence, including one the seat wrote about itself — because the next reader of a one-shot status line needs the rule and not just this sentence.

Backend-only and docs: no version bump, no CLI change.

Disclosed

  • The fix changes what an existing seat's intro says, but not what an already-posted intro says: the sentences already on the record stay as they are. Everything posted after this lands is scoped.
  • I did not touch stalledConnectCopy — its nudge is closed by its own resolution post, which is the mechanism that makes it honest, and its comment already names the gone-dark extension as the case that would need a hedge.

…self (TASK-178)

The intro is posted once, at install, by `POST /api/registry/install` — the same
composer serves `commonly agent attach` and the registry's `install`, which is
why the sentence has no copy in `cli/src` at all. Nothing later edits it or
retracts it, so every state-bearing arm is a snapshot that a reader will take
for present tense.

Measured 2026-09-29 (connector-ops, TASK-178). A seat was attached at 11:15:3xZ
and its intro said "Nothing is running me yet, so mentioning me won't reach
anyone." Its launchd runner came up, and its first real turn posted at
11:15:52 — the sentence was already stale before it had scrolled. Forty minutes
later a peer routed a docs-only PR away from that seat because "she isn't
running"; it had been running for 53 minutes and had already stamped another
PR. The process and the derived state both said otherwise the whole time, and
the derived state is exactly what the reader could have consulted: the mention
typeahead's subtitle and the direct-room reach banner come from
`deriveAgentState`, the same verdict the roster uses.

The sentence was not wrong when it was written, which is why nothing caught it:
`never-connected` is structurally certain (no token has ever been used), so the
flat declarative was a fact at post time. What is wrong is that a chat message
cannot be superseded. Nothing dates it, so a claim that was true for under a
minute reads as current forever — not stale data, which an audit can find, but
a permanent answer that never becomes wrong and so is never corrected.

Both arms that assert a state now do the two things the shape requires: they
scope the claim to their own moment ("As I post this…"), and they name the
surface that does change (type @handle and the pod shows the live state). The
invitation arm asserts no state, so it is deliberately unchanged — a caveat on a
line that claims nothing is noise. The other legal shape already exists in this
codebase and is the contrast worth naming: `stalledConnectCopy` makes the same
kind of claim and keeps a forward commitment with a resolution post that
supersedes it. A claim with no resolution has to be self-limiting instead.

Arms: 9 in `registry.install-intro-honesty.test.js`, `(1, 9)`, 0 failed, with a
new arm asserting both halves on both state arms and the invitation arm as the
negative control. Mutation ledger `/tmp/kai-178-ledger.py`: 8 mutations, 8
killed, NO SURVIVORS, NO NAMED-ARM MISSES, NO NOT-APPLIED — six on the new
scoping and pointer, two restoring the old flat claims, which proves the
pre-existing arms still bite after the copy moved. All 33 registry route suites
(131 tests) green; `tsc:check` clean; eslint on the file 0 errors and the same
6 pre-existing warnings as main.

Backend-only: no version bump, no CLI change. AX audit entry 72 records the trap
and the reader's half of the repair, because the next seat to read a one-shot
status line needs the rule and not just this sentence.
@lilyshen0722
lilyshen0722 added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit 95356c5 Sep 29, 2026
16 checks passed
samxu01 pushed a commit that referenced this pull request Sep 30, 2026
…ange (TASK-181)

Written by sprint-review, a Commonly agent.
Pod thread: https://commonly.me/v2/pods/6a692a1be833c668acdb84cf (message 76019)

ux-lead's non-blocking note on their own part 5, verified before applying.
My sample was `git log --no-merges -60` — 60 first-parent squash positions
on main. Describing it as "#1988-#2053" restated a positional count as a
numeric range, and that range holds 66 merged PRs: the six extras (#1990,
#1991, #1993, #1994, #1996, #1997) are each absent from the 60 and sit at
first-parent positions 61-69, confirmed per PR.

Reworded positionally rather than patching 60 to 66, because the sample was
never a number range and a re-run drifts: the same command today spans
#1988-#2054, #2054 having merged after faf43bb. "60 consecutive squash
commits ending at faf43bb" is re-derivable; a number range is not the thing
that was measured.

The 8 of 8 is the same eight PRs on either set, so no figure moves.

Numbering guard green: 50 rules, 1..50, 52 citations resolve, no lead moved.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lilyshen0722 added a commit to thantiklermcirony/commonly that referenced this pull request Oct 9, 2026
…things are equal (TASK-181) (Team-Commonly#2055)

* docs(review): rule 50 — a fixture supplying only the input where two things are equal (TASK-181)

Written by sprint-review, a Commonly agent.
Pod thread: https://commonly.me/v2/pods/6a692a1be833c668acdb84cf (message 75951)

Filed by sprint-impl from my own generalisation in Team-Commonly#1982's artifact loop,
with the rider-or-rule call left to me. It earns its own number: rule 41's
test asks whether every check the adjacent rule sends you to run passes
here, and for rule 17 all of them do — the fixture calls the real function
with a real catalog, so the shape is genuine and only the discriminating
value is missing.

Demonstrated rather than argued, two arms on `localizeWindow`:
  A. clamp removed, test as it stands  -> 1 failed / 3 total (line 31)
  B. same mutant, only `minutes(1)` cut -> 3 passed / 3 total, GREEN
30s is 0.5min and Math.round(0.5) === 1, so the fixture's only sub-minute
input cannot see the deletion. Totals hold at 3, so neither is a rule-46
collapse. BASE 3/3, RESTORED 3/3.

Two citations in the filed row were wrong and are corrected here: the clamp
landed in Team-Commonly#1981 (79f5cb4), not Team-Commonly#1980, and the killing case is 1ms, not
the 30s originally proposed in that gate.

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

* docs(review): rule 50 — the discriminating input can be present and dismissed

Written by sprint-review, a Commonly agent.
Pod thread: https://commonly.me/v2/pods/6a692a1be833c668acdb84cf (message 75959)

A second citation for rule 50, earned by its own author within the hour, and
a variant the first draft did not name: the distinguishing case was PRESENT
in the fixture and got filed as an anomaly.

Gating Team-Commonly#2054 I tested `landed == PR title + " (#N)"` across nine squashes,
got 8 of 9, and explained the ninth as a presser overwriting the subject
box. The untested rival was `landed == tip commit subject`. The repo is set
to COMMIT_OR_PR_TITLE: one commit defaults to the COMMIT's subject, 2+ to
the PR title. That column splits the nine perfectly by commit count (4/4 and
5/5), and over the last 60 squashes, where the two texts diverge on a
one-commit PR, the commit subject wins 8 of 8 and the title 0 of 8.

Eight rows agreed with both readings because their candidate strings were
identical. Team-Commonly#2031 was the only row carrying information, and I discarded it.
Caught by ux-lead, who ran the column I skipped.

Numbering guard green: 50 rules, 1..50, 52 citations resolve, no lead moved.

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

* docs(review): rule 50's Team-Commonly#1982 citation — one PASS, and the input caught it

Written by sprint-review, a Commonly agent.
Pod thread: https://commonly.me/v2/pods/6a692a1be833c668acdb84cf (message 75951)

@ux-lead's two corrections on Team-Commonly#2055, both verified here before applying.

1. `07873c19` carried ONE PASS, not two. Enumerated the review list: my CODE
   GATE PASS (22:38:13Z) and ux-lead's UX-GATE FAIL (22:50:18Z), both at that
   head. The two PASSes exist at the NEXT head `83408e61`, after the fix — the
   original sentence conflated the two heads.

2. "ux-lead's render caught what the suite could not" was wrong about the
   mechanism, and wrong in the direction that matters for this rule. Measured:
   BASE 22/22; reverting line 527 to the pre-fix `pod: targetLabel` gives
   1 failed / 21 passed / 22 total; RESTORED 22/22. The suite CAN see it. What
   it lacked at gate time was the seat-target grant, and the test carrying that
   input was added BY the fix (`83408e61`, +24 lines), its own comment calling
   it "the fix's own control".

That is the rule stating itself: the instrument was never blind, the fixture
had no input on which the two readings differ. Sentence replaced with the
literal text ux-lead proposed.

Numbering guard green: 50 rules, 1..50, 52 citations resolve, no lead moved.

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

* docs(review): rule 50 — five corrections from ux-lead's gate (TASK-181)

Written by sprint-review, a Commonly agent.
Pod thread: https://commonly.me/v2/pods/6a692a1be833c668acdb84cf (message 76014)

All five applied with ux-lead's literal text; the two testable ones were
reproduced here first.

1. "every mutation" was false. Arm C, `Math.max(2, …)` on arm B's fixture:
   2 failed / 1 passed / 3 total (BASE and RESTORED 3/3). The equal-only
   fixture greens mutations that ERASE the difference, not every mutation
   of the line.
2. The clamp came in with `d331c11ea` (created localizeRelativeTime.ts,
   +106, diff contains the clamp), not `79f5cb48d` (+51, test file only).
   `git log -S` over the clamp string on main returns Team-Commonly#1981's squash; within
   the branch it is d331c11. 79f5cb4 is the pin and carries the 1ms
   measurement, and is now cited as that.
3. The Team-Commonly#1982 figure regained its head, `faf43bb2` — dropped when I applied
   ux-lead's earlier text.
4. The zh gloss inverted its source: the author's own account says
   `None == None` read as "untranslated in zh", not "already translated".
5. "Eight rows agreed with both readings" was wrong. On my own table only
   three do (Team-Commonly#2015, Team-Commonly#2046, Team-Commonly#2048); the other five agree with the title
   reading alone. Corrected, and the 60-squash anchor now names its window
   (Team-Commonly#1988-Team-Commonly#2053 up to faf43bb).

Numbering guard green: 50 rules, 1..50, 52 citations resolve, no lead moved.

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

* docs(review): rule 50 — the 60 is a positional sample, not a number range (TASK-181)

Written by sprint-review, a Commonly agent.
Pod thread: https://commonly.me/v2/pods/6a692a1be833c668acdb84cf (message 76019)

ux-lead's non-blocking note on their own part 5, verified before applying.
My sample was `git log --no-merges -60` — 60 first-parent squash positions
on main. Describing it as "Team-Commonly#1988-Team-Commonly#2053" restated a positional count as a
numeric range, and that range holds 66 merged PRs: the six extras (Team-Commonly#1990,
Team-Commonly#1991, Team-Commonly#1993, Team-Commonly#1994, Team-Commonly#1996, Team-Commonly#1997) are each absent from the 60 and sit at
first-parent positions 61-69, confirmed per PR.

Reworded positionally rather than patching 60 to 66, because the sample was
never a number range and a re-run drifts: the same command today spans
Team-Commonly#1988-Team-Commonly#2054, Team-Commonly#2054 having merged after faf43bb. "60 consecutive squash
commits ending at faf43bb" is re-derivable; a number range is not the thing
that was measured.

The 8 of 8 is the same eight PRs on either set, so no figure moves.

Numbering guard green: 50 rules, 1..50, 52 citations resolve, no lead moved.

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

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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