Clarify guarded restore steps and pin recovery guidance #94

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

Split the launchd restore procedure into four gated blocks, document refusal codes, store sidecars and export recovery limits, and strengthen document and lock-path regression 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

Decisions

  • Note 20: the export directory fsync code fix is out of scope (no src/ edit). SECURITY states the limit, and the code fix is #93.
  • Note 22: the source-replaced and row-id-reused rows keep "move both aside and use a Rebuild". The export-less path (move only the Mirror and run a plain sync) belongs in the #88 runbook.
  • Block 1's launchctl print-disabled output form is unverified on a host: nobody ran the real launchctl. The check matches both => disabled and => true. The operator confirms the form at the first install.

Mutation table

Run by the merge gate on the host at 20d5538, one mutant at a time, each reverted after its run. Filter for every row: uv run python3 -m pytest tests/test_sync_documents.py tests/test_sync.py tests/test_store.py tests/test_layout.py -q -x.

Mutant Failing test
M7 sync.py: key the lock on mirror.resolve() tests/test_sync.py::test_the_lock_is_keyed_on_the_mirror_path_as_the_config_writes_it (run alone with -k; the -x run stopped first at test_a_symlink_loop_at_the_mirror_path_is_retried_with_tombstones_unreadable)
M8a README: delete 'lasts only until the next login' tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section
M8f-1 README Codes: delete 'If only the Mirror is moved' tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section
M8f-2 README Stop: delete 'If only the Mirror is moved' tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section
H1h README: delete the placeholder sentence tests/test_sync_documents.py::test_the_readme_placeholder_sentence_is_pinned
H4a-1 README Codes: delete the config-validation sentence tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section
H4a-2 README Stop: delete the config-validation sentence tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section
H4d-1 README Codes: delete the Mirror sidecar sentence tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section
H4d-2 README Stop: delete the Mirror sidecar sentence tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section
H7a install: repeat the LaunchAgents cause tests/test_sync_documents.py::test_install_section_6_repeats_no_sentence
H7b install: re-add the RunAtLoad repeat none; all 290 tests passed (survived)
I11a README: insert a plain sync --once before the Rebuild tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]
I11b README: insert a kickstart before the Rebuild tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]
I11c README: restart line ends in || true tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]
I11d README: restart line ends in ; true tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]
I11e README: restart gate on EXPORT tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]
I11f README: put launchctl enable into the Rebuild block tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]
I12a README: restart the api label tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]
I12b README: wrong plist path tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]
I13a README: drop the Compose restart gate tests/test_sync_documents.py::test_the_compose_and_kubernetes_restart_gates_are_pinned
I13b README: drop the Kubernetes restart gate tests/test_sync_documents.py::test_the_compose_and_kubernetes_restart_gates_are_pinned
I13c README: --replicas=1 -> --replicas=10 tests/test_sync_documents.py::test_the_compose_and_kubernetes_restart_gates_are_pinned
I14 SECURITY: add 'exits 0' restart rule tests/test_sync_documents.py::test_the_restart_condition_is_the_tombstone_store_file
I15 SECURITY: bare stop link tests/test_sync_documents.py::test_every_stop_the_sync_agent_link_resolves
I16 install: drop the section 6 bootout tests/test_sync_documents.py::test_the_documents_state_that_the_agent_restarts_after_a_stop
I17 k8s: replicas moved from the Deployment to another document tests/test_sync_documents.py::test_the_compose_dependencies_and_the_replicas_default_are_pinned
I3a README: disable; bootout instead of && tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]
I3b README: drop the launchctl print check tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]
I4a README: drop -journal from the move block tests/test_sync_documents.py::test_the_documents_say_to_move_the_store_files_and_keep_the_directory
I4b SECURITY: delete the Tombstone sidecar sentence tests/test_sync_documents.py::test_the_documents_say_to_move_the_store_files_and_keep_the_directory
I4c install: old '-wal and -shm' sentence back tests/test_sync_documents.py::test_the_documents_say_to_move_the_store_files_and_keep_the_directory
I1a README: delete the silent-gate sentence tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild
I1b install: delete the silent-gate sentence tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild
I1c README: drop tombstones-present from the code list tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild
I1d README: re-add 'exited non-zero, the restore succeeded' tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild
I1e README: delete the gate-runs-only sentence tests/test_sync_documents.py::test_the_restore_rule_keys_on_the_printed_code
I5a install: drop checkout from block 3 tests/test_sync_documents.py::test_the_install_restore_blocks_use_the_checkout_interpreter
I5b install: placeholder becomes tests/test_sync_documents.py::test_the_install_restore_blocks_use_the_checkout_interpreter
I5c install: bare messagesmind in block 3 tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text1-guard1-rebuild1-restart1]
I5d install: delete the block 3 lead-in tests/test_sync_documents.py::test_the_install_restore_blocks_use_the_checkout_interpreter
I6a README: delete the PATH sentence tests/test_sync_documents.py::test_the_readme_says_where_messagesmind_is_on_path
I6b README: break the install section link tests/test_sync_documents.py::test_the_readme_says_where_messagesmind_is_on_path
N19 README: delete the export temp file sentence tests/test_sync_documents.py::test_the_export_temp_file_and_fsync_limit_are_stated
N20 SECURITY: delete the fsync limit tests/test_sync_documents.py::test_the_export_temp_file_and_fsync_limit_are_stated
N21 install: delete the umask and exclusion sentence tests/test_sync_documents.py::test_the_moved_directory_umask_and_exclusion_are_stated
R3a README: delete the aside sentence tests/test_sync_documents.py::test_the_aside_directory_sentence_is_pinned
R3b install: drop 'Keep the old Tombstone store' tests/test_sync_documents.py::test_the_aside_directory_sentence_is_pinned
I23 README: <namespace> back tests/test_sync_documents.py::test_the_readme_names_how_to_stop_every_supervisor

