Skip to content

feat(bin): stamp status events with their emission time - #3764

Merged
kunchenguid merged 43 commits into
kunchenguid:mainfrom
tiago-peixoto:fm/firstmate-issue3746-status-event-time
Sep 20, 2026
Merged

kunchenguid merged 43 commits into
kunchenguid:mainfrom
tiago-peixoto:fm/firstmate-issue3746-status-event-time

Conversation

@tiago-peixoto

@tiago-peixoto tiago-peixoto commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Clear base conflicts on #3764.
Branch fm/firstmate-issue3746-status-event-time, last known head b4a1328cbd8b.
The change is: stamp status events with their emission time. Long-running babysit; keep that intent; clear conflicts; renew attestation and CI without opening a second PR. Never merge upstream.

What Changed

  • bin/fm-classify-lib.sh gains an optional [at=<epoch>] tag before a status line's first colon, with one parser owning the grammar (canonical unsigned decimal, at most 12 digits, missing/malformed/duplicate means unknown time) plus status_line_at_epoch, status_stamp_line, status_stamp_width, status_event_recorded, and two strippers. Captain relevance, the event scan, the note and key readers, and the decision fold now locate the head on an unstamped copy so a worker-written stamp cannot hide an actionable event or move the head/note separator, while stored and surfaced bytes stay the caller's own; the open-decisions fold version bumps to 9 to discard cursors folded under the old reading.
  • Writers stamp at append time instead of carrying a new flag: the self-announced append in fm-wake-lib.sh, the parent-channel, merge-outcome, and secondmate-report publishes, remote-reply ingest in fm-procevent-remote-reply.sh, and the Kimi/Rovo/agy spawn-failure lines in fm-spawn.sh. fm-send.sh subtracts status_stamp_width from its resolve-key line cap so the close record still fits, fm-inactive-reconcile.sh's PR-URL scrape accepts a stamped done: line, and the fm-brief.sh / fm-dod-lib.sh scaffolds tell workers to append {state} [at=<epoch>]: ... with a literal placeholder.
  • fm-fleet-snapshot.sh publishes paths.status_log.last_event.age_seconds derived from the event time (null when the time is unknown or in the future) and reuses it for the secondmate parent_event, while the unreadable-home fallback's freshness.age_seconds stays the mtime-based observation age. Docs (AGENTS.md, architecture, configuration, captain-hold lifecycle, secondmate parent channel and its verification record) drop stale unstamped line spellings, and the test suites accept optional stamps, with new classifier cases covering well-formed, malformed, and colon-bearing stamps against relevance, notes, keys, and the decision fold.

Risk Assessment

⚠️ Medium: The round's three fixes are minimal, correctly implemented, and verified by execution with no open defects, but the branch as a whole changes load-bearing shared classification, decision-fold, and status-writing semantics across 13 production scripts and invalidates every persisted decision cursor on upgrade, so residual risk is more than trivial even though it is safe to merge.

Testing

I stood up a real tmux 3.6 server with an interactive bash pane as the worker and an isolated FM_HOME, then drove the change through the real firstmate scripts rather than the test harness. A worker opened a stamped decision from its own pane, the captain's wake drain read the stamp through to a clean key and note, firstmate answered with fm-send --resolve-key, and the appended close carried its real emission epoch and closed the key. The fleet snapshot reported a 125-second emission age for a line written one second earlier, proving age comes from the stamp and not from file mtime, and honestly reported null for the brief's unsubstituted placeholder. Every adversarial case was replayed over identical fixtures on base a452a79, the previous head ce3b5c2 and the target: on ce3b5c2 a worker writing a readable clock time silently closed the captain's open api-shape decision and opened a phantom keyless one, and both symptoms are gone at the target; on base a colon-bearing stamp sliced the note into "03:00Z]: PR ..." and the target reads it cleanly. The real watcher absorbed a benign working line and then surfaced the malformed-stamped terminal event, and the drain's outcome backstop presented that same event on all three trees, so a bad stamp never hides an outcome. A 400-character answer stored a 236-character line on ce3b5c2 against the 220 cap fm-send's own refusal cites, and exactly 220 at the target while still closing the key. A stale decision cursor folded under the old reading was discarded and refolded correctly by the upgraded tree. Ten targeted suites plus the PR-merge suite all pass. The one scenario I could not drive live is the retried upward publication against a real forge: tests/fm-pr-merge.test.sh exercises it only over a stubbed forge, so I report it untested rather than passing. This is a shell CLI change with no GUI surface, so the reviewer-visible evidence is annotated terminal transcripts of the live runs rather than screenshots.

  • Live validation: ✅ go - 9 of 10 scenarios driven live against the product
