Keep the placement ask among the assigner's asks: its Approve's level, not its kind, needs the proof (ADR 0567 §5, issue 1126)

This commit is contained in:
2026-10-28 18:30:00 +01:00
parent 4b4a173d84
commit 45f5f76811
2 changed files with 6 additions and 5 deletions
+4 -3
View File
@@ -39,7 +39,8 @@ const (
// a composition judged to recreate a container or move data, or one that cannot be judged (ADR 0539 clause 14).
AskKindRecord = "record"
// AskKindPlacement is the kind of the seat mesh-placement's authorising ask about a proposal (novox/hq ADR 0567 §5):
// `placement.<proposal id>`. Its yes is an Approve that only a channel proving who answered takes, never the view.
// `placement.<proposal id>`. The kind needs no proof, as the bus's put does not: its yes is an Approve, which only a
// channel proving who answered takes and the view never does (ViewAnswerFits).
AskKindPlacement = "placement"
viewWord = "view"
@@ -63,9 +64,9 @@ type AskKey struct {
// merge's Approve does (ADR 0421 §1, issue 953), the assigner's hold and restore do not. An unknown kind is refused.
func AskNeedsProof(kind string) (bool, error) {
switch kind {
case AskKindMerge, AskKindPlacement:
case AskKindMerge:
return true, nil
case AskKindHold, AskKindRestore, AskKindBackup, AskKindRecord:
case AskKindHold, AskKindRestore, AskKindBackup, AskKindRecord, AskKindPlacement:
return false, nil
}
return false, fmt.Errorf("delivery: %q is not a kind of ask, %s, %s, %s, %s, %s or %s", kind, AskKindMerge, AskKindHold,
+2 -2
View File
@@ -37,8 +37,8 @@ func TestParseAnyAskKey(t *testing.T) {
if err != nil || placement != "placement.p-one" {
t.Fatalf("PlacementAskKey = %q, %v", placement, err)
}
if proof, err := AskNeedsProof(AskKindPlacement); !proof || err != nil {
t.Error("a placement ask may be answered without proof of who answered")
if proof, err := AskNeedsProof(AskKindPlacement); proof || err != nil {
t.Error("the assigner cannot keep a placement ask: its kind needs proof (its yes's level does)")
}
for key, want := range map[string]AskKey{
hold: {Kind: AskKindHold, Module: "mesh-mail", FP: fp},