Skip to content

Restore native automatic archiving [BEAR-110] - #115

Merged
mergify[bot] merged 2 commits into
mainfrom
codex/BEAR-110-automation-archive
Aug 3, 2026
Merged

Restore native automatic archiving [BEAR-110]#115
mergify[bot] merged 2 commits into
mainfrom
codex/BEAR-110-automation-archive

Conversation

@ericlitman

@ericlitman ericlitman commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Description

  • restore automatic archival through one owned hourly Luna heartbeat and supported native task controls
  • add a deterministic prepare/mutate/reconcile boundary with one durable pending operation, an ownership ledger, guarded cancellation, and ownership-only restore
  • keep maintenance paused through migration, detect manual native restores, refuse uninstall during pending native work, and reconcile archived rows even when their preview is empty
  • update the installed skill, friendly install copy, help/status, architecture, homepage, changelog, and maintainer shipping contract

This preserves the useful safety invariants from BEAR-10 / PR #9 (77c640b, 91cf3a4) without reviving its LaunchAgent, App Server writer, classifier, or cycle machinery.

Release note

ThreadBear can once again tuck completed tasks into the archive after 14 quiet days and bring ThreadBear-owned archives back through native Codex controls.

Review

  • Fable architecture gate: Ship after adding update-last ordering and an honest line-budget plan for BEAR-111
  • Review Agent pass 1: fixed guarded pending-operation recovery, manual native restore detection, migration-paused automation lifecycle, and preview-independent archive reconciliation
  • Review Agent pass 2: no findings
  • Open SWE Review at 46400e24: fixed nullable native-row scanning and post-mutation archive drift adoption
  • Review Agent pass 3: fixed candidate-filter drift hiding exact pending IDs; final pass no findings
  • Revised Fable completion gate: Ship
  • shipped executable logic: 1,480 lines (target 1,000; absolute ceiling 1,500)

Live native proof

Revised candidate 900ba5756ae9aef1953fdeeb5c70376676dd496e7030f2287c0f7f7789e4656a exercised real local Codex tasks through supported native controls.

  1. migration_pending rejected maintenance.
  2. A deterministic one-day plan selected only the exact completed user task and staged one archive operation.
  3. Confirmed uninstall refused while the native archive was pending.
  4. set_thread_archived(..., archived:true) returned the exact task ID; reconciliation committed ThreadBear ownership and native SQLite readback was archived=1.
  5. Restore staged one operation; set_thread_archived(..., archived:false) returned the exact task ID; reconciliation removed ownership, cleared pending state, and recorded a fresh quiet clock.
  6. The closing no-target plan returned no candidates, SQLite readback was archived=0, and the task retained its unchanged managed title.
  7. A second real canary staged archive activity at 2026-08-01T18:50:49.74719542Z, then received a real background user turn before the stale native archive call.
  8. Reconciliation rejected the now-applied archive as drifted, left ownership empty and the exact pending snapshot intact, and refused cancellation while the task remained archived.
  9. Native unarchive followed by the exact guarded cancel recovered the operation; final SQLite/native state was unarchived with the exact title unchanged and no pending or owned archive.

No task was opened or selected, and no visual inspection or computer use was involved.

Test plan

  • go test ./...
  • go test -race ./...
  • go vet ./...
  • Darwin arm64 and amd64 cross-builds
  • sh -n install.sh
  • cmp install.sh site/install.sh
  • cmp INSTALL.md site/install
  • python3 scripts/validate-experiments.py
  • git diff --check
  • go test ./cmd/threadbear -run TestShippedLogicStaysBelowAbsoluteLineCeiling -v

Linear: BEAR-110

@mobilyze-open-swe-studio2 mobilyze-open-swe-studio2 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Open SWE Review found 2 potential issues.

Open in Web

Comment thread cmd/threadbear/maintenance.go Outdated
Comment thread cmd/threadbear/maintenance.go
@mergify

mergify Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-08-03 20:09 UTC · Rule: default · triggered by merge protections
  • Checks skipped · PR is already up-to-date
  • Merged2026-08-03 20:10 UTC · at 70e8f76b095ef539256b7e2acb74ece8fb307d5e

This pull request spent 40 seconds in the queue, including 8 seconds running CI.

Required conditions to merge
  • github-review-approved [🛡 GitHub repository ruleset rule Mergify automatic merge queue]
  • all of [🛡 Merge Protections rule Queue ready pull requests]:
  • any of [🛡 GitHub branch protection]:
    • check-success = verify
    • check-neutral = verify
    • check-skipped = verify
  • any of [🛡 GitHub branch protection]:
    • check-success = Open SWE Review
    • check-neutral = Open SWE Review
    • check-skipped = Open SWE Review
  • any of [🛡 GitHub repository ruleset rule Mergify automatic merge queue]:
    • check-success = @mergify/Mergify Merge Protections
    • check-neutral = @mergify/Mergify Merge Protections
    • check-skipped = @mergify/Mergify Merge Protections

@mergify
mergify Bot merged commit 8fa6411 into main Aug 3, 2026
4 checks passed
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