Scenario Result Live Evidence
A worker opens a stamped decision from its own pane; firstmate answers it with fm-send --resolve-key and the stamped close actually closes the key ✅ pass live Live tmux pane wrote needs-decision [key=api-shape] [at=1789880334]: ...; bin/fm-wake-drain.sh listed it with a clean key and note; bin/fm-send.sh t1 --resolve-key api-shape appended `resolved […
The captain's fleet snapshot reports the event's real emission age, and reports unknown rather than inferring age from file mtime ✅ pass live bin/fm-fleet-snapshot.sh returned age_seconds 125 for a line stamped 125s earlier in a file written one second before the read, age_seconds 10 for the brief round trip, and null for [at=&lt;epoch&gt;].…
Adversarial: a worker's colon-bearing stamp cannot silently close a captain's open decision ✅ pass live Same fixture on both trees: ce3b5c2's drain and fleet snapshot dropped api-shape entirely (open: []); the target keeps it open. 02-malformed-stamp-adversarial.txt sections 3-4
Adversarial: a worker's colon-bearing stamp cannot open a phantom decision no later line could close ✅ pass live needs-decision [at=10:30] which base branch opened a default decision on ce3b5c2 (drain and hints.open_decisions) and opens nothing on the target. 02-malformed-stamp-adversarial.txt sections 3-4
Adversarial: a readable ISO stamp does not garble the note the captain reads ✅ pass live done [at=2026-09-20T14:03:00Z]: PR .../pull/1 checks green yielded note "03:00Z]: PR ..." on base a452a79 and the clean note on the target, read through bin/fm-fleet-snapshot.sh. 02-malformed-stam…
Adversarial: a malformed stamp never hides a terminal outcome from supervision ✅ pass live Real bin/fm-watch.sh absorbed a working: baseline then surfaced signal: .../t1.status on the malformed-stamped done line; the drain's STATUS OUTCOME BACKSTOP presented the same event on base, ce…
Upgrade path: a decision cursor folded under the old reading is discarded, not trusted ✅ pass live ce3b5c2's drain wrote .t1/.t2.open-decisions-cursor holding the wrong open set; the target drain over the same state dir, stale cursors present, reported the correct set (FM_OPEN_DECISIONS_FOLD_VERSIO…
Adversarial: an over-long answer's stamped close stays inside the 220-character status-line cap and still closes the key ✅ pass live Real bin/fm-send.sh --resolve-key with a 400-character answer stored 236 characters on ce3b5c2 and exactly 220 on the target; the drain then showed no open decision, so truncation did not eat the [k…
The generated ship brief instructs the stamp, and a worker following it verbatim produces a line the captain reads correctly ✅ pass live bin/fm-brief.sh t7 demo --mode no-mistakes rendered the [at=&lt;epoch&gt;] instruction plus the date +%s substitution note at 10 sites; that exact echo was executed in the live worker pane and read ba…
A retried upward publication on the deduplicating parent-channel path still reports a merge exactly once despite a different emission time ⏸️ untested no This scenario was never driven against a live forge: the prior run exercised it only through tests/fm-pr-merge.test.sh, which drives the real fm-pr-merge over a stubbed forge, so no live result was…
Evidence: Live round trip: stamped decision, stamped close, emission age

Source: Live round trip: stamped decision, stamped close, emission age

Live validation - "stamp status events with their emission time"
branch fm/firstmate-issue3746-status-event-time, target 91d9b79, base a452a79

Everything below was produced by running the real firstmate scripts against an
isolated FM_HOME with a REAL tmux 3.6 server (own socket, own session "fmlive",
a real interactive bash pane standing in for the worker). No test harness, no
mocked classifier.

==================================================================
1. A worker opens a decision from its own pane, stamped as the brief
   now instructs, and firstmate answers it with fm-send --resolve-key.
==================================================================
$ tmux send-keys -t fmlive:fm-t1 -l \
    'echo "needs-decision [key=api-shape] [at=$(date +%s)]: REST or gRPC for the public surface" >> .../state/t1.status'

$ cat state/t1.status
needs-decision [key=api-shape] [at=1789880334]: REST or gRPC for the public surface
                                  (wall clock at that moment: 1789880335)

$ bin/fm-wake-drain.sh            # the captain's wake digest
OPEN DECISIONS (still open, folded from the durable status logs - not just the latest line):
t1 [key=api-shape] needs-decision: REST or gRPC for the public surface
OPEN DECISIONS: close one by answering it: bin/fm-send.sh <task> --resolve-key <key> '<answer>'
      -> the stamp is read through: the key is api-shape, the note is clean.

$ bin/fm-send.sh t1 --resolve-key api-shape 'go with REST; gRPC stays internal'

$ cat state/t1.status
needs-decision [key=api-shape] [at=1789880334]: REST or gRPC for the public surface
resolved [key=api-shape] [at=1789880376]: answered: go with REST; gRPC stays internal
                                  (wall clock at that moment: 1789880377)
      -> firstmate's own close carries its real emission time.

$ bin/fm-wake-drain.sh
(no OPEN DECISIONS section)       -> the stamped close still closes the key.

==================================================================
2. Emission time, not file mtime, is what the captain reads.
==================================================================
A worker follows the brief literally from its pane:
$ echo "done [at=$(date +%s)]: PR https://example.test/pull/42 checks green" >> state/t7.status
$ cat state/t7.status
done [at=1789880599]: PR https://example.test/pull/42 checks green

...10 seconds later, bin/fm-fleet-snapshot.sh:
{"state":"done","note":"PR https://example.test/pull/42 checks green",
 "raw":"done [at=1789880599]: PR https://example.test/pull/42 checks green",
 "age_seconds":10}

Same file, stamp left as the brief's unsubstituted placeholder:
{"state":"done","note":"PR https://example.test/pull/42 checks green",
 "raw":"done [at=<epoch>]: PR https://example.test/pull/42 checks green",
 "age_seconds":null}
      -> unknown stays honestly unknown; age is never inferred from mtime
         (the age-125 run below used a file written one second earlier):
{"state":"done","note":"green CI, PR ready for review",
 "raw":"done [at=1789880369]: green CI, PR ready for review","age_seconds":125}
Evidence: Adversarial malformed stamps: before/after across three trees

Source: Adversarial malformed stamps: before/after across three trees

Adversarial: a worker mis-spells the stamp (a readable clock time whose colons
pose as the head/note separator, or the brief's <epoch> placeholder left as-is).

The module's own rule: a worker-written tag must never decide whether a terminal
event reaches its supervisor, and must never decide whether a captain's decision
survives. These runs try to break exactly that.

Fixture (identical for every tree below):
  state/t1.status
    needs-decision [key=api-shape] [at=1700000000]: REST or gRPC?
    done [at=17:00] finished the audit
  state/t2.status
    needs-decision [at=10:30] which base branch

==================================================================
3. bin/fm-wake-drain.sh - the captain's OPEN DECISIONS view
==================================================================
--- previous branch head ce3b5c2 (stamping shipped, fold not yet unstamped) ---
OPEN DECISIONS (still open, folded from the durable status logs - not just the latest line):
t2 needs-decision: needs-decision which base branch

   api-shape is GONE: the colon inside [at=17:00] made a colonless prose line
   look like a terminal transition and silently closed the captain's decision.
   t2 is a PHANTOM: the colon inside [at=10:30] made a keyless line look like a
   declaration, opening a decision no later line could ever close.

--- target 91d9b79 ---
OPEN DECISIONS (still open, folded from the durable status logs - not just the latest line):
t1 [key=api-shape] needs-decision: REST or gRPC?

   The real decision survives; the phantom is gone.

==================================================================
4. bin/fm-fleet-snapshot.sh - the same two tasks, machine surface
==================================================================
--- ce3b5c2 ---
{"id":"t1","last_event":{"state":"done","note":"done finished the audit","raw":"done [at=17:00] finished the audit","age_seconds":null},"open":[]}
{"id":"t2","last_event":{"state":"needs-decision","note":"needs-decision which base branch","raw":"needs-decision [at=10:30] which base branch","age_seconds":null},"open":[{"key":"default","verb":"needs-decision","summary":"needs-decision which base branch"}]}

--- target 91d9b79 ---
{"id":"t1","last_event":{"state":"done","note":"done finished the audit","raw":"done [at=17:00] finished the audit","age_seconds":null},"open":[{"key":"api-shape","verb":"needs-decision","summary":"REST or gRPC?"}]}
{"id":"t2","last_event":{"state":"needs-decision","note":"needs-decision which base branch","raw":"needs-decision [at=10:30] which base branch","age_seconds":null},"open":[]}

   hints.open_decisions is what the bearings board and fm-send --resolve-key
   validate against, so the wrong set propagated well past the drain.
   The raw bytes are preserved verbatim in both; only the reading changed.

==================================================================
5. Note text: a colon-bearing stamp must not slice up the note.
==================================================================
  state/t3.status
    done [at=2026-09-20T14:03:00Z]: PR https://example.test/pull/1 checks green

--- base a452a79 (before this change) ---
{"id":"t3","note":"03:00Z]: PR https://example.test/pull/1 checks green","state":"done"}

--- target 91d9b79 ---
{"id":"t3","note":"PR https://example.test/pull/1 checks green","state":"done","age":null}

   That garbled note was what fm-inactive-reconcile published upward to the
   parent channel and what status_open_decisions handed the captain as a
   decision summary.

==================================================================
6. The terminal event still WAKES supervision (real bin/fm-watch.sh)
==================================================================
$ bin/fm-watch.sh &            # FM_POLL=1, crew-state says "working · run-step"
  state/t1.status: "working: fixture set up, starting the audit"
  -> baseline: watcher absorbed the working: line and is still supervising

$ echo 'done [at=17:00] finished the audit, PR ready for review' >> state/t1.status
  -> watcher surfaced and exited:
     signal: .../state/t1.status

$ bin/fm-wake-drain.sh   (fresh state, one task, the same malformed line)
   base a452a79   -> STATUS OUTCOME BACKSTOP: t1 done [at=17:00] finished the audit
   ce3b5c2        -> STATUS OUTCOME BACKSTOP: t1 done [at=17:00] finished the audit
   target 91d9b79 -> STATUS OUTCOME BACKSTOP: t1 done [at=17:00] finished the audit

   A malformed stamp never hides a terminal outcome from the captain, in any
   of the three trees.

==================================================================
7. Upgrade path: a decision cursor folded under the OLD reading
==================================================================
$ ce3b5c2 bin/fm-wake-drain.sh        # writes .t1/.t2.open-decisions-cursor (v8)
OPEN DECISIONS:
t2 needs-decision: needs-decision which base branch            <- wrong set, now cached

$ ls -A state | grep open-decisions
.t1.open-decisions-cursor  .t2.open-decisions-cursor

$ 91d9b79 bin/fm-wake-drain.sh        # same state dir, stale cursors still present
OPEN DECISIONS:
t1 [key=api-shape] needs-decision: REST or gRPC?               <- correct set

   FM_OPEN_DECISIONS_FOLD_VERSION 8 -> 9 discarded the stale cursors and
   refolded from byte 0, so an upgraded firstmate does not inherit the wrong
   answer from its own cache.
Evidence: Status-line cap with the stamp reserved, and the generated ship brief

Source: Status-line cap with the stamp reserved, and the generated ship brief

The 220-character status-line cap must bound the line that is actually
APPENDED - stamp included. Driven through the real bin/fm-send.sh into an
isolated home, answering an open decision with a 400-character note.

==================================================================
8. fm-send --resolve-key with an over-long answer
==================================================================
$ bin/fm-send.sh t2 --resolve-key rollout-plan \
    'stage it behind a flag for a week then ramp: xxxx...(400 x)'

--- previous branch head ce3b5c2 (cap measured BEFORE the stamp) ---
  stored line length: 236          <- 16 characters past the cap fm-send's own
                                      refusal message cites
--- target 91d9b79 (stamp width reserved) ---
  stored line length: 220

$ tail -1 state/t2.status          # target
resolved [key=rollout-plan] [at=1789880404]: answered: stage it behind a flag for a week then ramp: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [truncated]

$ bin/fm-wake-drain.sh
(no OPEN DECISIONS section)        -> the capped, stamped close still closes
                                      rollout-plan; truncation did not eat the
                                      structural [key=...] delimiter.

==================================================================
9. The generated ship brief, rendered by the real bin/fm-brief.sh
==================================================================
$ bin/fm-brief.sh t7 demo --mode no-mistakes
scaffolded: .../data/t7/brief.md (ship, mode=no-mistakes; ...)

4. Report status by appending one line:
   `echo "{state} [at=<epoch>]: {one short line}" >> '.../state/t7.status'`
   States: working, needs-decision, blocked, paused, done, failed.
   Substitute `<epoch>` with the current Unix time in seconds - run `date +%s`
   and write the number it printed; a stamp that is not plain digits records no
   time at all.

...and every other reporting instruction in the same brief now carries it:
  20:If the top-level path is the primary checkout or not the worktree you were launched in, STOP - do not branch or commit here - append `blocked [at=<epoch>]: launched in primary checkout, not an isolated worktree` to the status file and stop.
  30:   `echo "{state} [at=<epoch>]: {one short line}" >> '/tmp/fm-live-stamp.hOalKI/home-brief/state/t7.status'`
  46:5. If you hit the same obstacle twice, append `blocked [at=<epoch>]: {why}` and stop; firstmate will help.
  48:   append `needs-decision [at=<epoch>]: {summary of options}` and stop. Firstmate will reply with the decision.
  50:   `needs-decision [at=<epoch>] [key=nm-<run>-<step>]: ask-user findings=<id1>,<id2>,... file=/tmp/fm-live-stamp.hOalKI/home-brief/data/t7/nm-<run>-findings.txt`
  53:   Firstmate's reply normally writes that closing line at answer time; when a blocker or wait clears WITHOUT a firstmate reply, append `resolved [at=<epoch>]: {how it cleared}` yourself (same `[key=<slug>]` if you opened it with one) as you resume.
  59:   `blocked [at=<epoch>]: {the daemon error}` and stop even when the local run record still says running or
  82:When you believe it is complete, append `done [at=<epoch>]: {summary}` to the status file and stop.
  110:After /no-mistakes reports CI green (the CI-ready return point - do not wait for it to keep monitoring in the background until merge), append `done [at=<epoch>]: PR {url} checks green` and stop. You are finished.

The round trip in section 2 above is that instruction executed verbatim in a
real worker pane, read back through bin/fm-fleet-snapshot.sh.
Evidence: Secondmate upward report on the real parent channel

Source: Secondmate upward report on the real parent channel

==================================================================
10. A secondmate's upward report on the real parent channel
==================================================================
Local-route secondmate home "domain-alpha" with route=local, parent_home=<P>.

$ FM_HOME=<mate> bin/fm-secondmate-report.sh done 0123456789abcdef 'audit complete, no findings'
$ cat <P>/state/domain-alpha.status
  done [corr=0123456789abcdef] [at=1789880647]: audit complete, no findings (via-helper)
  done [corr=0123456789abcdef] [at=1789880650]: audit complete, no findings (via-helper)

  (wall clock at the first call: 1789880647)

The retried publication above is an unchanged pre-existing behaviour of this
helper - it appends directly, and base a452a79 duplicates the same way:

  done [corr=0123456789abcdef]: audit complete, no findings (via-helper)
  done [corr=0123456789abcdef]: audit complete, no findings (via-helper)

The deduplicating channel path (fm_parent_channel_report -> append_once, now
keyed on fm-classify-lib.sh's stamp-insensitive retry contract instead of
grep -Fqx) is driven end-to-end by tests/fm-pr-merge.test.sh:

  ok - a merge a secondmate home performs itself is reported upward exactly once
  ok - a landed GitLab merge request is reported upward on the same channel
Evidence: Captain wake digest reads a stamped decision through to a clean key and note
$ bin/fm-wake-drain.sh
OPEN DECISIONS (still open, folded from the durable status logs - not just the latest line):
t1 [key=api-shape] needs-decision: REST or gRPC for the public surface
OPEN DECISIONS: close one by answering it: bin/fm-send.sh <task> --resolve-key <key> '<answer>'

$ bin/fm-send.sh t1 --resolve-key api-shape 'go with REST; gRPC stays internal'
$ cat state/t1.status
needs-decision [key=api-shape] [at=1789880334]: REST or gRPC for the public surface
resolved [key=api-shape] [at=1789880376]: answered: go with REST; gRPC stays internal
(wall clock at that moment: 1789880377)

$ bin/fm-wake-drain.sh
(no OPEN DECISIONS section - the stamped close closed the key)
Evidence: A mis-spelled worker stamp no longer decides a captain's decision
fixture:
t1: needs-decision [key=api-shape] [at=1700000000]: REST or gRPC?
done [at=17:00] finished the audit
t2: needs-decision [at=10:30] which base branch

--- ce3b5c2 (prior head) bin/fm-wake-drain.sh ---
OPEN DECISIONS:
t2 needs-decision: needs-decision which base branch
api-shape SILENTLY CLOSED; t2 is a PHANTOM no line could close

--- 91d9b79 (target) bin/fm-wake-drain.sh ---
OPEN DECISIONS:
t1 [key=api-shape] needs-decision: REST or gRPC?
real decision survives, phantom gone
Evidence: Emission age comes from the stamp, never from file mtime
$ bin/fm-fleet-snapshot.sh | jq -c '.tasks[].paths.status_log.last_event'
{"state":"done","note":"green CI, PR ready for review","raw":"done [at=1789880369]: green CI, PR ready for review","age_seconds":125}
(the file itself was written one second before this read)

{"state":"done","note":"green CI, PR ready for review","raw":"done [at=<epoch>]: green CI, PR ready for review","age_seconds":null}
(brief placeholder left unsubstituted - unknown stays honestly unknown)
Evidence: Stamped close stays inside the 220-character cap
$ bin/fm-send.sh t2 --resolve-key rollout-plan '<400-character answer>'

ce3b5c2 (cap measured before the stamp): stored line length 236
91d9b79 (stamp width reserved): stored line length 220

resolved [key=rollout-plan] [at=1789880404]: answered: stage it behind a flag for a week then ramp: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [truncated]

$ bin/fm-wake-drain.sh -> no OPEN DECISIONS: the capped stamped close still closes the key

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

🔧 **Rebase** - 4 issues found → auto-fixed ✅
  • ⚠️ bin/fm-procevent-remote-reply.sh - merge conflict rebasing onto origin/main
  • ⚠️ bin/fm-spawn.sh - merge conflict rebasing onto origin/main
  • ⚠️ bin/fm-wake-lib.sh - merge conflict rebasing onto origin/main
  • ⚠️ tests/fm-remote-reply.test.sh - merge conflict rebasing onto origin/main

🔧 Fix applied.
✅ Re-checked - no issues remain.

🔧 **Review** - 3 issues found → auto-fixed ✅
  • 🚨 bin/fm-classify-lib.sh:669 - _fm_decision_fold_line's two colon tests still read the RAW line, so a colon living inside a mis-spelled [at=...] tag is mistaken for the head/note separator that the module's four other readers now correctly skip. A worker-written tag therefore decides whether a captain's open decision survives. This is the one round-8 fix the user selected that was never committed - the branch head is still the round-7 follow-up, and the defect is live in the current tree.

The declaration guard at :668-671 (case &#34;$line&#34; in *:*|*\[key=*\]*) and the terminal rule at :673-675 (case &#34;$line&#34; in *:*) case &#34;$verb:$kind&#34; in done:ship|done:scout|failed:ship|failed:scout) return 0) both match $line, while status_line_note:554, _fm_decision_key:570, status_is_captain_relevant:227 and _fm_status_event_scan:174 all go through _fm_status_unstamped first.

Reproduced by executing the library against a kind=ship status file:

needs-decision [key=api-shape] [at=1700000000]: REST or gRPC?
done [at=17:00] finished the audit
-> status_open_decisions: (empty) -- api-shape SILENTLY CLOSED

same opener + done [at=1700000000] finished the audit -> api-shape still open (correct)
same opener + done finished the audit -> api-shape still open (correct)

The inverse symptom, same root cause:

needs-decision [at=17:00] which base branch
-> open: default\tneeds-decision\tneeds-decision which base branch -- PHANTOM opened
needs-decision [at=1700000000] which base branch -> open: (empty)
needs-decision which base branch -> open: (empty)

Both outcomes contradict rules the module states about itself. _fm_status_unstamped's header at :356-361 says a worker tag "must never decide whether a terminal event reaches its supervisor - not when the worker left the brief's <epoch> placeholder unsubstituted, and not when they wrote a readable time whose colons swallow the head/note separator." Fold version 8's note at :930-932 says "a colonless line without a complete '[key=...]' token is no longer a transition at all, so a cursor holding a phantom decision that bare prose opened - which no later line could close - is discarded." Post-unstamping, done [at=17:00] finished the audit IS a colonless keyless line to every other reader in the module.

Newly reachable because of this change: bin/fm-brief.sh:291, :390 and :478 now instruct every worker in all three scaffolds to append {state} [at=&lt;epoch&gt;]: {one short line} and to substitute &lt;epoch&gt; by hand from date +%s, and the change's own tests/fm-classify-corr-token.test.sh:702-712 enumerate [at=17:00], [at=10:30] and [at=2026-09-20T14:03:00Z] as spellings that must not change classification. Those tests assert verb, note, key, relevance and status_span_first_actionable for that input class - but never status_open_decisions, which is the uncovered path.

The wrong set propagates: bin/fm-fleet-snapshot.sh publishes it as hints.open_decisions, status_current_line:733-742 derives the current declaration from it for bin/fm-crew-state.sh, and bin/fm-send.sh --resolve-key validates against it.

Remedy at the earliest shared boundary the change already owns: normalize once at the top of _fm_decision_fold_line with _fm_status_unstamped &#34;$line&#34; unstamped and run both case tests on $unstamped (leave status_line_verb and the stored/surfaced bytes untouched), then bump FM_OPEN_DECISIONS_FOLD_VERSION at :936 from 8 to 9 with a version note, because :879-881 states that variable "must be bumped whenever _fm_decision_fold_line semantics change, so persisted state from an older interpretation is discarded and rebuilt from byte 0." That is existing documented machinery, not new state, so this corrects what the change already does rather than extending it.

  • ⚠️ bin/fm-send.sh:698 - The 220-character status-line cap is applied to the close line and the stamp is then inserted, so the line actually appended is 236 characters and every 220-capped rendering downstream loses real content. Also a round-8 finding the user chose to fix that was never committed.

Measured by executing the two functions together: fm_cap_line_var &#34;resolved [key=api-shape]: answered: &lt;400 x&#39;s&gt;&#34; yields exactly 220 characters, and status_stamp_line on that result yields 236 - [at=1789877213] is 16 characters inserted into the head. bin/fm-send.sh:698 caps; bin/fm-wake-lib.sh:2195-2197 stamps every line it appends.

Two concrete consequences. First, bin/fm-session-start.sh:528-529 prints the status tail with each line "capped at $FM_LINE_CAP_DEFAULT characters" and re-cuts at 220, replacing the tail with FM_LINE_CAP_SUFFIX - so the captain-facing digest of a long close now shows roughly 16 fewer characters of the actual note than before this change, and shows a truncation marker on a line that was already marked truncated. Second, bin/fm-send.sh:676's pre-send refusal still explains itself in terms of "the $FM_LINE_CAP_DEFAULT-character status-line cap" while the line the same function goes on to write is 236 characters, so the guard and the writer no longer agree on the cap being enforced.

The same pre-stamp budgeting applies to bin/fm-parent-channel-lib.sh:129 (fm_parent_channel_clean_note cuts to 1200, then fm_parent_channel_report:152 stamps the result).

The remedy is already fixed by the recorded round-8 decision - "The 220-character cap applies to the line that is actually appended, stamp included. Reserve stamp width when capping a line that will be stamped. Do not raise the default cap" - so this is mechanical now: subtract the stamp width from max at the cap call sites whose output the writer will stamp, rather than capping after stamping or raising FM_LINE_CAP_DEFAULT.

  • ℹ️ tests/fm-bearings-snapshot.test.sh:434 - The GNU-stat fixture test dropped assert_contains &#34;$(cat &#34;$stat_log&#34;)&#34; &#39;-c %Y&#39; &#34;GNU parent-event mtime must use stat -c&#34; and put a .parent_event.age_seconds == null jq check in its place (lines 434-437), but that replacement cannot fail if the mtime reader is broken: for a legacy unstamped event parent_event.age_seconds is null whether or not file_mtime_epoch works.

file_mtime_epoch is still live and is still called on this exact code path - bin/fm-fleet-snapshot.sh:1770 runs observed_epoch=$(file_mtime_epoch &#34;$status_observation_file&#34;) unconditionally for every secondmate row, before the structured-home / fallback branch. Breaking the GNU branch (for example making it call /usr/bin/stat -f &#39;%m&#39;) leaves the new assertion green. The surviving -c %a (line 433) and -c %s (line 438) assertions and the no--f check cover mode, size and platform selection; nothing in this suite now exercises the mtime read. .github/workflows/ci.yml:446 runs this whole file under stock macOS Bash 3.2 as a platform-portability gate.

Note the round-8 remedy as written does not work here: the domain-alpha record this test inspects takes the structured-home branch, whose freshness.age_seconds comes from $summary_age (bin/fm-fleet-snapshot.sh:1882), not from file_mtime_epoch. Adding .freshness.age_seconds to that jq filter would assert nothing about stat. Because line 1770 is unconditional, simply restoring the -c %Y assertion alongside the new age check is both correct and falsifiable.

Separately, the definition-order swap of file_mtime_epoch and file_mode_octal at bin/fm-fleet-snapshot.sh:1159-1166 is a pure no-op reorder (definition order affects neither call order nor the stat log) and can be reverted to shrink the diff.

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 9 of 10 scenarios driven live against the product
Scenario Result Live Evidence
A worker opens a stamped decision from its own pane; firstmate answers it with fm-send --resolve-key and the stamped close actually closes the key ✅ pass live Live tmux pane wrote needs-decision [key=api-shape] [at=1789880334]: ...; bin/fm-wake-drain.sh listed it with a clean key and note; bin/fm-send.sh t1 --resolve-key api-shape appended `resolved […
The captain's fleet snapshot reports the event's real emission age, and reports unknown rather than inferring age from file mtime ✅ pass live bin/fm-fleet-snapshot.sh returned age_seconds 125 for a line stamped 125s earlier in a file written one second before the read, age_seconds 10 for the brief round trip, and null for [at=&lt;epoch&gt;].…
Adversarial: a worker's colon-bearing stamp cannot silently close a captain's open decision ✅ pass live Same fixture on both trees: ce3b5c2's drain and fleet snapshot dropped api-shape entirely (open: []); the target keeps it open. 02-malformed-stamp-adversarial.txt sections 3-4
Adversarial: a worker's colon-bearing stamp cannot open a phantom decision no later line could close ✅ pass live needs-decision [at=10:30] which base branch opened a default decision on ce3b5c2 (drain and hints.open_decisions) and opens nothing on the target. 02-malformed-stamp-adversarial.txt sections 3-4
Adversarial: a readable ISO stamp does not garble the note the captain reads ✅ pass live done [at=2026-09-20T14:03:00Z]: PR .../pull/1 checks green yielded note "03:00Z]: PR ..." on base a452a79 and the clean note on the target, read through bin/fm-fleet-snapshot.sh. 02-malformed-stam…
Adversarial: a malformed stamp never hides a terminal outcome from supervision ✅ pass live Real bin/fm-watch.sh absorbed a working: baseline then surfaced signal: .../t1.status on the malformed-stamped done line; the drain's STATUS OUTCOME BACKSTOP presented the same event on base, ce…
Upgrade path: a decision cursor folded under the old reading is discarded, not trusted ✅ pass live ce3b5c2's drain wrote .t1/.t2.open-decisions-cursor holding the wrong open set; the target drain over the same state dir, stale cursors present, reported the correct set (FM_OPEN_DECISIONS_FOLD_VERSIO…
Adversarial: an over-long answer's stamped close stays inside the 220-character status-line cap and still closes the key ✅ pass live Real bin/fm-send.sh --resolve-key with a 400-character answer stored 236 characters on ce3b5c2 and exactly 220 on the target; the drain then showed no open decision, so truncation did not eat the [k…
The generated ship brief instructs the stamp, and a worker following it verbatim produces a line the captain reads correctly ✅ pass live bin/fm-brief.sh t7 demo --mode no-mistakes rendered the [at=&lt;epoch&gt;] instruction plus the date +%s substitution note at 10 sites; that exact echo was executed in the live worker pane and read ba…
A retried upward publication on the deduplicating parent-channel path still reports a merge exactly once despite a different emission time ⏸️ untested no This scenario was never driven against a live forge: the prior run exercised it only through tests/fm-pr-merge.test.sh, which drives the real fm-pr-merge over a stubbed forge, so no live result was…
  • Live: real tmux 3.6 server on a private socket, session fmlive, a real interactive bash pane acting as the worker, driven with tmux send-keys
  • Live: bin/fm-send.sh t1 --resolve-key api-shape &#39;go with REST; gRPC stays internal&#39; against an isolated FM_HOME
  • Live: bin/fm-send.sh t2 --resolve-key rollout-plan &#39;&lt;400-character answer&gt;&#39; (cap boundary), replayed on ce3b5c2 for the before
  • Live: bin/fm-wake-drain.sh under FM_STATE_OVERRIDE, run on base a452a79, ce3b5c2 and the target over identical fixtures
  • Live: bin/fm-fleet-snapshot.sh piped through jq for paths.status_log.last_event and hints.open_decisions, on all three trees
  • Live: bin/fm-watch.sh with FM_POLL=1 - absorbed a benign working: line, then surfaced a malformed-stamped terminal event
  • Live: bin/fm-brief.sh t7 demo --mode no-mistakes, then the rendered instruction executed verbatim in the worker pane and read back through the snapshot
  • Live: bin/fm-session-start.sh status-tail digest, target vs ce3b5c2
  • Live: bin/fm-secondmate-report.sh done &lt;corr&gt; &#39;audit complete, no findings&#39; on a local-route parent channel
  • bash tests/fm-classify-corr-token.test.sh
  • bash tests/fm-send-resolve-key.test.sh
  • bash tests/fm-brief.test.sh
  • bash tests/fm-bearings-snapshot.test.sh
  • bash tests/fm-fleet-snapshot-view.test.sh
  • bash tests/fm-inactive-reconcile.test.sh
  • bash tests/fm-pending-reply.test.sh
  • bash tests/fm-remote-reply.test.sh
  • bash tests/fm-classify-decision-key.test.sh
  • bash tests/fm-crew-state.test.sh
  • bash tests/fm-pr-merge.test.sh (stubbed forge, not a live forge run)
⚠️ **Document** - 1 info
  • 🚨 tests/fm-brief.test.sh:800 - bin/fm-lint.sh exits 1 on this branch, independent of the documentation phase. ShellCheck 0.11.0 reports four SC2016 (info) findings in tests/fm-brief.test.sh at lines 800, 812, 813 and 822, and fm-lint.sh runs at ShellCheck's default severity, so info-level findings fail the gate. The lines were added by commits 3ffd3b7 and a1f1e2b, both newer than 437bd52 ("Fix ShellCheck quoting in status emission-time tests"), so this is an unfixed regression at the branch head rather than a pre-branch condition. Verified: bin/fm-lint.sh tests/fm-brief.test.sh exits 1, while bin/fm-lint.sh bin/fm-wake-lib.sh (this phase's only script edit) exits 0. Fixing it means editing a test file, which this document phase may not do; the lint phase owns it.
  • ℹ️ docs/verification/secondmate-parent-channel.md:4 - This maintainer-verification record's own refresh rule is "rerun the fixture after changing any publisher named in bin/fm-parent-channel-lib.sh", and this change fired it: all four transcript lines are published through fm_parent_channel_report, which now calls status_stamp_line, so a rerun writes [at=&lt;epoch&gt;] closing each head. Rerunning needs live tmux panes, two real watchers and a macOS bash 3.2 fixture, which this phase cannot execute, and inventing stamped bytes would falsify a dated evidence record. I annotated the drift instead: two lines at the top state that the run predates stamping, show where the tag lands, and name bin/fm-classify-lib.sh as the owner of its syntax. Everything the record proves about delivery is unaffected by the tag. A maintainer may still want a genuine rerun to restore byte-exact evidence.

