Document two launchd recovery paths #96

Merged
Collaborator

Describe Mirror replacement and Tombstone restore procedures, including sidecars and gated agent restarts. Add document checks and synthetic recovery tests.

Docs change (operator-visible): two launchd recovery paths, Replace the Mirror (the Tombstone store stays) and Restore a lost Tombstone store (Rebuild from the export); every block is gated; the steps stop the api and start it after sync=ok; the Tombstone store's sidecar is -journal, and every move-back step moves the -journal with the store.

Decisions

  • Note 20 (export directory fsync). SECURITY now states the limit. The code fix (fsync the export directory after the replace) is tracked in #93. This PR does not edit src/.
  • Note 22 (source-replaced, row-id-reused). Round 3 decides it: both code rows send the operator to Replace the Mirror, which keeps the Tombstone store. The Compose and Kubernetes steps stay in #88.
  • §9 Removal. Removal deletes the aside directories together with the store directory. This is intended.
  • launchctl print-disabled output form. It is unverified on a host. Block 1 matches both => disabled and => true. The operator confirms the form at the first install.
  • Round 4 (merge gate on 04af5eb). A fresh security review reproduced this failure: a Tombstone store moved back without its hot -journal opens cleanly but loses committed Forgets. Rework commit 5db9784 makes both move-back sentences name the -journal file and states the risk. It also qualifies the tombstones-unreadable route, because a full disk on a version-1 store gives the same code.

Mutant to failing test

Each mutant was applied alone at the gate, then the targeted tests were run. t_s_d is tests/test_sync_documents.py. Every mutant is killed.

