Repository navigation
Description
Follows: #677, which declared the claim and left it unused
+devlore:claim=idempotent exists in op.MethodClaims and is parsed, validated, and emitted like the other two.
Nothing claims it. #677 annotated deterministic and sandboxed from measurable evidence — import sets, call
graphs, which API a body reaches — and idempotency has none of that, so it was left empty rather than guessed at.
Why it is a different kind of claim
| Claim | Evidence | Where the truth lives |
|---|---|---|
deterministic |
call graph | our code — pkg/op/claimcheck decides it |
sandboxed |
which API a body calls | our code — same |
idempotent |
behaviour under re-application | sometimes our code, sometimes an external tool's contract |
pkg.Install is the sharp case. It does not check-then-install: provider.go calls
plat.PackageManager().Install(...) and delegates. What it tracks is InstalledBefore on the receipt
(receipt.go:57), used only for compensation — if !receipt.InstalledBefore decides whether unwind removes the
package. So the design reasons about prior state for undo and not at all for re-application, and whether
pkg.install converges is a property of apt / brew / winget, not of this repository.
The criterion to apply
A method may claim idempotent when re-application converges to the same state. Three distinguishable cases:
- Our code converges explicitly —
file.mkdirusesMkdirAll;file.write_textwrites the same bytes.
Readable from the implementation, provable by a double-application test. - We delegate to a converging tool —
pkg.install→apt-get installon an installed package is a no-op.
Claimable, but the evidence is the tool's contract and only an integration test touches it. - Re-application diverges or errors — not claimable.
archive.extract is case 1 or 3 depending on whether a second extraction overwrites or fails; the write path
decides it and has not been read.
The test IS the claim
Nothing static can check this, so +devlore:claim=idempotent without a double-application test is a comment. The
obligation: a method claiming it must have a test that applies it twice and asserts the same end state. That
rides #635's per-method coverage directive rather than needing new machinery.
Candidates named so far
pkg.install, pkg.remove (uninstall is not the announced name), archive.extract, and the file mutators
that use converging primitives. Each needs its implementation read before anything is claimed — the point of this
issue is that the reading has not happened, not that the answers are known.
Activity
David-Noble-at-work commentedon Nov 7, 2026
Split on 2026-11-06, on the owner's word, as #91 was. This issue keeps the design: what evidence an idempotent claim needs, which is engineering. The product half, the provider methods that meet that evidence carrying
+devlore:claim=idempotentin the shipped code, is #1199, which waits on this one.David-Noble-at-work commentedon Nov 9, 2026
star github triage sweep added this issue to Triage: devlore, for the rule it breaks:
no-evidence: no Evidence of completion section