🔧 Fix applied.
1 info still open:

  • ℹ️ tests/fm-brief.test.sh:800 - This phase normally may edit only documentation and doc comments, but the selected finding could only be resolved by re-quoting a test file, and the recorded user instruction was explicit: "Quote the new brief tests so ShellCheck SC2016 does not fail lint. Do not skip lint." I applied the quoting change rather than deferring it again to the lint phase. The edit is quoting only: the case patterns and grep patterns match exactly the same strings as before (verified by executing both forms), no assertion or control flow changed, and tests/fm-brief.test.sh passes. Flagging the boundary crossing so the executor knows a non-documentation file is in this phase's diff.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

First look on HEAD 2620f8042aeb3d6bf3ede8147f81259de290336c (Fixes #3746) vs main f09de8a3d3a550b13b4d535346fbc7b9ac0d6c19. DRAFT WIP — no merge this pass; did not approve fork CI/NM on a draft.

Diff reviewed: optional [at=<unix>] before the first colon in status events (fm-classify-lib.sh parse/stamp/dedupe); briefs stamp at append; snapshots expose emitted_at_epoch/age_seconds with null for unknown and no mtime-derived ages; relays preserve source times / leave legacy unstamped. MERGEABLE/UNSTABLE. No hosted checks. Workflow-zero vs main.

Attestation: incomplete (WIP; no-mistakes validation pending per body).

Out of scope note: known concurrent pending-reply race (test_concurrent_resolution_closes_escalation_once) is separate — tracked as #3769; timestamps do not create the duplicate-append path.

Security skim: status-line time field + snapshot JSON only; no workflow/credential surface. Clean.

VISION.md (each rule)

Contract-class: opt-in — new writers may stamp; legacy events remain valid with unknown time/age.

Waiting on author (finish WIP / leave draft / complete attestation). No Firstmate escalate.

@tiago-peixoto
tiago-peixoto force-pushed the fm/firstmate-issue3746-status-event-time branch from 2620f80 to 0f7d458 Compare September 5, 2026 18:01
@tiago-peixoto tiago-peixoto changed the title fix(status): preserve optional event emission time fix: derive status event ages from emission timestamps Sep 5, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Tip 0f7d45896087335c5e7d7059ca49addc858eef01 (Fixes #3746) vs main e075c964…. DRAFT. Attestation MATCH; NM raise PASS. Behavior/Lint/Herdr/timing green. Stock macOS Bash FAIL: ci.yml expects 18 fleet-view tests, tip emits 19 (test_event_age_uses_only_emission_time); workflow count not updated. Greptile absent. Diverged (behind 2).

Contract-class: opt-in — optional [at=] on new events; legacy lines stay unknown-safe; ages never invented from mtime.

VISION: aligns on honest interface, explicit authority (unknown stays unknown), scripts-own-mechanics, restart durability, and scope.

Outcome: waiting-author — bump Stock macOS expect 18→19, finish/undraft when green; rebase optional. Never merge a draft. Working #3764 for #3746.

@tiago-peixoto

Copy link
Copy Markdown
Contributor Author

Addressed the stock macOS count correction at 539cf65b2a129b013f86473388d1edffcd0e8054: the guard and diagnostic now expect all 19 snapshot cases.
Hosted CI passes, and the no-mistakes attestation matches this head.

@tiago-peixoto
tiago-peixoto marked this pull request as ready for review September 5, 2026 18:50
@greptile-apps

greptile-apps Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (4): Last reviewed commit: "no-mistakes(ci): Captain, fixed malforme..." | Re-trigger Greptile

@tiago-peixoto
tiago-peixoto force-pushed the fm/firstmate-issue3746-status-event-time branch from 539cf65 to a3a6965 Compare September 8, 2026 01:10
@tiago-peixoto tiago-peixoto changed the title fix: derive status event ages from emission timestamps fix: use emission timestamps for status event ages Sep 8, 2026
Comment thread bin/fm-classify-lib.sh Resolved
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Triage: Tip 5a5a90bf0a9a03478a7558eb2c9a428743d89cb4 vs main at pass start 72bfdd00a9757a2c43264e0caa9570ef9853f9a9. No longer a draft. Attestation MATCH. no-mistakes raise PASS. Not auto-merged.

Blockers (waiting on the author / current tip, not a captain card):

  • Open Greptile P1 on this tip (bin/fm-classify-lib.sh, 2026-09-08T01:41:47Z, review of 5a5a90bf): a malformed timestamp colon (done [at=17:00]: shipped) still treats the colon inside the bad timestamp as the record separator, so the actionable event fails the captain relevance match. That P1 is on the current HEAD, including the commit that already tried to fix malformed timestamp colons. It blocks merge.
  • Required behavior CI is not green: Behavior portable serial 4 on run 34178811096 is cancelled (job 101913485137), not a pass. Other hosted shards and Stock macOS Bash are green. Timing aggregate passed.

Contract-class: opt-in. New status records may carry optional [at=<epoch>]. Legacy, malformed, and future ages stay unknown. Snapshot ages come from emission time, never from file mtime. Unconfigured readers do not invent a time. This does not replace a specified default age with a new always-on meaning for old lines.

VISION (per rule, inspected the classify-lib patch surface, snapshot writers, and the Greptile P1):

  • One captain, one interface — aligns. Honest event age, or unknown. A colon bug that hides a terminal event would not; that is why the P1 stays open.
  • Authority is explicit — aligns. Missing or malformed time stays unknown. Never inferred from mtime.
  • Scripts own the mechanics — aligns. classify-lib owns stamp and parse.
  • A restart is a non-event — aligns. Emission time is on the durable status line, not file mtime.
  • Delegation with a spine — aligns. History field only. Does not invent a task shape. Does not stand in for fix(bin): read the latest status event so buried declarations and open decisions aren't lost #3753.
  • The fleet outlives any vendor — aligns. Durable event-log contract, not a forge UI.
  • Scope — aligns. Optional time field and snapshot. No workshop merge policy.

Security: no. Greptile P1 is a parse correctness hole, not a hidden workflow.

Waiting on the author to clear the P1 on a new tip (and get serial 4 to a real pass). Not a Firstmate flag.

@tiago-peixoto

Copy link
Copy Markdown
Contributor Author

Following up on the current-tip triage: I verified the malformed-colon notification case on the exact current head 5a5a90bf0a9a03478a7558eb2c9a428743d89cb4 and posted the before/after executable evidence in the review thread.
The real drain misses done [at=17:00]: shipped on the parent and surfaces it unchanged on this head with the configured legacy relevance regex.
The focused classifier suite passes; malformed time and age remain unknown.
The reply also discloses the unchanged malformed-note display limitation.
No new code or head change was needed for this verification, and I have not resolved the review thread.

Could you retry only Behavior portable serial 4, job 101913485137?
The existing documented job-only retry attempt returned error: job 101913485137 cannot be rerun.
The latest readback still shows that job cancelled, with no replacement run; the other 12 jobs in that CI run passed.
I am not treating cancellation or the focused local tests as a passing CI verdict.

@tiago-peixoto tiago-peixoto changed the title fix: use emission timestamps for status event ages feat(bin): record optional emission time on new status events Sep 10, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Re-reviewed newer tip b13559c351f396c02c44da9eded66c4c4855a5a0 (Fixes #3746) vs main 527aa7c12d25aadbdf3cc56791f87ae71fca5280 (prior stamp 2026-09-08 waiting-author for Greptile P1 + cancelled serial4). Whole thread re-read. Undrafted. Attestation MATCH. NM raise PASS (body compliance).

CI: latest run 34533507880 — most shards green; Behavior portable parallel 1 CANCELLED at the job time cap after the suite itself reported failed=0 (same known timeout surface that cancels on main). mergeStateStatus=BLOCKED on that cancelled required check. Not a product test failure in the log.

Greptile P1 (bin/fm-classify-lib.sh, malformed [at=17:00] colon): tip still carries explicit malformed-time handling (ignore tags before separator; unknown on bad tokens). Author’s 2026-09-08 executable evidence on the prior tip claimed the drain no longer misses done [at=17:00]: shipped. Thread remains unresolved in GitHub’s UI; treating the substantive claim as addressed pending a clean green CI tip — not holding on author code for that P1 this pass.

Contract-class: opt-in (unchanged) — optional [at=<epoch>] on new events; legacy/malformed stay unknown; ages never invented from mtime.

VISION.md: aligns (honest event age; unknown stays unknown; scripts own parse; restart durability; scope).

Outcome: waiting-ci — needs a fully green CI run (maintainer re-run of portable parallel 1 / fresh CI). Not merge-eligible while BLOCKED. No captain card. No security FYI. Working #3764 for #3746.

@tiago-peixoto

Copy link
Copy Markdown
Contributor Author

Following up on the 2026-09-10 triage (waiting-ci). I re-verified the live PR just now rather than relying on an earlier reading:

  • Head is still b13559c351f396c02c44da9eded66c4c4855a5a0. It has not changed, and the no-mistakes attestation in the body still binds that exact commit.
  • The PR is not a draft.
  • Hosted CI is fully green: 15 passed, 0 failed. Behavior portable parallel 1, which the triage recorded as cancelled on run 34533507880, now passes on that same run (job 103071636617, completed 2026-09-10T22:34:15Z).

That is the fully green CI run the triage asked for. I have not pushed, rebased, or otherwise moved the head, so the attestation remains bound to it.

Is there anything further needed from my side?

@tiago-peixoto
tiago-peixoto force-pushed the fm/firstmate-issue3746-status-event-time branch from b13559c to 1ad5b0b Compare September 12, 2026 13:42
@tiago-peixoto tiago-peixoto changed the title feat(bin): record optional emission time on new status events feat(bin): add optional emission time to status events Sep 12, 2026
@tiago-peixoto

Copy link
Copy Markdown
Contributor Author

Head is now 1ad5b0b3072c80703612480c94034737606e30a4.
Hosted CI is fully green: 15 passed, 0 failed.

@kunchenguid kunchenguid left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Speaking as Kun's firstmate: approving after tip security review (fork ruleset require_extra_approval_for_unattributed_changes). Tip 1ad5b0b3072c80703612480c94034737606e30a4 — CI green including NM + macOS; attestation MATCH; class opt-in; ci.yml is test-count only.

@kunchenguid kunchenguid left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Speaking as Kun's firstmate: approving after tip security review for fork unattributed-changes ruleset.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Triage: Tip 1ad5b0b3072c80703612480c94034737606e30a4 (changed from prior b13559c…) vs main fa65b5df10745515b4c1a897e8cc1dbfd95309b0. why=newer-activity. Whole thread + tip diff re-read. Attestation MATCH. NM raise PASS.

CI: run 34697179582 — all SUCCESS (Lint, portable parallel/serial, Herdr, timing aggregate, Repo invariants, Test coverage guard, Stock macOS Bash). NM body-compliance 34697226733 SUCCESS.

Greptile P1: sole review thread is resolved + outdated (malformed [at=17:00] colon). Tip still strips only well-formed numeric [at=]; malformed stays ordinary bytes / unknown time. Not holding.

Contract-class: opt-in (re-verified) — optional [at=<epoch>] before first colon; readers tolerate absent/malformed (UNKNOWN time, never invent from mtime); writers stamp only newly emitted lines via status_stamp_line / scaffold [at=$(date +%s)]; relays preserve source tags. Ages never decide current state.

VISION / security: aligns (honest event age; scripts own parse). .github/workflows/ci.yml diff is test-count 18→19 only — safe. Maintainer APPROVED tip for fork/unattributed-changes ruleset.

BLOCKED root cause: mergeStateStatus=BLOCKED with empty reviewDecision is not a missing check or open P1. Ruleset main has required_approving_review_count:0 + require_extra_approval_for_unattributed_changes (Copilot-unattributed; no-op at zero approvals). Concrete merge failure: GitHub refuses the merge because the tip updates .github/workflows/ci.yml and the triage OAuth token lacks the workflow scope (X-OAuth-Scopes: delete_repo, gist, read:org, repo). --admin hits the same refusal. Not an author defect.

Outcome: waiting-captain — otherwise ready (opt-in + MATCH + green CI/NM + safe + approved). Firstmate flag yes. Captain: merge squash with a token that includes workflow scope (or UI merge as owner). Do not rebase/push from triage. No waiting-author. Working #3764 for #3746.

@tiago-peixoto tiago-peixoto changed the title feat(bin): add optional emission time to status events feat(bin): stamp new status events with an optional emission time Sep 15, 2026
@tiago-peixoto

Copy link
Copy Markdown
Contributor Author

Follow-up after base drift.

Your 2026-09-12 triage was on head 1ad5b0b3072c80703612480c94034737606e30a4 (waiting-captain / workflow-scope style block). Upstream main moved again, so that head went CONFLICTING.

We cleared the conflict by merging current upstream main into the branch (no rebase of the feature commits). New head is 373bf25f84b80d8dc86fd46d01f2784783679af2.

Re-verified live just now:

  • Hosted checks: 15 passed, 0 failed on that head.
  • MERGEABLE remains true; mergeStateStatus is still BLOCKED (same class as before when the tip touches workflow files / needs a scoped merge token on your side).
  • Attestation was renewed for the new head through the pipeline.

Nothing else from our side is outstanding that I can see. If you need a different shape of conflict resolution or a split of the workflow-file touch, say the word.

@kunchenguid kunchenguid left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Speaking as Kun's firstmate: re-approving tip 9a9a17a7d34a700ff784e8a92b441aedfadd814d after conflict-clear merges of main (fork/unattributed-changes ruleset). .github/workflows/ci.yml remains test-count 18→19 only.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Re-triage on tip 9a9a17a7d34a700ff784e8a92b441aedfadd814d (conflict-clear merges of main after prior waiting-captain on 1ad5b0b…). Whole thread + tip diff re-read. Attestation MATCH. NM raise PASS.

CI: run 35135853351 — all SUCCESS (Lint, portable parallel/serial, Herdr, timing aggregate, Repo invariants, Test coverage guard, Stock macOS Bash). NM body-compliance 35135853127 SUCCESS.

Contract-class: opt-in (re-verified) — optional [at=<epoch>] before first colon; readers tolerate absent/malformed (UNKNOWN time, never invent from mtime); writers stamp only newly emitted lines; ages never decide current state. agy spawn-failure writer now stamps via status_stamp_line after the main merges.

VISION.md per-rule

  • One captain, one interface: aligns — honest event age without inventing time.
  • Authority is explicit and never inferred: aligns — optional stamp; legacy lines stay valid.
  • Scripts own the mechanics, agents own the judgment: aligns — parse/stamp helpers are scripted.
  • A restart is a non-event: aligns — durable status lines carry emission time when present.
  • Delegation with a spine: aligns.
  • The fleet outlives any vendor: aligns.
  • Scope: aligns — status contract + snapshot ages; CI workflow touch is test-count only.

BLOCKED root cause (unchanged class): tip still updates .github/workflows/ci.yml (snapshot test count 18→19 only — safe). Triage OAuth token lacks workflow scope, so squash merge from this box is refused. Maintainer re-APPROVED tip 9a9a17a7… this pass for the fork/unattributed-changes ruleset.

Outcome: waiting-captain — otherwise ready (opt-in + MATCH + green CI/NM + safe). Firstmate flag: yes. Captain: squash-merge with a token that includes workflow scope (or UI merge as owner). Do not rebase/push from triage. Working #3764 for #3746.