diff --git a/docs/governance/workstreams.md b/docs/governance/workstreams.md index 9f791c2..65af87b 100644 --- a/docs/governance/workstreams.md +++ b/docs/governance/workstreams.md @@ -333,6 +333,7 @@ state to its index: [`docs/adr/`](../adr/README.md), [`docs/pdr/`](../pdr/README | D314 | **A pull request titled with a deliverable's part, "D126 3c —", was not read as delivering it** (#588). Downstream, 2026-11-29, 0.35.4: `nstack deliver D126 --held '1=#1372'` refused it; the team titles a deliverable's parts "D121 4a —", "D123 (a) —", "D126 3c —", one pull request in two. D300 read a letter glued to the id only | **Done**: after the id and its letter, a part is read too — a number with an optional letter, "-1", or, opening the title, "(a)" — before the dash or the colon, and in the closing parentheses; `deliver`, `plan` and the start branches' landing read these part forms alike. Words there stay a mention, and a part takes no scope after it: "D12 is next —", "D7 (wip) —", "D12 3 files:" name nothing. Not read: "(a)" inside the closing parentheses, which hold no nested ones | | D315 | **An attest that read no pull request judged the description's sheet, and said nothing** (#595). Downstream, 2026-11-30, PR #1389: one commit recorded 4 of 5 by the attest that read the verifier's comment (T1, right by design, D305) and 5 of 5 by one with no token, which judged the description's sheet | **Done**: where the forge is GitHub, a sheet is in play and no pull request was read, pr-check warns (T2) and attest says it in its own output: the description's sheet is judged, the forge's run judges the signed one, a token reads it here. Not a failure: checks on a workstation stand without a token (ADR-0010 §6) | | D316 | **A module's formatter ran only in CI or at attest** (#593). Downstream, 2026-11-30, PR #1390: a red `cargo fmt --check`, inside the module's `check`, was seen after the push and the verifier's round; the shipped pre-commit config ran generic hooks only | **Done**: an optional verb `format` (the formatter's check, writing nothing, building nothing); the skeleton's pre-commit hook `nstack-format` runs it on the modules whose files are staged, and `Module checks` after `bootstrap`, before `check`. Where nstack, an engine without the verb or the module's tool (exit 127) is missing, the hook says so and lets the commit go: CI judges. Audited before (moonrepo, lefthook, lint-staged, trunk, Bazel, Pants). Not taken: `check` at push (a build, minutes), documentation alone (a copy per project). A project moves its formatter's check out of `check` into `format` | +| D317 | **`deliver` refused another deliverable's merge that holds a criterion, and its Action did not name the way** (#598). Downstream, 2026-11-30, 0.35.5: `nstack deliver D122` refused #1337 (D121) and #1299 (D125a), which also hold D122's second criterion. The refusal is D193's: a delivery is tied to the deliverable's own merges. But any pull request the cycle names for the deliverable already answers (`_named_for`), and the Action and `project.md` called that place the acceptance issue only | **Done**: no rule changes. An answer that is another deliverable's merge is refused naming whose it is, and the way: the cycle file names it for this deliverable — in its section, beside its state, or on a table's row with its id —, then again. `project.md` says it. A commit with no pull request number is not named this way, as before. Test seen red first | | v0.6.0 | **What is announced refuses, and the documents say what is true**: D51 to D54, and the documentary lot of the internal audit | **Done (2026-09-20)**: five workstreams merged (#83, #84, #85, #86, #87), **v0.6.0 published**, tag on `8ae544c`, verified on published artefacts — including an update of `tool-library` from v0.5.0, 9 files and no conflict, still compliant. Found doing it: D55. Next: the pilot, and M11 beside it | | Pilot | **`NapkinStack/flet`, the first real project**, run by a session that knew nothing of this repository, with the maintainer as decider and this repository's agent as observer — public on the Free plan, where the whole checklist is available, rather than private on Team where G5 is paid and G6 does not exist | **Set aside by the maintainer, 2026-10-15**, at its cycle boundary; the real product followed since is `summit`. **Ran from 2026-09-20**: discovery decided *go* after three rounds and two independent challenges, charter accepted; cycle 01 closed `stopped/reframed`, **cycle 02 closed** with two deliverables accepted and one deferred (its #27), **cycle 03 framed and approved** (#28, #30), which starts its first `critical` module; the framework taken to v0.6.1 by itself at the boundary (#29), v0.6.2 proposed (#31). It has produced D56 to D63, D68, D70 to D77, replicated D26 and D55, and measured D49 — the first figures on what an independent verifier finds (PDR-0003) | | M11 | **Ceremony follows consequence** (PDR-0011): the framework charges what a failure costs, per module and per project, and states each price before it is paid; with PDR-0004's routing, and PDR-0007, PDR-0008 and PDR-0010 — through to v0.7.0 | **Published as v0.7.0 (2026-10-12).** Planned 2026-09-23 (#98). Merged: **M11f** (#101), **M11a** (#102), **M11b** (#103), **M11d** (#104), **M11e** (#105), **M11c** (#106), **M11h** (#107), **M11g** (#108) closed by its probe — not clean, returned to M13; **M11m** (D68, D74, D75); **M11l** (PDR-0010, D59, D60); **M11n** (D79); **M11o** (PDR-0010 extended: every document has its moment); **M11p** (PDR-0002's three levels given a place: `docs/project/rules/`); **M11j** (PDR-0007: the unframed stage); **M11q** (no folder created empty; PDR-0012 proposed: a project's tree is the project's). **M11k** (PDR-0008's print mode: `nstack settings`; D77, D78). **M11s** (PDR-0012 accepted; the framework's files under `.nstack/`; an update carries what a project adapted); **M11u** (an update rewrites the old addresses a project wrote in its own files, D85). **M11t** (`nstack new-contract`: the contracts module is created by the first contract; PDR-0012 built in full); **M11v** (what the third project found: D81, D82, D83, D86, D87). **M11i**: v0.7.0 published 2026-10-12 (#125, D88). To do: **M11r** PDR-0008's apply mode and D57, after a probe on the real forge; the two earlier projects take v0.7.0 themselves, observed | diff --git a/platform/tests/test_hold.py b/platform/tests/test_hold.py index 2f4c664..8ce1b7b 100644 --- a/platform/tests/test_hold.py +++ b/platform/tests/test_hold.py @@ -1607,7 +1607,40 @@ def test_each_answer_of_a_criterion_is_checked_not_only_its_last(shared, capsys) landed(alice, "the work (D1) (#7)") landed(alice, "another's work (D2) (#99)") assert hold.deliver(alice, "D1", ["1=#99", "1=#7"], person="@alice") == 1 - assert "#99 is no merge of D1" in capsys.readouterr().out + assert "#99 is a merge of D2, not of D1" in capsys.readouterr().out + + +def test_another_deliverables_merge_holds_a_criterion_once_the_cycle_names_it(shared, capsys): + """#598: a merge of D2 that also holds D1's criterion was refused, the Action naming only an + acceptance issue. The refusal says whose merge it is and the way: the cycle names it for D1.""" + alice = clone(shared, "alice") + landed(alice, "the work (D1) (#7)") + landed(alice, "another's work (D2) (#99)") + assert hold.deliver(alice, "D1", ["1=#7", "1=#99"], person="@alice") == 1 + out = capsys.readouterr().out + assert "#99 is a merge of D2, not of D1" in out and "names #99 for D1" in out and "### D1" in out + assert "else name one of #7" in out + path = alice / "docs/project/cycles/03-the-window.md" + path.write_text(path.read_text(encoding="utf-8") + "\n### D1\n\nIts first criterion is held by #99 (D2) too.\n", + encoding="utf-8") + git(alice, "add", "-A") + git(alice, "commit", "-q", "-m", "names D2's merge for D1") + git(alice, "push", "-q", "origin", "main") + assert hold.deliver(alice, "D1", ["1=#7", "1=#99"], person="@alice") == 0 + assert hold.read(alice, "03-the-window", "D1").criteria == ["1 #7 #99"] + + +def test_an_answer_no_deliverable_merged_keeps_the_plain_refusal(shared, capsys): + """#598: only a pull request number is said to be another's merge; a commit is never, even beside + another deliverable's merge with no number.""" + alice = clone(shared, "alice") + landed(alice, "the work (D1) (#7)") + landed(alice, "another's work (D2)") + assert hold.deliver(alice, "D1", ["1=#55"], person="@alice") == 1 + assert "#55 is no merge of D1, nor named in 03-the-window.md" in capsys.readouterr().out + assert hold.deliver(alice, "D1", ["1=abcdef1"], person="@alice") == 1 + out = capsys.readouterr().out + assert "abcdef1 is no merge of D1" in out and "is a merge of" not in out @pytest.mark.parametrize("given, said", [(["#99"], "#99"), (["nothing"], "nothing"), (["3=#7"], "criterion 3"), diff --git a/skeleton/.nstack/handbook/project.md b/skeleton/.nstack/handbook/project.md index cab3ac6..41bdd41 100644 --- a/skeleton/.nstack/handbook/project.md +++ b/skeleton/.nstack/handbook/project.md @@ -89,8 +89,9 @@ nstack deliver D30 --held '1=#412' --held '1=#413' --held '2=#415' --session ali ``` It is refused with no merge of the deliverable on the default branch since the cycle started, with a criterion -unanswered, or with an answer that is no merge of it, nor the acceptance issue the cycle names for it. Carried from -an earlier cycle, its merges there, only that issue answers. A session on the hold, its person or the decider records it, a stale hold +unanswered, or with an answer that is no merge of it, nor named for it by the cycle — its acceptance issue, or another +deliverable's merge that holds one of its criteria too, named in its section, beside its state, or on a table's row with its id. Carried from +an earlier cycle, its merges there, only what the cycle names for it answers. A session on the hold, its person or the decider records it, a stale hold being taken over first. A delivered deliverable is not held, never goes stale, cannot be taken, and its issue closes; its recorder or the decider withdraws a record found wrong with `nstack unclaim`, and once a merge it names or every merge is seen reverted it reads as back in work; a revert that names nothing it undoes is not seen. The rule sees that a merge exists, never that a criterion is really met: the closure's reading is what diff --git a/src/napkinstack/hold.py b/src/napkinstack/hold.py index 020dbac..69c4da7 100644 --- a/src/napkinstack/hold.py +++ b/src/napkinstack/hold.py @@ -1203,6 +1203,15 @@ def deliver(root: Path, ident: str, given: list[str], session: str | None = None pull = answer[1:] if answer.startswith("#") else None known = any(one[1] == pull for one in mine) or bool(re.search(rf"#{pull}\b", named)) if pull else \ any(one[0].startswith(answer) for one in mine) + others = sorted(other for other, ones in seen.citable.items() if any(one[1] == pull for one in ones)) \ + if pull and not known else [] + if others: # #598: another deliverable's merge may hold this criterion too, once the cycle says so + print(f"FAIL [deliver] {ident}, criterion {number}: {answer} is a merge of {', '.join(others)}, not of {ident}, " + f"and {path.name} does not name it for {ident}.\n" + f" Action: if it holds this criterion too, the cycle file names {answer} for {ident} — in its section " + f"(### {ident}), beside its state, or on a table's row with its id —, then again; " + f"else name one of {', '.join('#' + one[1] if one[1] else one[0][:9] for one in mine) or 'none'}.") + return 1 if not known: print(f"FAIL [deliver] {ident}, criterion {number}: {answer} is no merge of {ident}, nor named in {path.name}.\n" f" Action: name one of {', '.join('#' + one[1] if one[1] else one[0][:9] for one in mine) or 'none'}, "