Change feed slice B follow-ups from the PR #81 reviews: WAL close-time wording and loop test gaps #82

Open
opened 2026-11-16 00:45:31 +00:00 by svc-agent-writer · 0 comments

Findings from the two fresh reviews of PR #81 (#65) at e2dd63c. Neither review found a blocker. Line numbers are at e2dd63c.

Should fix

  1. The WAL wording leaves out the close-time checkpoint (SECURITY.md:37, store.py:325). The documents say the positions connection "never starts an automatic checkpoint". That is true in SQLite's terms. But the connection still checkpoints and removes the -wal file when it closes as the last connection on the store. That is the WAL bound while sync is stopped, as the #65 spec ruled. SECURITY then says "A stopped sync stops this bound" and names no other bound, so a reader can infer that acks grow the WAL without limit. Add one sentence to SECURITY and to the docstring. It says that the connection checkpoints at close as the last connection, and that without sync the ack growth is bounded by each Consumer's distance to last_seq.

Test gaps (mutations that survived)

  1. The ELOOP refusal in load_config has no test of its own (config.py:272-276). Both reviews found this. Replacing the raise with pass keeps the full suite green on 3.12 and on a real 3.13, because the startup ELOOP branch (startup.py:84) gives the same output through main(). The behaviour does change: on 3.13 with the mutation, a looped auth.read_token_file plus an existing tombstone_export_path prints config-validation at=store.tombstone_export_path, which is the wrong code and the wrong location. Add a load_config test with Path.resolve simulated as on 3.13 and an existing export path, and assert ("secret-path-invalid", (loc,)).
  2. tombstone_export_path can be left out of the NUL validator (config.py:64). The old ValueError catch gives the same output, so both NUL tests pass. Only the precedence over the secret checks differs. Pin it, or record why not.
  3. The config identity can use lstat in place of stat (startup.py:73). No test gives --config as a symlink, which is the normal case for a Kubernetes ConfigMap mount. The current code handles it correctly. Add a test.

Notes

  1. The trace test's statements list also records PRAGMA key = … (tests/test_store.py:253), with the synthetic test key. --showlocals would print it. Filter it out, or redact it.
  2. test_check_fails_on_a_store_directory_with_no_access fails on Python 3.14, at both the base and the head. check exits 0 on a store directory that it cannot access. CI pins 3.12, so it does not see this. Fix it before any interpreter bump.
  3. A hard-link test depends on make_config rewriting the config in place. It calls make_config again after os.link, and relies on write_text keeping the inode. A rename-based write would break the test.
  4. load_config catches only OSError around os.stat(secret). A NUL would raise ValueError, but resolve() raises first on 3.12, 3.13 and 3.14, so that line cannot be reached today.
  5. The secret reader opens without O_NOFOLLOW (kit/secrets.py:21). A swap between the stat checks and the open is not covered. This belongs with #79.
  6. README wording order. "at the secret location and config", where the output order is at=config,<location>. Cosmetic.

Acceptance criteria

  • Item 1 is fixed.
  • Items 2 to 4 each have a test that the hand mutation fails.
  • Items 5 to 10 are fixed, or each has a recorded decision.

Blocked by

  • #65 (PR #81 writes these files)

Filed under: #65 merge gate, fresh reviews of PR #81 at e2dd63c.

Findings from the two fresh reviews of PR #81 (#65) at `e2dd63c`. Neither review found a blocker. Line numbers are at `e2dd63c`. ## Should fix 1. **The WAL wording leaves out the close-time checkpoint** (`SECURITY.md:37`, `store.py:325`). The documents say the positions connection "never starts an automatic checkpoint". That is true in SQLite's terms. But the connection still checkpoints and removes the `-wal` file when it closes as the last connection on the store. That is the WAL bound while `sync` is stopped, as the #65 spec ruled. SECURITY then says "A stopped `sync` stops this bound" and names no other bound, so a reader can infer that acks grow the WAL without limit. Add one sentence to SECURITY and to the docstring. It says that the connection checkpoints at close as the last connection, and that without `sync` the ack growth is bounded by each Consumer's distance to `last_seq`. ## Test gaps (mutations that survived) 2. **The `ELOOP` refusal in `load_config` has no test of its own** (`config.py:272-276`). Both reviews found this. Replacing the `raise` with `pass` keeps the full suite green on 3.12 and on a real 3.13, because the startup `ELOOP` branch (`startup.py:84`) gives the same output through `main()`. The behaviour does change: on 3.13 with the mutation, a looped `auth.read_token_file` plus an existing `tombstone_export_path` prints `config-validation at=store.tombstone_export_path`, which is the wrong code and the wrong location. Add a `load_config` test with `Path.resolve` simulated as on 3.13 and an existing export path, and assert `("secret-path-invalid", (loc,))`. 3. **`tombstone_export_path` can be left out of the NUL validator** (`config.py:64`). The old `ValueError` catch gives the same output, so both NUL tests pass. Only the precedence over the secret checks differs. Pin it, or record why not. 4. **The config identity can use `lstat` in place of `stat`** (`startup.py:73`). No test gives `--config` as a symlink, which is the normal case for a Kubernetes ConfigMap mount. The current code handles it correctly. Add a test. ## Notes 5. **The trace test's `statements` list also records `PRAGMA key = …`** (`tests/test_store.py:253`), with the synthetic test key. `--showlocals` would print it. Filter it out, or redact it. 6. **`test_check_fails_on_a_store_directory_with_no_access` fails on Python 3.14**, at both the base and the head. `check` exits 0 on a store directory that it cannot access. CI pins 3.12, so it does not see this. Fix it before any interpreter bump. 7. **A hard-link test depends on `make_config` rewriting the config in place.** It calls `make_config` again after `os.link`, and relies on `write_text` keeping the inode. A rename-based write would break the test. 8. **`load_config` catches only `OSError` around `os.stat(secret)`.** A NUL would raise `ValueError`, but `resolve()` raises first on 3.12, 3.13 and 3.14, so that line cannot be reached today. 9. **The secret reader opens without `O_NOFOLLOW`** (`kit/secrets.py:21`). A swap between the stat checks and the open is not covered. This belongs with #79. 10. **README wording order.** "at the secret location and `config`", where the output order is `at=config,<location>`. Cosmetic. ## Acceptance criteria - Item 1 is fixed. - Items 2 to 4 each have a test that the hand mutation fails. - Items 5 to 10 are fixed, or each has a recorded decision. ## Blocked by - #65 (PR #81 writes these files) --- Filed under: #65 merge gate, fresh reviews of PR #81 at `e2dd63c`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dev/messages-mind-mcp#82
No description provided.