Skip to content

Commit b452b0c

Browse files
committed
docs(encryption): Stage 6E-2c — fix stale comment on MissingSidecar test
Claude r6 caught a stale comment that predated the codex P1 r2 narrowing of the nil-return branch. The MissingSidecar test was written when refuseStartupOnActiveRaftCutover silently returned nil on any read error; the fail-closed fix narrowed that to encryption.IsNotExist only. The test itself was already correct (it asserts the missing-file case returns nil) — only the docblock contradicted the actual contract. Rewrote the comment to point at the BadSidecarPropagates sibling test as the canonical reference for the non-NotExist branch.
1 parent 47bb81a commit b452b0c

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

main_encryption_write_wiring_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,14 @@ func TestRefuseStartupOnActiveRaftCutover_NoSidecarPath(t *testing.T) {
214214
}
215215

216216
// TestRefuseStartupOnActiveRaftCutover_MissingSidecar pins the
217-
// nil-on-missing-file behaviour: the Stage 6C-1 startup guard
218-
// is the authoritative refuser of malformed sidecars; this helper
219-
// only cares about a present sidecar with a non-zero cutover
220-
// index, and silently returns nil on any ReadSidecar error.
217+
// nil-on-missing-file behaviour: a missing sidecar is the
218+
// pre-bootstrap state and there is no raft envelope cutover to
219+
// refuse on. Only encryption.IsNotExist errors return nil here;
220+
// non-NotExist read errors (malformed JSON, schema violation)
221+
// propagate as a refusal — see the sibling
222+
// TestRefuseStartupOnActiveRaftCutover_BadSidecarPropagates that
223+
// pins that branch (codex P1 round-1 r2 narrowed the nil-return
224+
// from "any read error" to IsNotExist only).
221225
func TestRefuseStartupOnActiveRaftCutover_MissingSidecar(t *testing.T) {
222226
t.Parallel()
223227
if err := refuseStartupOnActiveRaftCutover(t.TempDir() + "/absent.json"); err != nil {

0 commit comments

Comments
 (0)