Mutant Killed by
M7 (mirror.resolve() in hold, sync.py) tests/test_sync.py::test_the_lock_is_keyed_on_the_mirror_path_as_the_config_writes_it (also test_a_symlink_loop_…)
M8a t_s_d::test_every_repeated_readme_sentence_is_pinned_in_each_section, test_the_documents_stop_the_launchd_agent_across_a_login
M8f (Codes copy; Stop copy) test_every_repeated_readme_sentence_is_pinned_in_each_section
H1h test_the_readme_placeholder_sentence_is_pinned
H4a, H4d test_every_repeated_readme_sentence_is_pinned_in_each_section
H7a, H7b (= R3-M13a) test_install_section_6_repeats_no_sentence
Item 11 (--once, kickstart, || true, ; true, test -f "EXPORT") test_the_launchd_recovery_paths_are_gated_blocks
Item 12 (.api, wrong plist path) test_the_launchd_recovery_paths_are_gated_blocks, test_the_restore_steps_stop_and_start_the_api_with_sync
Item 13 (Compose clause, kubectl clause, --replicas=10) test_the_compose_and_kubernetes_restart_gates_are_pinned
Item 14 ("exits 0" in SECURITY), I-M14 test_the_restart_condition_is_the_tombstone_store_file
Item 15 (bare (#stop-the-sync-agent) in SECURITY) test_every_stop_the_sync_agent_link_resolves
Item 16 (delete the §6 bootout line) test_the_documents_stop_the_launchd_agent_across_a_login, test_the_launchd_recovery_paths_are_gated_blocks
Item 17 (replicas: 1 moved to the Service document) test_the_compose_dependencies_and_the_replicas_default_are_pinned
Items 4, 18 (old -wal/-shm sentence in SECURITY) test_the_documents_say_to_move_the_store_files_and_keep_the_directory
Item 10 (bare messagesmind in install B2) test_the_install_restore_blocks_use_the_checkout_interpreter, test_the_launchd_recovery_paths_are_gated_blocks
R3-M1 to R3-M7, R3-M10, R3-M14 test_the_launchd_recovery_paths_are_gated_blocks (R3-M14 also test_recovery_heading_links_resolve)
R3-M8 (api block before A2) test_the_launchd_recovery_paths_are_gated_blocks, test_the_restore_steps_stop_and_start_the_api_with_sync
R3-M9 test_the_documents_send_source_replaced_and_row_id_reused_to_replace_the_mirror
R3-M11 (rm -rf -- "$aside") test_the_launchd_recovery_paths_are_gated_blocks, test_the_aside_directory_sentence_is_pinned
R3-M12 (stones_present = False) tests/test_sync.py::test_a_new_mirror_beside_the_kept_tombstone_store_keeps_every_forget (also test_an_unrestored_store_after_the_wait_is_refused)
I-M7 (api stop line, api block) test_the_launchd_recovery_paths_are_gated_blocks, test_the_restore_steps_stop_and_start_the_api_with_sync
I-M11 ((#93) put back) test_the_export_temp_file_and_fsync_limit_are_stated
R4-M1 (drop the -journal clause from the path B paragraph, both documents) test_every_move_back_sentence_moves_the_journal_with_the_tombstone_store, test_the_launchd_recovery_paths_are_gated_blocks
R4-M2 (drop the -journal clause from the README Forget and recovery sentence) test_every_move_back_sentence_moves_the_journal_with_the_tombstone_store, test_the_documents_send_source_replaced_and_row_id_reused_to_replace_the_mirror
R4-M3 (drop the tombstones-unreadable qualifier, both documents) test_every_move_back_sentence_moves_the_journal_with_the_tombstone_store, test_the_launchd_recovery_paths_are_gated_blocks

Two mutants outside the required list survive. They are non-blocking:

  • I-M8, which joins the NAMESPACE sentence to the one before it. The pin is a substring match. Round 3 replaced the round 2 mutant list.
  • Deleting the SECURITY sentence "Replacing the Mirror keeps the Tombstone store…". No test pins it.

Gate evidence

  • make check at 04af5eb: ruff and mypy are clean, and pytest gave 1519 passed and 58 skipped. The two host-only tests were deselected.
  • git diff --stat origin/main names only the five Primary Files.

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

Describe Mirror replacement and Tombstone restore procedures, including sidecars and gated agent restarts. Add document checks and synthetic recovery tests. Docs change (operator-visible): two launchd recovery paths, Replace the Mirror (the Tombstone store stays) and Restore a lost Tombstone store (Rebuild from the export); every block is gated; the steps stop the api and start it after sync=ok; the Tombstone store's sidecar is -journal, and every move-back step moves the -journal with the store. ## Decisions - **Note 20 (export directory fsync).** SECURITY now states the limit. The code fix (fsync the export directory after the replace) is tracked in #93. This PR does not edit `src/`. - **Note 22 (source-replaced, row-id-reused).** Round 3 decides it: both code rows send the operator to Replace the Mirror, which keeps the Tombstone store. The Compose and Kubernetes steps stay in #88. - **§9 Removal.** Removal deletes the aside directories together with the store directory. This is intended. - **`launchctl print-disabled` output form.** It is unverified on a host. Block 1 matches both `=> disabled` and `=> true`. The operator confirms the form at the first install. - **Round 4 (merge gate on `04af5eb`).** A fresh security review reproduced this failure: a Tombstone store moved back without its hot `-journal` opens cleanly but loses committed Forgets. Rework commit `5db9784` makes both move-back sentences name the `-journal` file and states the risk. It also qualifies the `tombstones-unreadable` route, because a full disk on a version-1 store gives the same code. ## Mutant to failing test Each mutant was applied alone at the gate, then the targeted tests were run. `t_s_d` is `tests/test_sync_documents.py`. Every mutant is killed. | Mutant | Killed by | | --- | --- | | M7 (`mirror.resolve()` in `hold`, `sync.py`) | `tests/test_sync.py::test_the_lock_is_keyed_on_the_mirror_path_as_the_config_writes_it` (also `test_a_symlink_loop_…`) | | M8a | `t_s_d::test_every_repeated_readme_sentence_is_pinned_in_each_section`, `test_the_documents_stop_the_launchd_agent_across_a_login` | | M8f (Codes copy; Stop copy) | `test_every_repeated_readme_sentence_is_pinned_in_each_section` | | H1h | `test_the_readme_placeholder_sentence_is_pinned` | | H4a, H4d | `test_every_repeated_readme_sentence_is_pinned_in_each_section` | | H7a, H7b (= R3-M13a) | `test_install_section_6_repeats_no_sentence` | | Item 11 (`--once`, `kickstart`, `\|\| true`, `; true`, `test -f "EXPORT"`) | `test_the_launchd_recovery_paths_are_gated_blocks` | | Item 12 (`.api`, wrong plist path) | `test_the_launchd_recovery_paths_are_gated_blocks`, `test_the_restore_steps_stop_and_start_the_api_with_sync` | | Item 13 (Compose clause, kubectl clause, `--replicas=10`) | `test_the_compose_and_kubernetes_restart_gates_are_pinned` | | Item 14 ("exits `0`" in SECURITY), I-M14 | `test_the_restart_condition_is_the_tombstone_store_file` | | Item 15 (bare `(#stop-the-sync-agent)` in SECURITY) | `test_every_stop_the_sync_agent_link_resolves` | | Item 16 (delete the §6 bootout line) | `test_the_documents_stop_the_launchd_agent_across_a_login`, `test_the_launchd_recovery_paths_are_gated_blocks` | | Item 17 (`replicas: 1` moved to the Service document) | `test_the_compose_dependencies_and_the_replicas_default_are_pinned` | | Items 4, 18 (old `-wal`/`-shm` sentence in SECURITY) | `test_the_documents_say_to_move_the_store_files_and_keep_the_directory` | | Item 10 (bare `messagesmind` in install B2) | `test_the_install_restore_blocks_use_the_checkout_interpreter`, `test_the_launchd_recovery_paths_are_gated_blocks` | | R3-M1 to R3-M7, R3-M10, R3-M14 | `test_the_launchd_recovery_paths_are_gated_blocks` (R3-M14 also `test_recovery_heading_links_resolve`) | | R3-M8 (api block before A2) | `test_the_launchd_recovery_paths_are_gated_blocks`, `test_the_restore_steps_stop_and_start_the_api_with_sync` | | R3-M9 | `test_the_documents_send_source_replaced_and_row_id_reused_to_replace_the_mirror` | | R3-M11 (`rm -rf -- "$aside"`) | `test_the_launchd_recovery_paths_are_gated_blocks`, `test_the_aside_directory_sentence_is_pinned` | | R3-M12 (`stones_present = False`) | `tests/test_sync.py::test_a_new_mirror_beside_the_kept_tombstone_store_keeps_every_forget` (also `test_an_unrestored_store_after_the_wait_is_refused`) | | I-M7 (api stop line, api block) | `test_the_launchd_recovery_paths_are_gated_blocks`, `test_the_restore_steps_stop_and_start_the_api_with_sync` | | I-M11 (`(#93)` put back) | `test_the_export_temp_file_and_fsync_limit_are_stated` | | R4-M1 (drop the `-journal` clause from the path B paragraph, both documents) | `test_every_move_back_sentence_moves_the_journal_with_the_tombstone_store`, `test_the_launchd_recovery_paths_are_gated_blocks` | | R4-M2 (drop the `-journal` clause from the README Forget and recovery sentence) | `test_every_move_back_sentence_moves_the_journal_with_the_tombstone_store`, `test_the_documents_send_source_replaced_and_row_id_reused_to_replace_the_mirror` | | R4-M3 (drop the `tombstones-unreadable` qualifier, both documents) | `test_every_move_back_sentence_moves_the_journal_with_the_tombstone_store`, `test_the_launchd_recovery_paths_are_gated_blocks` | Two mutants outside the required list survive. They are non-blocking: - I-M8, which joins the NAMESPACE sentence to the one before it. The pin is a substring match. Round 3 replaced the round 2 mutant list. - Deleting the SECURITY sentence "Replacing the Mirror keeps the Tombstone store…". No test pins it. ## Gate evidence - `make check` at `04af5eb`: ruff and mypy are clean, and pytest gave 1519 passed and 58 skipped. The two host-only tests were deselected. - `git diff --stat origin/main` names only the five Primary Files. Closes #92 Co-Authored-By: gpt-6.1-terra <noreply@openai.com>
Document two launchd recovery paths
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
04af5ebf39
Describe Mirror replacement and Tombstone restore procedures, including sidecars and gated agent restarts. Add document checks and synthetic recovery tests.

Closes #92
Co-Authored-By: gpt-6.1-terra <noreply@openai.com>
Preserve Tombstone journals in recovery guidance
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
5db9784db0
Update both recovery paths to move the journal with the Tombstone store, explain the risk of leaving it behind, and qualify the tombstones-unreadable route. Add the Round 4 document test and verify its mutations fail.

Closes #92
Co-Authored-By: gpt-6.1-terra <noreply@openai.com>
svc-svd-writer deleted branch feat/svd-dev-messages-mind-mcp-92-restore-steps-follow-ups-fr-cb1ed6db 2026-11-16 11:22:47 +00:00

Evidence trail: raw integrate logs (dev/stables#2237 check, run after the merge).

Run 20261116T104329Z-cb1ed6db. The logs are under ~/.codex/workflow-runs/spec-verify-dispatch/<run>/logs/. Failed attempts are listed separately and are not recast as passes.

Log Head Failed attempt Later result
integrate.jsonl 04af5eb FAIL: ImportError while loading conftest with ModuleNotFoundError: No module named 'tiktoken'. It came from a bare python3 -m pytest in the worktree, outside the project venv. No tests were collected. Under the venv, the full suite gave 1521 passed and 58 skipped, twice.
integrate.r2.jsonl (round 4 rework) 04af5eb None found. Targeted documents run: 266 passed.
integrate-1.jsonl 5db9784 None found. Full suite: 1522 passed, 58 skipped. One run reports "1 failed". That run applied mutant M7 to sync.py on purpose; the run killed it with test_the_lock_is_keyed_on_the_mirror_path_as_the_config_writes_it, then reverted it. It is not a test failure.
integrate.r3.jsonl (metadata clear) 5db9784 FAIL: the same tiktoken collection error from a bare python3. No tests were collected. Under the venv, the full suite gave 1522 passed and 58 skipped.

Other evidence:

  • The separate correctness review ran make check at 04af5eb: 1519 passed and 58 skipped, with the two host-only tests deselected.
  • CI (ci/woodpecker/pr/validation) is green at 5db9784.
  • CI (ci/woodpecker/push/validation) is green on main at 25865be.

This record is from the merging session. mind-spec has not re-audited these logs. The operator disposition "Ratify, no precedent" is unchanged.

**Evidence trail: raw integrate logs (dev/stables#2237 check, run after the merge).** Run `20261116T104329Z-cb1ed6db`. The logs are under `~/.codex/workflow-runs/spec-verify-dispatch/<run>/logs/`. Failed attempts are listed separately and are not recast as passes. | Log | Head | Failed attempt | Later result | | --- | --- | --- | --- | | `integrate.jsonl` | `04af5eb` | **FAIL:** `ImportError while loading conftest` with `ModuleNotFoundError: No module named 'tiktoken'`. It came from a bare `python3 -m pytest` in the worktree, outside the project venv. No tests were collected. | Under the venv, the full suite gave 1521 passed and 58 skipped, twice. | | `integrate.r2.jsonl` (round 4 rework) | `04af5eb` | None found. | Targeted documents run: 266 passed. | | `integrate-1.jsonl` | `5db9784` | None found. | Full suite: 1522 passed, 58 skipped. One run reports "1 failed". That run applied mutant M7 to `sync.py` on purpose; the run killed it with `test_the_lock_is_keyed_on_the_mirror_path_as_the_config_writes_it`, then reverted it. It is not a test failure. | | `integrate.r3.jsonl` (metadata clear) | `5db9784` | **FAIL:** the same `tiktoken` collection error from a bare `python3`. No tests were collected. | Under the venv, the full suite gave 1522 passed and 58 skipped. | Other evidence: - The separate correctness review ran `make check` at `04af5eb`: 1519 passed and 58 skipped, with the two host-only tests deselected. - CI (`ci/woodpecker/pr/validation`) is green at `5db9784`. - CI (`ci/woodpecker/push/validation`) is green on main at `25865be`. This record is from the merging session. mind-spec has not re-audited these logs. The operator disposition "Ratify, no precedent" is unchanged.
Sign in to join this conversation.
No description provided.