Skip to content

fix(cli): stamp the line that dates the restart - #1006

Merged
lilyshen0722 merged 1 commit into
mainfrom
fix/stamp-the-line-that-dates-the-restart
Aug 18, 2026
Merged

fix(cli): stamp the line that dates the restart#1006
lilyshen0722 merged 1 commit into
mainfrom
fix/stamp-the-line-that-dates-the-restart

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

Found by @sprint-review. #1002 stamped four sinks and missed the one that cost the most.

Why this line and not the others

The boot banner is a direct console.log in the agent run action, emitted before performRun is called — so it never passed through the injected log: that #1002 fixed:

console.log(`[${name}] polling ${record.instanceUrl} for events (ctrl+c to stop)`);

It is the first line of every seat log and the truncation boundary. The fleet runs as nohup … > log 2>&1, so this line is written at boot and everything before it is gone. That makes it the only line capable of dating a restart from the log itself.

Unstamped, establishing when nine seats came back on 2026-08-18 required ps -o lstart. That worked only because the processes were still alive — one more restart and the route is gone, and the log that replaced the evidence still cannot say when it started.

Also stamped

The bootstrap-success line and the SIGINT stopping... line — the other two direct console calls in this action. Between them the log now carries a dated open and a dated close, so a truncated file can be placed on a clock at both ends rather than neither.

Deliberately not stamped

register, connect, attach, detach. Those print to a terminal a human is watching, where a timestamp on every line is noise rather than evidence. The distinction is redirected-and-outlives-its-process versus read-once-and-discarded.

Full cli suite green; registerAgent builds with the helper in scope (an out-of-scope reference throws at call time, which is how that bug class surfaces — see AX entry 28).

Not verified: the rendered output, for the same reason as #1002 — these sinks live inside .action(), which no test invokes. The honest check is a seat restart, which belongs to whoever fast-forwards live/main-tracking. That check is now cheaper: the first line of the new log will either carry a stamp or it won't.

🤖 Generated with Claude Code

#1002 stamped four sinks and missed the one that mattered most. The boot
banner is a direct console.log in the `agent run` action, emitted before
performRun is called, so it never passed through the injected `log:` the
last PR fixed.

It is the first line of every seat log and the truncation boundary. The
fleet runs as `nohup … > log 2>&1`, so this line is written at boot and
everything before it is gone — which makes it the only line that can date
a restart from the log itself. Unstamped, establishing when nine seats
came back on 2026-08-18 needed `ps -o lstart`, and that route works only
while the processes are still alive; one more restart and it is gone too.

Also stamps the bootstrap-success line and the SIGINT "stopping..." line,
the other two direct console calls in this action. Between them the log
now carries a dated open and a dated close, so a truncated file can be
placed on a clock at both ends rather than neither.

Left the interactive commands alone — register, connect, attach and
detach print to a terminal a human is watching, where a timestamp on
every line is noise, not evidence.

Reported-by: sprint-review

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@lilyshen0722
lilyshen0722 merged commit 2715484 into main Aug 18, 2026
10 checks passed
@lilyshen0722
lilyshen0722 deleted the fix/stamp-the-line-that-dates-the-restart branch August 18, 2026 13:23
lilyshen0722 added a commit that referenced this pull request Aug 19, 2026
npm 0.1.9 and main 0.1.9 are DIFFERENT CODE. Seven source commits have landed
since the last bump, four of them real fixes:

  #995   a quota stall was classified as a runtime blip and probed every 5s
  #973   a directly-addressed seat can answer past the cascade cap
  #1002  a seat log recorded four failures and not one time
  #1006  stamp the line that dates the restart
  #961   pin an agent's model in the environment spec

Anyone who installs the CLI today gets none of them. Our own seats have them
only because their CLI is npm-linked into a worktree that was pulled by hand.

Same defect as #979 one package over: a version that maps to two different
artifacts defeats the only check available from outside the repo.
lilyshen0722 added a commit that referenced this pull request Aug 19, 2026
… to nobody (#1017)

* chore(release): @commonlyai/cli 0.1.10

npm 0.1.9 and main 0.1.9 are DIFFERENT CODE. Seven source commits have landed
since the last bump, four of them real fixes:

  #995   a quota stall was classified as a runtime blip and probed every 5s
  #973   a directly-addressed seat can answer past the cascade cap
  #1002  a seat log recorded four failures and not one time
  #1006  stamp the line that dates the restart
  #961   pin an agent's model in the environment spec

Anyone who installs the CLI today gets none of them. Our own seats have them
only because their CLI is npm-linked into a worktree that was pulled by hand.

Same defect as #979 one package over: a version that maps to two different
artifacts defeats the only check available from outside the repo.

* ci: fail when a published package's src moves without a version bump

The published version is the only check available from OUTSIDE this repo. Ship
source without bumping it and that check silently passes while the artifact and
the repo disagree.

Twice now:
  #979   @commonlyai/mcp — npm 0.3.0 and main 0.3.0 were different code; the
         PR-tool removal reached the repo and reached zero seats. Found months
         late, by unpacking the tarball.
  #1017  @commonlyai/cli — npm 0.1.9 and main 0.1.9 were different code, seven
         source commits deep, including #995 (a quota stall classified as a
         runtime blip and probed every 5s). Found the same day, by hand, only
         because someone thought to check content rather than version.

Guards cli/src and commonly-mcp/src. Docs and tests are exempt — they do not
require a release.

Verified before landing: YAML parses, bash -n clean, and the comparison was
dry-run against real history — 7 commits touched cli/src since its last bump,
every one of which this would have failed.
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