Repository navigation
fix(backends): preserve archived Claude activity on restore - #4023
Conversation
|
Bounded caller reproduction: a temporary offline fixture connected real |
|
Refreshed candidate head Refreshed collision scan: closure with #3056; closure with #3059; closure with #3069; closure with #3116; closure with #3437; closure with #3581; closure with #3622; closure with #3806; closure with #4002; closure with #4008; closure with #4012; textual with #4018; closure with #4021; closure with #4022. |
|
Refreshed candidate head Current collision scan: closure with #3056; closure with #3059; closure with #3069; closure with #3116; closure with #3437; closure with #3581; closure with #3622; closure with #3806; closure with #4002; closure with #4008; textual with #4018; closure with #4021; closure with #4022. |
|
Candidate checkout evidence for confirmation run 43736220100, attempt 1:
|
|
Merged as Fetched squash identity: parent Automatic main push run 43738678603 is now running on the squash; its heavy proof is pending and is not yet claimed passing. |
|
Observed again on #4023's automatic main run 43738678603, squash At 17:12:15 UTC, The shard records 1688 pass / 8 skip / 1 fail in that worker. A sibling worker is then interrupted (exit 143); its visual-dictation config probe reports a null child exit during that cancellation. That secondary diagnostic is retained here without claiming a separate root cause. No failed job was rerun, no test or gate was changed, and no correction to this issue was attempted under #3790. This remains the existing unscheduled follow-up with no release milestone, under the run's maintainer ruling for intermittent failures. |
|
Completed in #4023, squash Proof: 18 archive tests pass; the original timestamp mutation and directory-mtime mutation fail their intended regressions. Local check:pr and complete selected hosted candidate proof passed in run 43736220100. The automatic main run 43738678603 is complete: all runtime/native-host, browser, layout, captures, endurance, types and packaging categories passed; unit shards 1, 2 and 4 passed. Unit shard 3 hit the existing intermittent Apify leading-dash reference failure #3689, so aggregate main proof is failed, not green. Evidence is posted on that existing unscheduled issue; no job was rerun, gate weakened or unrelated fix attempted. Local native-host comparison evidence is on existing #4005. No new follow-up issue was needed. All candidate and main job checkout logs were checked against their actual candidate/squash identities. PR and issue retain milestone 0.45.0, this issue is closed, and no blocked dependants were found. Main-status had no open incident record at the final inspection; any automatic incident coordination remains with the repository coordinator. No #3790 work remains open. |
Closes #3790
What changed
Restoring archived Claude transcripts retains the manifest's original
lastActiveAton files and subordinate directories. History reads keep the original session-list position, a resumed CLI append advances activity normally, and a history-only restore remains eligible for the next daily archive sweep. Archive bytes, ownership checks and crash recovery remain intact.Why this shape
The existing manifest already carries the activity timestamp, so no archive-format or public-contract change is needed. Directories also need their timestamps reset after file publication because the idle scan includes them.
Caller investigation:
openScratchPins().refreshinpackages/ui-server/src/cron/scratch-pins.tsenumerates every backend session and callsbackend.getHistorybefore pruning, including archived sessions.startScratchPruneinvokes this at boot and hourly. These reads need transcript content to preserve referenced scratch files, so suppressing them would compromise retention. Lists and labels do not restore by themselves; the archive sweep restores only entries already markedrestoringafter an interrupted restore. This identifies a source-backed background restore path; historical production traces are unavailable to prove which invocation produced each reported cluster.Proof
1781179200000, while restore stamped the current clock.RESTORE_RETAINS_ACTIVITY_TIMEandRESTORE_DOES_NOT_RESET_IDLE_THRESHOLDfailed at their intended assertions.utimesSync(now)produced the same 3 failures; retaining fresh directory mtimes produced 2 archive-eligibility failures. Both mutations were restored.@schlessera/brain-backend-claude; pending changeset validation and the full lockstep release plan pass.{"version":1,"kind":"brain-check-pr-receipt","head":"fbfb1dc8f23afb5ba4ae01d0252c3413020a83a1","base":"origin/main","mode":"focused","startedAt":"2026-11-15T15:50:07.711Z","finishedAt":"2026-11-15T15:50:49.661Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":12372.169945},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":100.98609900000156},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":68.31482599999799},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":17.297013999999763},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":29375.814050999998}]}Checklist
Anything left open
No issue-scope work. Existing local native-runtime environment failures are reported separately from archive proof and require hosted verification.