Clarify guarded restore steps and pin recovery behavior #95

Closed
svc-svd-writer wants to merge 1 commit from feat/svd-dev-messages-mind-mcp-92-restore-steps-follow-ups-fr-8591db27 into main
Collaborator

Split the launchd recovery procedure into four gated blocks, preserve newer Forgets by restoring the moved Tombstone store, and document sidecars and export durability. Add document pins and synthetic recovery and lock-path tests.

Docs change (operator-visible): the restore steps are four blocks (stop and check, move, Rebuild, restart); the restore rule keys on the printed code; the Tombstone store's sidecar is -journal; block 3 restores from the moved-aside Tombstone store; the steps stop and start the api with sync.

Round 2 (spec rows I1 to I11)

This PR replaces #94, which closed without merge after two fresh reviews (spec commit af0bf69 in the groupthink exhaust repo).

  • I1: block 3 restores from the old Tombstone store that block 2 moved aside. The first pass merges the configured export, so the restored store holds the Forgets of both. test_a_rebuild_from_the_moved_aside_tombstone_store_keeps_forgets_newer_than_the_export proves it with synthetic fixtures.
  • I3: the restore rule has a sync=ok branch and a not run: a check failed branch.
  • I4: the README Rebuild paragraph points to the restore rule.
  • I5: block 1 stops the api and block 4 starts it.
  • I6: mkdir and the move loop are one && chain; the README placeholders are quoted.
  • I7, I8: exactly one section 6 sentence names RunAtLoad; each block is pinned whole.
  • I9, I10, I11: SECURITY note 20 without a loose fragment; the NAMESPACE sentence stands alone; the exit-0 check covers more wordings.

Decisions

  • Note 20: the export-directory fsync code fix is out of scope (no src/ edit) and is tracked in #93.
  • Note 22: the source-replaced and row-id-reused rows keep "move both aside and use a Rebuild". The export-less path belongs in the #88 runbook.
  • The launchctl print-disabled output form is unverified on a host. Block 1 matches both => disabled and => true. The operator confirms the form at the first install.
  • Section 9 Removal deletes the aside directories with the store directory. That is intended.
  • The item 17 mutant (moving replicas: 1 out of the Deployment) needs an edit to deploy/, which the spec keeps read-only; the dispatch did not apply it by hand.

Mutation log

The merge gate ran its own pass at 2ff56b0: 37 mutants, 37 killed. Each ran pytest tests/test_sync_documents.py tests/test_sync.py tests/test_store.py tests/test_layout.py -x. The M7 row names the item 9 test: M7 applied alone fails test_the_lock_is_keyed_on_the_mirror_path_as_the_config_writes_it.

