From cae79b85af6427a4b6eeef824e99df92c2355910 Mon Sep 17 00:00:00 2001 From: "napkinstack-agent[bot]" <330339777+napkinstack-agent[bot]@users.noreply.github.com> Date: Sun, 29 Nov 2026 23:08:07 +0100 Subject: [PATCH 1/2] =?UTF-8?q?D312=20=E2=80=94=20pr-check=20says=20a=20cy?= =?UTF-8?q?cle=20left=20proposed=20is=20not=20accepted=20by=20its=20approv?= =?UTF-8?q?al=20(#587)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Downstream, the next cycle, proposed with no accepted_on while one ran, was approved by the decider as its acceptance; nothing said the approval accepted nothing, and a second push and approval followed. pr-check now warns (C11) on a pull request that leaves a cycle proposed with no accepted_on, in a framed project, with the gesture. A warning: a decider may approve a proposal still being framed. Agent-Session: napkinstack-os-1e Co-Authored-By: Claude Opus 5.5 --- docs/governance/workstreams.md | 1 + platform/tests/test_pull_request.py | 47 +++++++++++++++++++++++++++ skeleton/.nstack/handbook/RULES.md | 1 + skeleton/.nstack/playbooks/framing.md | 3 +- src/napkinstack/pull_request.py | 27 ++++++++++++++- 5 files changed, 77 insertions(+), 2 deletions(-) diff --git a/docs/governance/workstreams.md b/docs/governance/workstreams.md index 688da3a..e1ff0bf 100644 --- a/docs/governance/workstreams.md +++ b/docs/governance/workstreams.md @@ -328,6 +328,7 @@ state to its index: [`docs/adr/`](../adr/README.md), [`docs/pdr/`](../pdr/README | D309 | **A table after the test sheet in a comment was read as its rows** (no issue; reported by the consumer project's coordinator, 2026-11-29). D305 moved the signed sheet into a comment, where no template heading ends the section: a verifier's "Mutants" table after the sheet was read as scenarios, and T2 failed ("scenario M1 …", 4 of 5) | **Done**: `read_sheet` leaves out a table after the sheet that GitHub renders apart — its own header, other than the sheet's, over a delimiter line —, in a description as in a comment: it is the verifier's own. Rows after a blank line, which GitHub shows as text, are still read as the sheet's: a failed one fails rather than vanishes (a fresh verifier's finding). A comment written with CRLF line endings, as a browser sends it, is read too | | D310 | **An agent's run stopped at start on Claude Code's trust screen for its skills folder** (#578). Downstream, 2026-11-29, Claude Code 2.1.332: the folder D261 hands Claude Code with `--add-dir` asked "Adding a new directory … Is this a directory you created or one you trust?" at every start, `No, exit` the default, so no unattended agent began. A deliberate safeguard of Claude Code, never stepped around | **Done**: `nstack agent run -- claude` lays the default branch's skills as a plugin of the session (`.claude-plugin/plugin.json` named `project`, `skills//`) and passes `--plugin-dir`, the path Claude Code documents for a program handing a session skills. Measured on 2.1.332 through a pseudo-terminal: `--add-dir` asks, `--plugin-dir` does not and loads the skills; `permissions.additionalDirectories` in `--settings` does not ask but loads no skill. In the session the skills are named `project:`, said by the run and in `INSTALL.md`. Not taken: a persistent trust entry (the person's setting, a manual step); any flag that skips the trust check. Not caught by the tests: Claude Code's own screen — CI runs a stand-in for `claude` | | D311 | **An agent's skills lost their skip-worktree bit, and its commit stopped in the sandbox's mask** (#584). Downstream, 2026-11-29, nstack 0.35.3: the five agents' clones kept D261's sparse patterns, but their committed skills showed as deleted; pre-commit's stash wrote them back into the mask, and `git checkout -- .` failed with "Device or resource busy". The loss itself was not reproduced beyond one clone's commit of the sandbox's masks: git clears the bit wherever the file is present | **Done**: at each `nstack agent run`, a skill outside the patterns that is absent from the working tree gets its bit back, in the index alone; one the working tree holds stays and is said kept, as before. Not taken: `git sparse-checkout reapply`, which leaves them while the sandbox's placeholder stands; `--assume-unchanged`, a hint git may drop. Not caught: a bit lost during a session is set again only at the agent's next run | +| D312 | **A cycle left proposed was approved as if accepted** (#587). Downstream, 2026-11-29: the next cycle, `proposed` with no `accepted_on` while one ran, was approved by the decider as its acceptance; neither fitness nor pr-check said the approval accepted nothing, and a second push and a second approval followed. The framing playbook said it; nothing said it where the approval is given | **Done**: pr-check warns (C11) on a pull request that leaves a cycle `proposed` with no `accepted_on`, in a framed project, with the gesture: `accepted_on` while a cycle runs, else `status: accepted` and its start. A warning, not a failure: a decider may approve a proposal still being framed. Not caught: a cycle proposed during framing, before the charter is accepted — the framing accepts both | | 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_pull_request.py b/platform/tests/test_pull_request.py index 37f7f92..9de21a7 100644 --- a/platform/tests/test_pull_request.py +++ b/platform/tests/test_pull_request.py @@ -820,6 +820,53 @@ def test_c9_an_accepted_charter_changed_without_a_pdr_is_said(tmp_path, capsys, assert "docs/project/charter.md" in output and "Action:" in output and "PDR" in output, output +# --- C11: a cycle a pull request leaves proposed is not accepted by its approval (D312) --- +# Found downstream on 2026-11-29: the next cycle, proposed with no accepted_on while one ran, was +# approved by the decider as its acceptance; nothing said the approval accepted nothing, and a +# second push and a second approval followed. + +def cycle_change(root, next_cycle: dict | None, running: bool = True, charter: str = "accepted") -> tuple[str, str]: + git(root, "init", "-q", "--initial-branch=main") + framed(root, {**CHARTER, "status": charter}, + cycles={"01-first.md": cycle() if running else cycle(status="closed", outcome="Shipped")}) + if next_cycle is None: # a proposal already on the base, which this pull request leaves alone + write(root, "cycles/02-next.md", cycle(status="proposed")) + git(root, "add", "-A") + git(root, "commit", "-q", "-m", "base") + base = git(root, "rev-parse", "HEAD") + if next_cycle is None: + write(root, "cycles/01-first.md", cycle(goal="Customers receive their invoices, signed")) + else: + write(root, "cycles/02-next.md", next_cycle) + git(root, "add", "-A") + git(root, "commit", "-q", "-m", "next cycle") + return base, git(root, "rev-parse", "HEAD") + + +CYCLE_PROPOSALS = { + "a next cycle proposed while one runs, with no accepted_on": (cycle(status="proposed"), True, "add accepted_on: ", + "accepted"), + "a next cycle proposed with no cycle running": (cycle(status="proposed"), False, "set status: accepted", "accepted"), + "a next cycle the decider accepted while one runs": (cycle(status="proposed", accepted_on="2026-11-29"), True, None, + "accepted"), + "a next cycle accepted": (cycle(), False, None, "accepted"), + "the running cycle changed, a proposal on the base untouched": (None, True, None, "accepted"), + "a project still being framed": (cycle(status="proposed"), False, None, "proposed"), +} + + +@pytest.mark.parametrize(("_", "next_cycle", "running", "action", "charter"), [(k, *v) for k, v in CYCLE_PROPOSALS.items()], + ids=CYCLE_PROPOSALS.keys()) +def test_c11_a_cycle_left_proposed_is_said_not_accepted_by_the_approval(tmp_path, capsys, monkeypatch, _, + next_cycle, running, action, charter): + base, head = cycle_change(tmp_path, next_cycle, running, charter) + check(tmp_path, base, head, "A cycle.", monkeypatch, deliverable_line=None) + output = capsys.readouterr().out + assert ("WARNING [C11]" in output) is (action is not None), output + if action: + assert "02-next.md" in output and f"Action: {action}" in output, output + + def test_k3_tells_a_ready_deliverable_to_move(tmp_path, capsys, monkeypatch): """Measured on 2026-10-15: a deliverable stayed `ready` after seven pull requests had merged in its name. A delivery pull request nobody holds is told to claim it — the hold says it is in diff --git a/skeleton/.nstack/handbook/RULES.md b/skeleton/.nstack/handbook/RULES.md index 7ccd6db..b667e48 100644 --- a/skeleton/.nstack/handbook/RULES.md +++ b/skeleton/.nstack/handbook/RULES.md @@ -77,6 +77,7 @@ a family, a number a rule; a retired rule's number is never reused. | `C8` | A document left as its form once its moment has come: the front page's sentence at a go, the whole front page at an accepted charter, the module map once a module holds code | `06-decisions.md` §10 | | `C9` | *(warning)* An accepted charter changed by a pull request that carries no decision record | `06-decisions.md` §4 | | `C10` | *(warning)* An accepted decision record due at a closure — its criterion names the cycle, or a date in bold, `**YYYY-MM-DD**`, its end reached — with no reading line; a criterion with neither, holding a plain date its end reached, is told to bold its due date | `06-decisions.md` §6 | +| `C11` | *(warning)* A pull request that leaves a cycle `proposed` with no `accepted_on`: its approval does not accept it | `.nstack/playbooks/framing.md` §3 | ## H — hygiene diff --git a/skeleton/.nstack/playbooks/framing.md b/skeleton/.nstack/playbooks/framing.md index 7daf8af..e312af6 100644 --- a/skeleton/.nstack/playbooks/framing.md +++ b/skeleton/.nstack/playbooks/framing.md @@ -136,7 +136,8 @@ none; put the lines under *On acceptance of cycle …* in the framing pull reque cycle — in a pull request the decider approves, and that approval is their gesture; accepted after `start`, the cycle's `start` and `end` move in the same pull request. **The next cycle, accepted while one runs**, stays `proposed` — one accepted cycle at a time (C5) — and gains `accepted_on: `: `nstack plan` stops asking -for it while that cycle runs, and the running cycle's closure starts it (§5). The modules accepted there are created with the engine's +for it while that cycle runs, and the running cycle's closure starts it (§5). An approval alone accepts +nothing: where a pull request leaves a cycle `proposed` with neither, pr-check says so (C11). The modules accepted there are created with the engine's module scaffolding, declared user-facing when a user sees them. **Where the project's own rules waive approval** — an agent merging alone on an attested, diff --git a/src/napkinstack/pull_request.py b/src/napkinstack/pull_request.py index 4c50fa9..d9c43c2 100644 --- a/src/napkinstack/pull_request.py +++ b/src/napkinstack/pull_request.py @@ -33,6 +33,7 @@ the required status where the forge requires it C1 the charter readable: the project's stage is never assumed C9 an accepted charter changed with no decision record, warned + C11 a cycle left proposed, which its approval does not accept, warned (D312) R1 an approval given before commits other than the base branch's, warned (D227) R2 every approval Copilot's code review, warned (D246) @@ -919,6 +920,30 @@ def charter_without_pdr(root: Path, base: str, files: list[str]) -> list[str]: "correction that decides nothing needs none (.nstack/playbooks/framing.md, Decisions)."] +def cycle_left_proposed(root: Path, files: list[str]) -> list[str]: + """C11 (D312, #587): a cycle is accepted by what its file says — `status: accepted`, or `accepted_on` while + another runs —, never by the approval of the pull request that carries it. A pull request that + leaves a cycle proposed with neither is said so, as a warning: a decider may approve a proposal + without accepting it. Only in a framed project: before, the framing accepts charter and cycle.""" + if plan.stage(root) != plan.FRAMED: + return [] + running = plan.accepted_cycle(root) + said = [] + for path in plan.cycle_files(root): + if path.relative_to(root).as_posix() not in files: + continue + data = plan.read_front_matter(path)[0] + if not data or data.get("status") != "proposed" or "accepted_on" in data: + continue + action = (f"add accepted_on: — it stays proposed, and " + f"{running[0].name}'s closure starts it" if running else + "set status: accepted and its start, on the day of the decider's word") + said.append(f"[C11] {path.name} stays proposed: approving this pull request does not accept it.\n" + f" Action: {action}; or leave it as it is, a proposal still being framed " + "(.nstack/handbook/project.md).") + return said + + def this_pull(root: Path, head: str) -> dict: """What names the pull request a record is made for (#508): its number where the forge gives it, and the branch it is made on — a branch started on another's carries that one's records too.""" @@ -1309,7 +1334,7 @@ def run(root: Path, base: str, body_file: Path | None = None, labels_given: str labels, labels_from, refused = labels_for(root, head, given) failures: list[str] = [] - warnings = charter_without_pdr(root, base, files) + warnings = charter_without_pdr(root, base, files) + cycle_left_proposed(root, files) def fail(rule: str, message: str) -> None: failures.append(f"[{rule}] {message}") From 9e344bb843a14cf5c26e9c582db941523e4a2da3 Mon Sep 17 00:00:00 2001 From: "napkinstack-agent[bot]" <330339777+napkinstack-agent[bot]@users.noreply.github.com> Date: Sun, 29 Nov 2026 23:18:00 +0100 Subject: [PATCH 2/2] =?UTF-8?q?D312=20=E2=80=94=20C11=20is=20shown=20on=20?= =?UTF-8?q?the=20check,=20and=20a=20closure=20is=20not=20warned=20(#587)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The verifier found C11 printed in the job's log only, while the job stays green: a decider approving from the pull request's page would miss it as before. It is now an annotation on the check, as R1 and R2 are. A closure with no next cycle is tested unwarned; RULES.md and project.md say where C11 applies; its action cites the framing playbook. Agent-Session: napkinstack-os-1e Co-Authored-By: Claude Opus 5.5 --- docs/governance/workstreams.md | 2 +- platform/tests/test_pull_request.py | 8 +++++++- skeleton/.nstack/handbook/RULES.md | 2 +- skeleton/.nstack/handbook/project.md | 2 +- src/napkinstack/pull_request.py | 8 +++++--- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/docs/governance/workstreams.md b/docs/governance/workstreams.md index e1ff0bf..4c0362a 100644 --- a/docs/governance/workstreams.md +++ b/docs/governance/workstreams.md @@ -328,7 +328,7 @@ state to its index: [`docs/adr/`](../adr/README.md), [`docs/pdr/`](../pdr/README | D309 | **A table after the test sheet in a comment was read as its rows** (no issue; reported by the consumer project's coordinator, 2026-11-29). D305 moved the signed sheet into a comment, where no template heading ends the section: a verifier's "Mutants" table after the sheet was read as scenarios, and T2 failed ("scenario M1 …", 4 of 5) | **Done**: `read_sheet` leaves out a table after the sheet that GitHub renders apart — its own header, other than the sheet's, over a delimiter line —, in a description as in a comment: it is the verifier's own. Rows after a blank line, which GitHub shows as text, are still read as the sheet's: a failed one fails rather than vanishes (a fresh verifier's finding). A comment written with CRLF line endings, as a browser sends it, is read too | | D310 | **An agent's run stopped at start on Claude Code's trust screen for its skills folder** (#578). Downstream, 2026-11-29, Claude Code 2.1.332: the folder D261 hands Claude Code with `--add-dir` asked "Adding a new directory … Is this a directory you created or one you trust?" at every start, `No, exit` the default, so no unattended agent began. A deliberate safeguard of Claude Code, never stepped around | **Done**: `nstack agent run -- claude` lays the default branch's skills as a plugin of the session (`.claude-plugin/plugin.json` named `project`, `skills//`) and passes `--plugin-dir`, the path Claude Code documents for a program handing a session skills. Measured on 2.1.332 through a pseudo-terminal: `--add-dir` asks, `--plugin-dir` does not and loads the skills; `permissions.additionalDirectories` in `--settings` does not ask but loads no skill. In the session the skills are named `project:`, said by the run and in `INSTALL.md`. Not taken: a persistent trust entry (the person's setting, a manual step); any flag that skips the trust check. Not caught by the tests: Claude Code's own screen — CI runs a stand-in for `claude` | | D311 | **An agent's skills lost their skip-worktree bit, and its commit stopped in the sandbox's mask** (#584). Downstream, 2026-11-29, nstack 0.35.3: the five agents' clones kept D261's sparse patterns, but their committed skills showed as deleted; pre-commit's stash wrote them back into the mask, and `git checkout -- .` failed with "Device or resource busy". The loss itself was not reproduced beyond one clone's commit of the sandbox's masks: git clears the bit wherever the file is present | **Done**: at each `nstack agent run`, a skill outside the patterns that is absent from the working tree gets its bit back, in the index alone; one the working tree holds stays and is said kept, as before. Not taken: `git sparse-checkout reapply`, which leaves them while the sandbox's placeholder stands; `--assume-unchanged`, a hint git may drop. Not caught: a bit lost during a session is set again only at the agent's next run | -| D312 | **A cycle left proposed was approved as if accepted** (#587). Downstream, 2026-11-29: the next cycle, `proposed` with no `accepted_on` while one ran, was approved by the decider as its acceptance; neither fitness nor pr-check said the approval accepted nothing, and a second push and a second approval followed. The framing playbook said it; nothing said it where the approval is given | **Done**: pr-check warns (C11) on a pull request that leaves a cycle `proposed` with no `accepted_on`, in a framed project, with the gesture: `accepted_on` while a cycle runs, else `status: accepted` and its start. A warning, not a failure: a decider may approve a proposal still being framed. Not caught: a cycle proposed during framing, before the charter is accepted — the framing accepts both | +| D312 | **A cycle left proposed was approved as if accepted** (#587). Downstream, 2026-11-29: the next cycle, `proposed` with no `accepted_on` while one ran, was approved by the decider as its acceptance; neither fitness nor pr-check said the approval accepted nothing, and a second push and a second approval followed. The framing playbook said it; nothing said it where the approval is given | **Done**: pr-check warns (C11) on a pull request that leaves a cycle `proposed` with no `accepted_on`, in a framed project — on the check itself, beside the approval, not only in its log — with the gesture: `accepted_on` while a cycle runs, else `status: accepted` and its start. A warning, not a failure: a decider may approve a proposal still being framed. Not caught: a cycle proposed during framing, before the charter is accepted — the framing accepts both | | 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_pull_request.py b/platform/tests/test_pull_request.py index 9de21a7..8010817 100644 --- a/platform/tests/test_pull_request.py +++ b/platform/tests/test_pull_request.py @@ -834,7 +834,9 @@ def cycle_change(root, next_cycle: dict | None, running: bool = True, charter: s git(root, "add", "-A") git(root, "commit", "-q", "-m", "base") base = git(root, "rev-parse", "HEAD") - if next_cycle is None: + if next_cycle == "closure": + write(root, "cycles/01-first.md", cycle(status="closed", outcome="Shipped", goal="Invoices, closed")) + elif next_cycle is None: write(root, "cycles/01-first.md", cycle(goal="Customers receive their invoices, signed")) else: write(root, "cycles/02-next.md", next_cycle) @@ -852,6 +854,7 @@ def cycle_change(root, next_cycle: dict | None, running: bool = True, charter: s "a next cycle accepted": (cycle(), False, None, "accepted"), "the running cycle changed, a proposal on the base untouched": (None, True, None, "accepted"), "a project still being framed": (cycle(status="proposed"), False, None, "proposed"), + "a closure, no next cycle": ("closure", False, None, "accepted"), } @@ -860,11 +863,14 @@ def cycle_change(root, next_cycle: dict | None, running: bool = True, charter: s def test_c11_a_cycle_left_proposed_is_said_not_accepted_by_the_approval(tmp_path, capsys, monkeypatch, _, next_cycle, running, action, charter): base, head = cycle_change(tmp_path, next_cycle, running, charter) + monkeypatch.setenv("GITHUB_ACTIONS", "true") check(tmp_path, base, head, "A cycle.", monkeypatch, deliverable_line=None) output = capsys.readouterr().out assert ("WARNING [C11]" in output) is (action is not None), output if action: assert "02-next.md" in output and f"Action: {action}" in output, output + # on the check the decider approves beside, not only in its log + assert "::warning title=C11 cycle not accepted by the approval::02-next.md stays proposed" in output, output def test_k3_tells_a_ready_deliverable_to_move(tmp_path, capsys, monkeypatch): diff --git a/skeleton/.nstack/handbook/RULES.md b/skeleton/.nstack/handbook/RULES.md index b667e48..c8c92fb 100644 --- a/skeleton/.nstack/handbook/RULES.md +++ b/skeleton/.nstack/handbook/RULES.md @@ -77,7 +77,7 @@ a family, a number a rule; a retired rule's number is never reused. | `C8` | A document left as its form once its moment has come: the front page's sentence at a go, the whole front page at an accepted charter, the module map once a module holds code | `06-decisions.md` §10 | | `C9` | *(warning)* An accepted charter changed by a pull request that carries no decision record | `06-decisions.md` §4 | | `C10` | *(warning)* An accepted decision record due at a closure — its criterion names the cycle, or a date in bold, `**YYYY-MM-DD**`, its end reached — with no reading line; a criterion with neither, holding a plain date its end reached, is told to bold its due date | `06-decisions.md` §6 | -| `C11` | *(warning)* A pull request that leaves a cycle `proposed` with no `accepted_on`: its approval does not accept it | `.nstack/playbooks/framing.md` §3 | +| `C11` | *(warning)* In a framed project, a pull request that changes a cycle and leaves it `proposed` with no `accepted_on`: its approval does not accept it | `.nstack/playbooks/framing.md` §3 | ## H — hygiene diff --git a/skeleton/.nstack/handbook/project.md b/skeleton/.nstack/handbook/project.md index 2bd01ad..41b1c44 100644 --- a/skeleton/.nstack/handbook/project.md +++ b/skeleton/.nstack/handbook/project.md @@ -59,7 +59,7 @@ missing. | Check | When | Rules | |---|---|---| | The plan, a fitness function | Every push | Formats; one accepted cycle at a time, under an accepted charter; `end` = `start` + the appetite; acceptance criteria once a deliverable is ready; closures recorded; a discovery decided with its decider and date, a charter only after a go. A charter, a cycle or a deliverable still holding the template's words is refused. A decision record due at a closure and not yet read is warned of, never refused (C10) | -| The pull request check | Every pull request changing a module beyond its description — manifest, `AGENTS.md`, `README.md`, `docs/`, unless the manifest moves its criticality or its user-visible surface; not a framework update — **once the charter is accepted** | An accepted cycle; not past its end date; a ready or in-progress deliverable named — and, when someone holds it, delivered by its holder — or the `out-of-cycle` label with its justification. An accepted charter changed with no decision record is warned of (C9) | +| The pull request check | Every pull request changing a module beyond its description — manifest, `AGENTS.md`, `README.md`, `docs/`, unless the manifest moves its criticality or its user-visible surface; not a framework update — **once the charter is accepted** | An accepted cycle; not past its end date; a ready or in-progress deliverable named — and, when someone holds it, delivered by its holder — or the `out-of-cycle` label with its justification. An accepted charter changed with no decision record is warned of (C9); on any pull request, a cycle it leaves `proposed` with no `accepted_on`, which its approval does not accept (C11) | ## A cycle's progress diff --git a/src/napkinstack/pull_request.py b/src/napkinstack/pull_request.py index d9c43c2..4dce073 100644 --- a/src/napkinstack/pull_request.py +++ b/src/napkinstack/pull_request.py @@ -938,9 +938,11 @@ def cycle_left_proposed(root: Path, files: list[str]) -> list[str]: action = (f"add accepted_on: — it stays proposed, and " f"{running[0].name}'s closure starts it" if running else "set status: accepted and its start, on the day of the decider's word") - said.append(f"[C11] {path.name} stays proposed: approving this pull request does not accept it.\n" - f" Action: {action}; or leave it as it is, a proposal still being framed " - "(.nstack/handbook/project.md).") + line = f"[C11] {path.name} stays proposed: approving this pull request does not accept it." + said.append(f"{line}\n Action: {action}; or leave it as it is, a proposal still being framed " + "(.nstack/playbooks/framing.md §3).") + if os.environ.get("GITHUB_ACTIONS") == "true": # seen on the check the decider approves beside, as R1 + print(f"::warning title=C11 cycle not accepted by the approval::{line.removeprefix('[C11] ')}") return said