Repository navigation
test(store): assert stamped receipt cannot be overwritten in append-only store - #58
Conversation
kikashy
left a comment
There was a problem hiding this comment.
Thank you for taking #55 — the heart of this is right. Reviewed and verified locally on your branch merged onto current main. Before the detail: the property you set out to pin is pinned. I broke the append-only path five ways — stamp writing non-exclusively, exclusive-write silently overwriting, the store damaging the existing file before returning its refusal, a duplicate stamp succeeding as a silent no-op, and the refusal message changing — and your test caught every one.
Four required changes:
-
DCO. Your commit has no
Signed-off-bytrailer, and the DCO check fails on it. Amend and force-push:git commit --amend -s --no-editthengit push -f. -
gofmt. The ubuntu CI leg fails because
teeth_test.goends with a trailing blank line;cd go && gofmt -w teeth_test.gofixes it. -
#55's third checkbox is missing, and it is provably the load-bearing one. Nothing in the test enumerates the session directory — it only ever reads the one path it wrote. I deleted
store.go's temp-file cleanup so every write leaks a.tmpscratch file next to the receipt, and neither your test nor the entire existing suite noticed. Asserting the directory holds exactly one entry after the refusal is the assertion that catches it. -
#55's fourth checkbox is missing. The test never stamps a second
callIndex, so it cannot show the refusal is about the collision rather than the session. I made the receipt filename ignore the index entirely — every call in a session colliding with the first — and your test passed. A stamp at the next index, asserted to succeed, pins it.
Two smaller asks, per the issue's scope text: build the store with the existing testStore(t) helper instead of hand-assembling paths, and stamp a production-shape core — the current one carries argumentsCommitment, which appears nowhere in SPEC.md, and omits receiptVersion, prevSignature, servedAt, and authority, which every receipt the gateway actually stamps carries.
None of this changes the verdict on your approach: the exclusive-link refusal, the byte-comparison of the surviving receipt, and driving the unexported layer directly are all sound instincts for this file. Fix the four, and consider the two, and this merges.
…nly store Signed-off-by: Snowy <[email protected]>
b8fc4a9 to
2531f41
Compare
|
Thanks @kikashy for the review and the detailed feedback on each edge case. Head 2531f41 addresses all four required points and both scope suggestions:
|
|
Re-verified locally on your amended branch merged onto current All six points landed, and the two that mattered most now demonstrably bite:
Merging. For a first contribution to this repository, closing a gap the whole suite had is a strong place to start. Thank you. |
kikashy
left a comment
There was a problem hiding this comment.
Re-verified in full — all six review points addressed; details in the comment above.
|
🎉 Thank you for your contribution to Judgment Pack! If you’d like another task, choose a path that interests you: |
Goal
Adds regression coverage in
go/teeth_test.gofor the receipt store's append-only guarantees.Coverage
callIndexis refused and the original receipt bytes remain unchanged.0.jsonin the session directory, with no temporary or partial file.callIndexstill succeeds and chains to the first receipt's signature.Testing
gofmt -l .go vet ./...go test ./...go build -trimpathgateway conform— 30 canonicalization vectors, 19 store vectors, 0 disagreementsCloses #55