Mutant Result First failing test
M7 sync.py: key the lock on mirror.resolve() killed tests/test_sync.py::test_the_lock_is_keyed_on_the_mirror_path_as_the_config_writes_it
M8a README: delete 'lasts only until the next login' killed tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section
H7b install: re-add the RunAtLoad repeat killed tests/test_sync_documents.py::test_install_section_6_repeats_no_sentence
I-M1a install: restore from the export killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M1b README: restore from the export killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M2a install: ; after mkdir killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M2b README: ; after mkdir killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M3a install: drop the not-run branch killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M3b README: drop the not-run branch killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M5a install: x=1 kickstart before the Rebuild killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M5b README: x=1 kickstart before the Rebuild killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M6 sync.py: drop merge_export in _run killed tests/test_sync.py::test_a_rebuild_from_the_moved_aside_tombstone_store_keeps_forgets_newer_than_the_export
I-M7a README: drop the api stop line killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M7b install: drop the api stop line killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M7c README: drop the api restart killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M7d install: drop the api restart killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M7e README: drop the api print-disabled check killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M8 README: join the NAMESPACE sentence killed tests/test_sync_documents.py::test_the_compose_and_kubernetes_restart_gates_are_pinned
I-M9a README: drop the fallback sentence killed tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild
I-M9b install: drop the fallback sentence killed tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild
I-M10 README: drop the Rebuild pointer killed tests/test_sync_documents.py::test_the_restore_rule_keys_on_the_printed_code
I-M11 SECURITY: loose (#93) killed tests/test_sync_documents.py::test_the_export_temp_file_and_fsync_limit_are_stated
I-M12 install: aside on the Desktop killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M13 install: mirror.db-wal -> tombstones.db-wal killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M14 SECURITY: exits with status 0 killed tests/test_sync_documents.py::test_the_restart_condition_is_the_tombstone_store_file
I-M15 SECURITY: drop the stale-export independence sentence killed tests/test_sync_documents.py::test_the_export_temp_file_and_fsync_limit_are_stated
I-M16 README: drop the block 3 merge sentence killed tests/test_sync_documents.py::test_the_restore_steps_pin_the_explanations
I-M17 install: drop the restore_from test killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M18 README: block 4 gate on EXPORT killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M19 README: unquote MIRROR in block 2 killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M20a README: drop the success sentence killed tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild
I-M20b install: drop the success sentence killed tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild
I-M21 install: drop the aside echo killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M22 install: restore_from names the Mirror killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M23 install: block 4 || true killed tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks
I-M24 README: aside sentence back to 'once sync runs again' killed tests/test_sync_documents.py::test_the_aside_directory_sentence_is_pinned
I-M25 install: drop the hand-run sentence killed tests/test_sync_documents.py::test_the_restore_steps_pin_the_explanations

Tests

  • Pristine base 205d5df: make check 1,505 passed, 58 skipped, 2 deselected.
  • Head: make check 1,517 passed, 58 skipped, 2 deselected.

Closes #92
Co-Authored-By: gpt-6.1-terra noreply@openai.com

Split the launchd recovery procedure into four gated blocks, preserve newer Forgets by restoring the moved Tombstone store, and document sidecars and export durability. Add document pins and synthetic recovery and lock-path tests. Docs change (operator-visible): the restore steps are four blocks (stop and check, move, Rebuild, restart); the restore rule keys on the printed code; the Tombstone store's sidecar is -journal; block 3 restores from the moved-aside Tombstone store; the steps stop and start the api with sync. ## Round 2 (spec rows I1 to I11) This PR replaces #94, which closed without merge after two fresh reviews (spec commit `af0bf69` in the groupthink exhaust repo). - I1: block 3 restores from the old Tombstone store that block 2 moved aside. The first pass merges the configured export, so the restored store holds the Forgets of both. `test_a_rebuild_from_the_moved_aside_tombstone_store_keeps_forgets_newer_than_the_export` proves it with synthetic fixtures. - I3: the restore rule has a `sync=ok` branch and a `not run: a check failed` branch. - I4: the README Rebuild paragraph points to the restore rule. - I5: block 1 stops the api and block 4 starts it. - I6: `mkdir` and the move loop are one `&&` chain; the README placeholders are quoted. - I7, I8: exactly one section 6 sentence names `RunAtLoad`; each block is pinned whole. - I9, I10, I11: SECURITY note 20 without a loose fragment; the `NAMESPACE` sentence stands alone; the exit-0 check covers more wordings. ## Decisions - Note 20: the export-directory `fsync` code fix is out of scope (no `src/` edit) and is tracked in #93. - Note 22: the `source-replaced` and `row-id-reused` rows keep "move both aside and use a Rebuild". The export-less path belongs in the #88 runbook. - The `launchctl print-disabled` output form is unverified on a host. Block 1 matches both `=> disabled` and `=> true`. The operator confirms the form at the first install. - Section 9 Removal deletes the aside directories with the store directory. That is intended. - The item 17 mutant (moving `replicas: 1` out of the Deployment) needs an edit to `deploy/`, which the spec keeps read-only; the dispatch did not apply it by hand. ## Mutation log The merge gate ran its own pass at `2ff56b0`: 37 mutants, 37 killed. Each ran `pytest tests/test_sync_documents.py tests/test_sync.py tests/test_store.py tests/test_layout.py -x`. The M7 row names the item 9 test: M7 applied alone fails `test_the_lock_is_keyed_on_the_mirror_path_as_the_config_writes_it`. | Mutant | Result | First failing test | | --- | --- | --- | | M7 sync.py: key the lock on mirror.resolve() | killed | `tests/test_sync.py::test_the_lock_is_keyed_on_the_mirror_path_as_the_config_writes_it` | | M8a README: delete 'lasts only until the next login' | killed | `tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section` | | H7b install: re-add the RunAtLoad repeat | killed | `tests/test_sync_documents.py::test_install_section_6_repeats_no_sentence` | | I-M1a install: restore from the export | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M1b README: restore from the export | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M2a install: ; after mkdir | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M2b README: ; after mkdir | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M3a install: drop the not-run branch | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M3b README: drop the not-run branch | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M5a install: x=1 kickstart before the Rebuild | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M5b README: x=1 kickstart before the Rebuild | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M6 sync.py: drop merge_export in _run | killed | `tests/test_sync.py::test_a_rebuild_from_the_moved_aside_tombstone_store_keeps_forgets_newer_than_the_export` | | I-M7a README: drop the api stop line | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M7b install: drop the api stop line | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M7c README: drop the api restart | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M7d install: drop the api restart | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M7e README: drop the api print-disabled check | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M8 README: join the NAMESPACE sentence | killed | `tests/test_sync_documents.py::test_the_compose_and_kubernetes_restart_gates_are_pinned` | | I-M9a README: drop the fallback sentence | killed | `tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild` | | I-M9b install: drop the fallback sentence | killed | `tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild` | | I-M10 README: drop the Rebuild pointer | killed | `tests/test_sync_documents.py::test_the_restore_rule_keys_on_the_printed_code` | | I-M11 SECURITY: loose (#93) | killed | `tests/test_sync_documents.py::test_the_export_temp_file_and_fsync_limit_are_stated` | | I-M12 install: aside on the Desktop | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M13 install: mirror.db-wal -> tombstones.db-wal | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M14 SECURITY: exits with status 0 | killed | `tests/test_sync_documents.py::test_the_restart_condition_is_the_tombstone_store_file` | | I-M15 SECURITY: drop the stale-export independence sentence | killed | `tests/test_sync_documents.py::test_the_export_temp_file_and_fsync_limit_are_stated` | | I-M16 README: drop the block 3 merge sentence | killed | `tests/test_sync_documents.py::test_the_restore_steps_pin_the_explanations` | | I-M17 install: drop the restore_from test | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M18 README: block 4 gate on EXPORT | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M19 README: unquote MIRROR in block 2 | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M20a README: drop the success sentence | killed | `tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild` | | I-M20b install: drop the success sentence | killed | `tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild` | | I-M21 install: drop the aside echo | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M22 install: restore_from names the Mirror | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M23 install: block 4 \|\| true | killed | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks` | | I-M24 README: aside sentence back to 'once sync runs again' | killed | `tests/test_sync_documents.py::test_the_aside_directory_sentence_is_pinned` | | I-M25 install: drop the hand-run sentence | killed | `tests/test_sync_documents.py::test_the_restore_steps_pin_the_explanations` | ## Tests - Pristine base `205d5df`: `make check` 1,505 passed, 58 skipped, 2 deselected. - Head: `make check` 1,517 passed, 58 skipped, 2 deselected. Closes #92 Co-Authored-By: gpt-6.1-terra <noreply@openai.com>
Clarify guarded restore steps and pin recovery behavior
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
2ff56b0017
Split the launchd recovery procedure into four gated blocks, preserve newer Forgets by restoring the moved Tombstone store, and document sidecars and export durability. Add document pins and synthetic recovery and lock-path tests.

Closes #92
Co-Authored-By: gpt-6.1-terra <noreply@openai.com>

This was generated by AI during the merge gate.

Closed without merge. The operator ruled on 2026-11-16 for a simpler round 3. Both fresh reviews of 2ff56b0 found the same blocker and reproduced it. A restore from the moved-aside Tombstone store fails for fixable reasons: a hot -journal (the source opens read-only), a version-1 store, Ctrl-C or a full disk. The restore rule then sent the operator to the export, which loses every Forget newer than the export. The security review also found that a leftover TOMBSTONES-journal beside a restored store silently empties it.

Round 3 gives two paths. Replace the Mirror keeps the Tombstone store in place: a plain open rolls back a hot journal and upgrades a version-1 store, so every Forget stays. Restore a lost Tombstone store is a Rebuild from the export, used only when no Tombstone store that opens is left, with every sidecar checked absent. The mutation pass at 2ff56b0 killed 37 of 37 mutants, and the host gate was green; those results do not carry over to the new design. Because codex-svd integrate cannot rework after a spec amendment (dev/stables#2219), #92 is dispatched again from main. A new PR replaces this one.

> *This was generated by AI during the merge gate.* Closed without merge. The operator ruled on 2026-11-16 for a simpler round 3. Both fresh reviews of `2ff56b0` found the same blocker and reproduced it. A restore from the moved-aside Tombstone store fails for fixable reasons: a hot `-journal` (the source opens read-only), a version-1 store, Ctrl-C or a full disk. The restore rule then sent the operator to the export, which loses every Forget newer than the export. The security review also found that a leftover `TOMBSTONES-journal` beside a restored store silently empties it. Round 3 gives two paths. **Replace the Mirror** keeps the Tombstone store in place: a plain open rolls back a hot journal and upgrades a version-1 store, so every Forget stays. **Restore a lost Tombstone store** is a Rebuild from the export, used only when no Tombstone store that opens is left, with every sidecar checked absent. The mutation pass at `2ff56b0` killed 37 of 37 mutants, and the host gate was green; those results do not carry over to the new design. Because `codex-svd integrate` cannot rework after a spec amendment (dev/stables#2219), #92 is dispatched again from `main`. A new PR replaces this one.
svc-agent-writer closed this pull request 2026-11-16 06:36:02 +00:00
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful

Pull request closed

Sign in to join this conversation.
No description provided.