47 of 48 mutants were killed. M7 is killed by the item 9 test, test_the_lock_is_keyed_on_the_mirror_path_as_the_config_writes_it. H7b survived: putting back "RunAtLoad starts the agent again at the next login or restart." repeats a rule in other words, and test_install_section_6_repeats_no_sentence catches only identical sentences. It goes to a follow-up issue.

Test results (host gate)

  • Base 205d5df: 1505 passed, 58 skipped, 2 deselected (make check).
  • Head 20d5538: 1514 passed, 58 skipped, 2 deselected (make check). All 18 scenario-table commands pass.

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

Split the launchd restore procedure into four gated blocks, document refusal codes, store sidecars and export recovery limits, and strengthen document and lock-path regression 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 ## Decisions - Note 20: the export directory `fsync` code fix is out of scope (no `src/` edit). SECURITY states the limit, and the code fix is #93. - Note 22: the `source-replaced` and `row-id-reused` rows keep "move both aside and use a Rebuild". The export-less path (move only the Mirror and run a plain `sync`) belongs in the #88 runbook. - Block 1's `launchctl print-disabled` output form is unverified on a host: nobody ran the real `launchctl`. The check matches both `=> disabled` and `=> true`. The operator confirms the form at the first install. ## Mutation table Run by the merge gate on the host at `20d5538`, one mutant at a time, each reverted after its run. Filter for every row: `uv run python3 -m pytest tests/test_sync_documents.py tests/test_sync.py tests/test_store.py tests/test_layout.py -q -x`. | Mutant | Failing test | | --- | --- | | M7 sync.py: key the lock on mirror.resolve() | `tests/test_sync.py::test_the_lock_is_keyed_on_the_mirror_path_as_the_config_writes_it` (run alone with `-k`; the `-x` run stopped first at `test_a_symlink_loop_at_the_mirror_path_is_retried_with_tombstones_unreadable`) | | M8a README: delete 'lasts only until the next login' | `tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section` | | M8f-1 README Codes: delete 'If only the Mirror is moved' | `tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section` | | M8f-2 README Stop: delete 'If only the Mirror is moved' | `tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section` | | H1h README: delete the placeholder sentence | `tests/test_sync_documents.py::test_the_readme_placeholder_sentence_is_pinned` | | H4a-1 README Codes: delete the config-validation sentence | `tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section` | | H4a-2 README Stop: delete the config-validation sentence | `tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section` | | H4d-1 README Codes: delete the Mirror sidecar sentence | `tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section` | | H4d-2 README Stop: delete the Mirror sidecar sentence | `tests/test_sync_documents.py::test_every_repeated_readme_sentence_is_pinned_in_each_section` | | H7a install: repeat the LaunchAgents cause | `tests/test_sync_documents.py::test_install_section_6_repeats_no_sentence` | | H7b install: re-add the RunAtLoad repeat | none; all 290 tests passed (**survived**) | | I11a README: insert a plain sync --once before the Rebuild | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]` | | I11b README: insert a kickstart before the Rebuild | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]` | | I11c README: restart line ends in `\|\| true` | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]` | | I11d README: restart line ends in `; true` | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]` | | I11e README: restart gate on EXPORT | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]` | | I11f README: put launchctl enable into the Rebuild block | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]` | | I12a README: restart the api label | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]` | | I12b README: wrong plist path | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]` | | I13a README: drop the Compose restart gate | `tests/test_sync_documents.py::test_the_compose_and_kubernetes_restart_gates_are_pinned` | | I13b README: drop the Kubernetes restart gate | `tests/test_sync_documents.py::test_the_compose_and_kubernetes_restart_gates_are_pinned` | | I13c README: --replicas=1 -> --replicas=10 | `tests/test_sync_documents.py::test_the_compose_and_kubernetes_restart_gates_are_pinned` | | I14 SECURITY: add 'exits `0`' restart rule | `tests/test_sync_documents.py::test_the_restart_condition_is_the_tombstone_store_file` | | I15 SECURITY: bare stop link | `tests/test_sync_documents.py::test_every_stop_the_sync_agent_link_resolves` | | I16 install: drop the section 6 bootout | `tests/test_sync_documents.py::test_the_documents_state_that_the_agent_restarts_after_a_stop` | | I17 k8s: replicas moved from the Deployment to another document | `tests/test_sync_documents.py::test_the_compose_dependencies_and_the_replicas_default_are_pinned` | | I3a README: disable; bootout instead of && | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]` | | I3b README: drop the launchctl print check | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text0-guard0-rebuild0-restart0]` | | I4a README: drop -journal from the move block | `tests/test_sync_documents.py::test_the_documents_say_to_move_the_store_files_and_keep_the_directory` | | I4b SECURITY: delete the Tombstone sidecar sentence | `tests/test_sync_documents.py::test_the_documents_say_to_move_the_store_files_and_keep_the_directory` | | I4c install: old '-wal and -shm' sentence back | `tests/test_sync_documents.py::test_the_documents_say_to_move_the_store_files_and_keep_the_directory` | | I1a README: delete the silent-gate sentence | `tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild` | | I1b install: delete the silent-gate sentence | `tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild` | | I1c README: drop tombstones-present from the code list | `tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild` | | I1d README: re-add 'exited non-zero, the restore succeeded' | `tests/test_sync_documents.py::test_the_rebuild_steps_restart_sync_only_after_a_successful_rebuild` | | I1e README: delete the gate-runs-only sentence | `tests/test_sync_documents.py::test_the_restore_rule_keys_on_the_printed_code` | | I5a install: drop checkout from block 3 | `tests/test_sync_documents.py::test_the_install_restore_blocks_use_the_checkout_interpreter` | | I5b install: placeholder becomes <path> | `tests/test_sync_documents.py::test_the_install_restore_blocks_use_the_checkout_interpreter` | | I5c install: bare messagesmind in block 3 | `tests/test_sync_documents.py::test_the_launchd_restore_steps_are_four_gated_blocks[text1-guard1-rebuild1-restart1]` | | I5d install: delete the block 3 lead-in | `tests/test_sync_documents.py::test_the_install_restore_blocks_use_the_checkout_interpreter` | | I6a README: delete the PATH sentence | `tests/test_sync_documents.py::test_the_readme_says_where_messagesmind_is_on_path` | | I6b README: break the install section link | `tests/test_sync_documents.py::test_the_readme_says_where_messagesmind_is_on_path` | | N19 README: delete the export temp file sentence | `tests/test_sync_documents.py::test_the_export_temp_file_and_fsync_limit_are_stated` | | N20 SECURITY: delete the fsync limit | `tests/test_sync_documents.py::test_the_export_temp_file_and_fsync_limit_are_stated` | | N21 install: delete the umask and exclusion sentence | `tests/test_sync_documents.py::test_the_moved_directory_umask_and_exclusion_are_stated` | | R3a README: delete the aside sentence | `tests/test_sync_documents.py::test_the_aside_directory_sentence_is_pinned` | | R3b install: drop 'Keep the old Tombstone store' | `tests/test_sync_documents.py::test_the_aside_directory_sentence_is_pinned` | | I23 README: `<namespace>` back | `tests/test_sync_documents.py::test_the_readme_names_how_to_stop_every_supervisor` | 47 of 48 mutants were killed. M7 is killed by the item 9 test, `test_the_lock_is_keyed_on_the_mirror_path_as_the_config_writes_it`. H7b survived: putting back "`RunAtLoad` starts the agent again at the next login or restart." repeats a rule in other words, and `test_install_section_6_repeats_no_sentence` catches only identical sentences. It goes to a follow-up issue. ## Test results (host gate) - Base `205d5df`: 1505 passed, 58 skipped, 2 deselected (`make check`). - Head `20d5538`: 1514 passed, 58 skipped, 2 deselected (`make check`). All 18 scenario-table commands pass. Closes #92 Co-Authored-By: gpt-6.1-terra <noreply@openai.com>
Clarify guarded restore steps and pin recovery guidance
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
20d55383a8
Split the launchd restore procedure into four gated blocks, document refusal codes, store sidecars and export recovery limits, and strengthen document and lock-path regression 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 one more round. Two fresh reviews of 20d5538 found two blockers:

  • Security. The restore steps restore from the export. When the export is out of date (a failed export not yet retried, or the power loss in #93), the restore loses the Forgets that are newer than the export, and Backfill copies those messages again. The reviewer reproduced it. The fix: block 3 restores from the Tombstone store that block 2 moved aside, and the first pass merges the export.
  • Correctness. Mutant H7b survives: putting back "RunAtLoad starts the agent again at the next login or restart." passes every test. That misses an acceptance criterion.

The spec for #92 now carries round 2 rows I1 to I11. They also stop and start the api with sync, chain mkdir with &&, quote the README placeholders, add a success branch to the restore rule, and pin each block whole. 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 one more round. Two fresh reviews of `20d5538` found two blockers: - **Security.** The restore steps restore from the export. When the export is out of date (a failed export not yet retried, or the power loss in #93), the restore loses the Forgets that are newer than the export, and Backfill copies those messages again. The reviewer reproduced it. The fix: block 3 restores from the Tombstone store that block 2 moved aside, and the first pass merges the export. - **Correctness.** Mutant H7b survives: putting back "`RunAtLoad` starts the agent again at the next login or restart." passes every test. That misses an acceptance criterion. The spec for #92 now carries round 2 rows I1 to I11. They also stop and start the api with sync, chain `mkdir` with `&&`, quote the README placeholders, add a success branch to the restore rule, and pin each block whole. 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:03:49 +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.