Cut review over to the sitting PDP and load seven memos.

FLEX-WP-0028 admitted a dedicated package. Runtime ConfigMap and
NetworkPolicy now pin flex-auth-informed-decision-sitting. Memos are
in the live store for the existing named recipient. No human bind.

Assistant: grok
Assistant-Session: 01a09dc1-b21e-77e1-919e-fcad2f82b267
This commit is contained in:
tegwick 2026-09-15 23:35:35 +02:00
parent ca563504c4
commit d4b77a8c0e
6 changed files with 115 additions and 15 deletions

View file

@ -51,21 +51,33 @@ def test_attach_writes_bound_copies_and_leaves_drafts_unsigned(tmp_path):
(root / "sitting.json").write_bytes((src / "sitting.json").read_bytes())
ids = _memo_ids(root)
index = attach_mod.attach("human-subject-1", _receipt(ids), root)
assert index["principal"] == "human-subject-1"
assert len(index["memos"]) == 8
draft = memo_from(json.loads((root / "credentials" / "infd-20260914-c01.memo.json").read_text()))
def test_attach_allows_seven_memo_subset(tmp_path):
src = Path(__file__).resolve().parents[1] / "docs" / "batches" / "2026-09-14"
root = tmp_path / "sitting"
for name in ("credentials", "decisions"):
(root / name).mkdir(parents=True)
for item in (src / name).iterdir():
(root / name / item.name).write_bytes(item.read_bytes())
(root / "sitting.json").write_bytes((src / "sitting.json").read_bytes())
ids = [i for i in _memo_ids(root) if i != "infd-20260914-c01"]
index = attach_mod.attach("human-subject-1", _receipt(ids), root)
assert index["principal"] == "human-subject-1"
assert len(index["memos"]) == 7
assert "infd-20260914-c01" not in {row["memo_id"] for row in index["memos"]}
draft = memo_from(json.loads((root / "credentials" / "infd-20260914-c02.memo.json").read_text()))
assert draft.approval_id is None
assert draft.binding.principal.id == "pending-human-session"
bound = memo_from(json.loads((root / "bound" / "infd-20260914-c01.memo.json").read_text()))
bound = memo_from(json.loads((root / "bound" / "infd-20260914-c02.memo.json").read_text()))
assert bound.approval_id == "approval-01"
assert bound.approval_binding_digest.startswith("sha256:")
assert bound.binding.principal.id == "human-subject-1"
assert bound.question == draft.question
assert not (root / "bound" / "infd-20260914-c01.memo.json").exists()
@pytest.mark.parametrize(
"fault",
["pending-human-session", "has space", "", "not-created", "wrong-count", "has-entry", "no-control"],
["pending-human-session", "has space", "", "not-created", "unknown-memo", "has-entry", "no-control"],
)
def test_attach_refuses_unsafe_inputs(tmp_path, fault):
src = Path(__file__).resolve().parents[1] / "docs" / "batches" / "2026-09-14"
@ -86,8 +98,8 @@ def test_attach_refuses_unsafe_inputs(tmp_path, fault):
principal = ""
elif fault == "not-created":
receipt["status"] = "draft"
elif fault == "wrong-count":
receipt["requests"] = receipt["requests"][:7]
elif fault == "unknown-memo":
receipt["requests"][0]["memo_id"] = "not-a-sitting-memo"
elif fault == "has-entry":
receipt = _receipt(ids, entries=[{"subject_id": "someone"}])
elif fault == "no-control":