Repository navigation
feat: report and archive stale worker records - #8035
Conversation
[Medium impact] No new blocking issue was established in this review. Reviews (24) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
|
Speaking as Kun's firstmate: thank you @Dematom1, this round covers a lot of ground. On head Waiting on you for one thing: the two "live" rows in the body are Contract-class (my own read): new-default. Every unconfigured session start now runs this report, and it moves state files without being asked. So once the live evidence is in and the Full suite is green, Kun decides whether the archive step ships on by default. That part is waiting on Kun, not you. VISION: it mostly aligns. Surfacing stale records helps nothing fall through the cracks, and the work is script-owned. The open question for Kun is "new capability ships as an option to enable", since the archive moves files by default. It's reversible (moved, not deleted), and detect-only stays read-only. Separately, |
25424c2 to
0fad18a
Compare
|
Speaking as Kun's firstmate: thank you @Dematom1 for the real session-start run. That's exactly what I asked for. On What's new since my last note: the report now also runs on every watcher heartbeat ( Waiting on you for one thing: the heartbeat path is the part that wakes the first mate. Your table says the full watcher loop wasn't driven, and the stale-marker row is an isolated test. When you can, could you run a real Optional: Contract-class: still new-default (my own read), now with two default-on surfaces: the session-start archive move, and a new heartbeat wake. VISION: it mostly aligns. It's script-owned, deduplicated and bounded, and stale records stop falling through the cracks. Whether both ship on by default, given "new capability ships as an option to enable", is Kun's call once the live run is in and the Full suite is green. That part waits on Kun, not you. |
72adec2 to
4183455
Compare
|
Speaking as Kun's firstmate: thank you @Dematom1, this round closes everything I asked about. The heartbeat rows now come from a real watcher in a disposable lab home: one hygiene wake, the unchanged repeats suppressed, and the orphan left in Waiting on you for one small thing: Greptile's newest P2 on Contract-class (my own read): still new-default. It has two default-on surfaces: the session-start archive move, and the heartbeat |
2355294 to
842dbda
Compare
|
The Full suite check stopped at the maintainer go-ahead gate: this PR has no |
|
Speaking as Kun's firstmate: thanks @Dematom1. On head Waiting on you for one small follow-up: Greptile's new P2 "Archival is no longer tested" is right. The test now calls Contract-class: new-default (unchanged: the session-start archive move and the heartbeat |
842dbda to
a6fc47d
Compare
|
maintainer-gated: Full suite runs only after the maintainer adds full-ci; no lanes ran. On head |
The session-start record-hygiene report, its orphan status-log archiving, and the watcher heartbeat scan now run only when the home-local config/record-hygiene presence flag exists. Without it, session start and the heartbeat behave as before the feature: no report, no file moves, and no record reads for it.
The record-hygiene archive moved an orphan status log with mv, which keeps its old modification time. With config/status-archive also enabled, the next teardown's 30-day prune deleted an already-old orphan right after it was archived. Touch the archived file so retention counts from archive time, and cover the combined case with a teardown test.
6d8d4de to
a476495
Compare
…lock non-blockingly, recheck metadata/file/mtime under lock, and release the lock on all archive paths. Added coverage for held-lock skipping and lock cleanup. `tests/fm-bootstrap.test.sh` passed the hygiene cases but emitted a stray `\: command not found` from the newly added continuation (corrected); the full script later timed out at 120s, so rerun verification
|
Speaking as Kun's firstmate: thanks @Dematom1. Where it stands at head
Waiting on you (author), two things:
Then please re-raise through |
Point ShellCheck at bin/fm-wake-lib.sh for the archive path's lazy source, run the held-lock test with record hygiene enabled and assert the scan still reports the orphan, check the real fm_meta_lock_path cleanup path, and cover a spawn publishing metadata between the absence check and the move.
…riant: if refreshing an orphan log’s archive mtime fails, the code attempts to restore it to live state and reports the failure. `tests/fm-bootstrap.test.sh` and `tests/fm-parent-channel-scan-exclusion.test.sh` pass; `git diff --check` passes. The provided CI excerpt omits the actual failed test’s diagnostic, so it does not establish that this change caused the shard failure; the Full suite failure shown is downstream of a failed lane
… and fix SC2153 Revert 89f9229, an unrequested CI auto-repair that changed archive behavior without a regression test. Mark DATA as set by the sourcing script on its first use in the archive path: following bin/fm-wake-lib.sh through the source directive made ShellCheck raise SC2153 there.
|
Speaking as Kun's firstmate: thanks @Dematom1. One item left, in this PR's own code: the labelled run 42865348882 fails
|
|
Head is now
|
|
Speaking as Kun's firstmate: thanks @Dematom1. Nothing here is waiting on you. The two non-green lanes in that run aren't from this PR:
The Full suite needs a fresh run against current main, and that's on our side. |
…ygiene # Conflicts: # bin/fm-watch.sh
|
Speaking as Kun's firstmate: this is merged. Thank you @Dematom1 — really appreciate you taking the time on this. |
Intent
U5 of the worker-hygiene report, approved by the captain as its own narrow upstream PR: a record hygiene report at session start and on the heartbeat scan. List status logs with no meta older than 24 h, In-flight rows with no meta, metas with no tab, and duplicate pr= across the home's own records; archive orphan status logs under data//status.log (the status-archive destination teardown already uses) and print the rest. A report plus that one archive action, not a sweeper; each home runs it only over its own records.
What Changed
pr=values in each home’s records.data/<id>/status.log; report other hygiene findings without sweeping or modifying them.Risk Assessment
Testing
Ran the supplied live lab against real bootstrap, watcher, and wake-drain scripts using isolated synthetic homes; all three scenarios passed with
total: 0 failed. Removed the temporary lab from the worktree and retained its transcript as evidence.total: 0 failed.Evidence: Live record-hygiene lab output
Source: Live record-hygiene lab output
Opt-in
This change is opt-in. It is off by default; enable it per home with
touch config/record-hygiene(home-local, not inherited by second mates). The record-hygiene report and orphan status-log archiving run at session start and on the heartbeat only when this flag exists. Without it, session start and heartbeat are unchanged and nothing is moved. See theconfig/record-hygienesection indocs/configuration.md.Risk Assessment
Testing
Ran the targeted bootstrap test file and drove the real watcher/wake-drain heartbeat flow against an isolated home. The provided heartbeat lab omitted its opt-in flag and initially failed; adding the flag only to the disposable lab produced all expected live checks. No screenshot applies. Bootstrap and concurrent publication remain untested live, so verdict is inconclusive.
bash .lab-live/heartbeat-hygiene-lab.sh(corrected disposable config opt-in); output:~/.no-mistakes/evidence/01M76YVCWYW51MRTKWYN9TV1K6/heartbeat-hygiene.txtEvidence: Heartbeat hygiene live lab
Source: Heartbeat hygiene live lab
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-record-hygiene-lib.sh:46- After moving an orphan status log, a failedtouchis only logged and the old mtime remains. The status-archive prune can then delete the archive immediately, losing the record despite the retention behavior this change intends. Treat the refresh failure as an archive failure and restore/preserve the source or another safe outcome. Same invariant: bin/fm-record-hygiene-lib.sh:46-50 (archive refresh and failure handling).bin/fm-watch.sh:1- The supplied heartbeat lab initially failed because it never created config/record-hygiene, so the opt-in worker did not run. After correcting only that disposable lab setup, all heartbeat checks passed. No product change was made.tests/fm-bootstrap.test.sh:299- Session-start hygiene archival/reporting and the concurrent spawn-publication boundary were covered by tests in tests/fm-bootstrap.test.sh, but not driven live in this run. A live bootstrap setup and actual concurrent publication scenario are still needed to demonstrate those behaviors end-to-end.bash .lab-live/heartbeat-hygiene-lab.sh(corrected disposable config opt-in); output:~/.no-mistakes/evidence/01M76YVCWYW51MRTKWYN9TV1K6/heartbeat-hygiene.txtbash ~/.treehouse/agent-workspace-b8697d/3/agent-workspace/data/fm-hyg-u5-record-hygiene/heartbeat-hygiene-lab.sh(initially failed; lab omitted opt-in flag)Corrected disposable heartbeat lab under.lab-live/; retained output in evidence directorybash tests/fm-bootstrap.test.shgit status --shortand transient-lab cleanup check✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.