Repository navigation
fix(pod): bound the macOS and Linux boot failure tail to the current start - #21793
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS On Linux, the mark is the CLI's wall-clock time. If NTP steps the clock back between the mark and the pod's boot, this start's own lines are dropped from the failure tail. [DESIGN-REVIEWED] 451839b Description read[DESCRIPTION-READ] f2e694f6fd09924bec6041d2c813f28af028a6e3c309f68f25104e63587974b3 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The macOS byte-offset bound was tested only against a faked launchd. Run one failed What this change shipsInventory (6 items) — 6 justifiedIntent: a developer whose
[FIRST-PRINCIPLES-REVIEWED] 451839b Description read[DESCRIPTION-READ] 0de7118bc526c2b7e0e5ccd81bbadf3c2b15db4cfe05e051965d2c30064999c6 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
Backend Tests (3.12, 1) and Backend Tests (Windows) (1) fail on |
ef742d3 to
451839b
Compare
|
|
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Every review lane on the head is clean (only runner notices and PR Scope size warnings); held by the triage cron on size or path rules alone. Approved on the watch holder's request.
Problem / Motivation
Goal: A failed
kirocrew pod upon macOS or Linux shows only this start's log, never an earlier start'sFATAL, as the cause.When
pod upcannot get a pod healthy it prints the pod's log tail as the cause. On Windows that tail is already bounded to the current start. On macOS and Linux it is not:StandardOutPath/StandardErrorPath, andlaunchd.recent_journaltails the whole files.journalctl --user -u <unit> -n <lines>returns the unit's earlier invocations too.So a start that wrote nothing (or failed for a new reason) can print an earlier start's
FATAL: no built distas its cause.Why it matters
A developer reads the printed
FATALand fixes the wrong thing: the line is from an earlier boot, not this one. The Windows fix closed this for one backend; the other two still mislead.Not a goal
pod logsshows. It still prints the whole log, earlier starts included.pod upfails, stops, or reclaims a pod. Only the text of the failure tail changes.What changed (motivation → approach → change)
Symptom: when
kirocrew pod upfails on macOS or Linux, the log it prints as the cause includes lines from an earlierpod upof the same pod. Cause:runtime.journal_markreturned a mark only on Windows, sorecent_journal(..., since=mark)had nothing to bound by elsewhere.journal_marknow marks on every backend. macOS marks the two log files' byte sizes, like Windows. Linux marks the wall-clock time in microseconds.recent_journalon macOS reads only bytes past the mark. A start that wrote nothing gets the same "no pod log from this start" line Windows prints.journalctl --since=@<seconds>.<micro>. A mark without that key adds no bound.pod/log_mark.py, used by both file backends.pod/README.md: one paragraph under the backend table covers all three backends; the Windows-only note it replaces is removed.Backwards compatibility
Compatible:
journal_markreturnedNoneoff Windows and now returns a dict; its only caller (pod up) passes it straight torecent_journal, which accepts both.pod logscallsrecent_journalwithout a mark and is unchanged.Removes nothing: no path, key, record or function is removed; only the failure tail is narrowed to this start.
Tests
test/test_pod_launchd.py: an earlier start'sFATALis left out (with a no-mark negative control), this start'sFATALis kept, absent logs mark at 0, and the runtime facade threads the mark through launchd.test/test_pod_journal_since.py(new): journalctl is faked with a journal that honours--since=@<s>; an earlier start'sFATALis left out, this start's is kept, the exact--sinceargument is pinned, and a file-backend mark adds no bound.test/test_pod_windows.py: the off-Windowsjournal_marktest now pins the systemd mark shape and that the Windows backend is not called.Red/green: with the production files reset to
origin/main, the 6 new macOS/Linux tests fail; with the fix all pass. Determinism (testing-conventions D12): the 13 mark tests pass 20/20 at-n0, the three files pass 10/10 at-n 4, and the 13 pass in a shuffled order.test/test_pod*.pyrelated set: 750 passed.Manual verification
On this Linux host (systemd 252),
journalctl --user --since=@<epoch>.<micro>accepts the fractional form and returns only later entries. No real macOS run: launchd is faked, as in the rest oftest_pod_launchd.py.Related Issues
Closes #21731
Context: #21571 (Windows variant), fixed by #21729.
Pattern harvest
Not generalizable: the class (a tail of an append-only log read across runs) is already covered by one helper now shared by every pod backend; there is no other reader of these logs.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)