Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/governance/workstreams.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ state to its index: [`docs/adr/`](../adr/README.md), [`docs/pdr/`](../pdr/README
| 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 |
| D313 | **The update's refusal off main did not say it makes its own branch, nor the way from a worktree** (#589). Downstream, 2026-11-29, 0.35.4: the coordinator made a branch and a worktree for the update first, as for any change; the refusal said `git switch main`, which a worktree beside main's cannot do | **Done**: `nstack update`, `nstack update --forge` and `nstack config` refuse with one Action: `git switch <default>`, or in a worktree beside the one that holds it `git switch --detach <default>` (#261), and the command makes its own branch: make none before |
| 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` |
| 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) |
Expand Down
23 changes: 22 additions & 1 deletion platform/tests/test_pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,20 @@ def test_a_person_named_verifier_left_a_trace_on_the_pull_request(tmp_path, caps
output = capsys.readouterr().out
assert expected in output, output
assert result == code, output
assert "session" not in verifier or "WARNING [T2]" not in output, output
assert "session" not in verifier or "hand is on this pull request" not in output, output # no hand asked of a session


def test_no_sheet_in_play_nothing_is_said_of_comments_not_read(tmp_path, capsys, monkeypatch):
"""D315: a change no module asks a sheet of, and a description with none: no word of comments."""
base, head = change(tmp_path)
monkeypatch.setattr(pull_request, "signed_sheet", lambda path: None)
check(tmp_path, base, head, "A change.", monkeypatch)
assert "comments are not read" not in capsys.readouterr().out
assert not pull_request.sheet_in_play(tmp_path, base, "A change.")
# A sheet the description fills, though no module asks one: it is judged, so said.
check(tmp_path, base, head, sheet(PASSED, verifier="@dana"), monkeypatch)
assert "comments are not read" in capsys.readouterr().out
assert pull_request.sheet_in_play(tmp_path, base, sheet(PASSED, verifier="@dana"))


def test_off_github_the_hand_is_not_read(tmp_path, capsys, monkeypatch):
Expand Down Expand Up @@ -1083,6 +1096,14 @@ def test_where_the_pull_request_is_not_read_the_description_is_judged_as_ever(tm
out = capsys.readouterr().out
assert "signed in the description" not in out and "Signed sheet" not in out, out
assert ("is not read: no token" in out) is bool(answer), out
# D315: with no pull request number, the comments are not read and nothing said it — an attest
# without a token recorded 5 of 5 on the description's sheet where the forge's run refused it.
assert ("WARNING [T2] the pull request's comments are not read here" in out) is (answer is None), out
# D315: required, the description's sheet left as the template's — the signed one may be in a comment —: said.
monkeypatch.setattr(pull_request, "signed_sheet", lambda path: None)
check(tmp_path, base, head, sheet(PASSED, verifier="<@handle, or session and the agent session's identifier>"),
monkeypatch)
assert "the pull request's comments are not read here" in capsys.readouterr().out
monkeypatch.setattr(pull_request.project, "forge", lambda root: "gitlab")
monkeypatch.setattr(pull_request, "signed_sheet", lambda path: pytest.fail("read off GitHub"))
assert check(tmp_path, base, head, sheet(PASSED, verifier="@dana"), monkeypatch) == 0, capsys.readouterr().out
Expand Down
32 changes: 32 additions & 0 deletions platform/tests/test_sheet_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,38 @@ def test_a_removal_the_description_says_clears_a_signed_sheet_s_gone_row(verifie



def test_attest_with_no_pull_request_found_says_the_signed_sheet_is_not_read(verified_then_fixed, monkeypatch, capsys):
"""D315 (#595): downstream, an attest with no token found no pull request, judged the description's
sheet and recorded 5 of 5, where the run that read the verifier's comment refused it. Said in its output."""
from napkinstack import pull_request

root, base, _, second = verified_then_fixed
monkeypatch.setattr(pull_request, "this_pull", lambda path, head: {"branch": "d1"})
for name in ("PR_HEAD_SHA", "PR_BODY", "PR_NUMBER"):
monkeypatch.delenv(name, raising=False)
monkeypatch.setattr(attest, "CHECKS", ())
attest.run(root, base, _body(root, "unfilled", ("S2", GIVEN, "", "", "", "")), "")
assert "Signed sheet: not read — no pull request found for this commit" in capsys.readouterr().out
# The template's sheet left empty, on a change that requires one: said too, as pr-check warns it.
empty = root.parent / "empty.md"
empty.write_text("## Test sheet\n\nVerifier: <@handle, or session and the agent session's identifier>\n",
encoding="utf-8")
attest.run(root, base, empty, "")
assert "Signed sheet: not read" in capsys.readouterr().out
# The pull request read, its comments holding no sheet: nothing to say.
monkeypatch.setattr(pull_request, "this_pull", lambda path, head: {"number": 7, "branch": "d1"})
monkeypatch.setattr(pull_request, "signed_sheet", lambda path, number=None: {
"body": None, "author": "", "at": "", "more": False, "refused": [], "earlier": []})
attest.run(root, base, empty, "")
assert "Signed sheet: not read" not in capsys.readouterr().out
# Off GitHub, no pull request is ever read: nothing to say.
monkeypatch.setattr(pull_request, "this_pull", lambda path, head: {"branch": "d1"})
from napkinstack import project
monkeypatch.setattr(project, "forge", lambda root: "gitlab")
attest.run(root, base, empty, "")
assert "Signed sheet: not read" not in capsys.readouterr().out


def test_attest_judges_and_records_the_sheet_signed_in_a_comment(verified_then_fixed, monkeypatch, capsys):
"""B1 of the audit: where checks are attested, the verifier signs in a comment as everywhere — attest
reads it on the forge, its pr-check judges it, and the record holds its rows for T4."""
Expand Down
3 changes: 2 additions & 1 deletion skeleton/.nstack/playbooks/verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ such a sheet is the one judged: a fix, or a scenario added, is signed again in a
by editing the old one. A comment starts no check: **add the `verified` label** to start it —
to sign again later, remove it and add it again (missing from a project made before it:
`nstack settings --apply` creates it, G11). Where checks are attested, the author runs
`nstack attest` again once you have signed: it reads your comment, as CI does. A sheet signed in
`nstack attest` again once you have signed: with a token (`GH_TOKEN`) it reads your comment, as CI
does; without one it judges the description's sheet, and says so. A sheet signed in
the description is still read while no comment holds one, with a warning.

### Your own ground
Expand Down
8 changes: 7 additions & 1 deletion src/napkinstack/attest.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ def run(root: Path, base: str, body_file: Path | None, labels: str | None, accep
# The sheet the verifier signed in a comment or a review, read once on the forge (D305): pr-check,
# run below, judges it as the forge's own run would, and the record holds its rows for T4.
from napkinstack import project as _project
from napkinstack.pull_request import signed_sheet
from napkinstack.pull_request import sheet_in_play, signed_sheet

pull = this_pull(root, commit)
signed = signed_sheet(root, pull["number"]) if pull.get("number") and _project.forge(root) == "github" else None
Expand All @@ -943,6 +943,12 @@ def run(root: Path, base: str, body_file: Path | None, labels: str | None, accep
env["NSTACK_SIGNED"] = str(Path(tmp, "signed.json").resolve())
if isinstance(signed, dict) and signed["body"]:
print(f"Signed sheet: the latest comment or review of @{signed['author']}, {signed['at']}", flush=True)
elif signed is None and _project.forge(root) == "github" and sheet_in_play(root, base, body_text):
# D315 (#595): pr-check's warning stays in its step's log; the record's reader sees this line.
print("Signed sheet: not read — no pull request found for this commit (no token, or none open "
"whose head it is): the "
"description's sheet is judged here; the forge's run judges the one signed in a comment.",
flush=True)
digest = inputs(root, base, json.dumps([engine, unplaced(origin, root), origin is None, who]))
env["NSTACK_INPUTS"] = digest or "" # the head's, for pr-check's T4 while this record is made (D223)
for check in CHECKS:
Expand Down
18 changes: 18 additions & 0 deletions src/napkinstack/pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,15 @@ 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 sheet_in_play(root: Path, base: str, body: str) -> bool:
"""D315: a test sheet matters to this change — the description fills one, or a module it touches
requires one. What pr-check reads as `described or reasons`, for attest to say what pr-check warns."""
if read_sheet(body)[0]:
return True
fork = _git(root, "merge-base", base, "HEAD").stdout.strip() or base
return any(sheet_reason(folder, found) for folder, found in touched_modules(root, fork, changed_files(root, base)).items())


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
Expand Down Expand Up @@ -1368,6 +1377,15 @@ def tree_of(commit: str) -> str:
f"request is not read: {hands}.")
if isinstance(signed, str) and (reasons or described):
warnings.append(f"[T2] whether the verifier signed the sheet in a comment or a review is not read: {signed}.")
if forge == "github" and signed is None and (reasons or described): # as sheet_in_play
# D315 (#595): no pull request number — a workstation, an attest that found none with no token —, so
# the comments are not read and the description's sheet is judged; the forge's run reads them and
# may judge otherwise. Said, never failed: checks on a workstation stand without a token (ADR-0010 §6).
warnings.append("[T2] the pull request's comments are not read here (no pull request number given): "
"the description's sheet is judged, not one the verifier "
"signed in a comment, which the forge's run judges in its place.\n Action: GH_TOKEN "
"for nstack attest, or PR_NUMBER and a token for nstack pr-check, to judge the signed "
"sheet here (.nstack/playbooks/verification.md).")
if isinstance(signed, dict) and signed.get("refused"):
warnings.append("[T2] a sheet in a comment or a review is not counted as signed: " + "; ".join(signed["refused"])
+ ".\n Action: the verifier named signs it from their own account — an agent from its App — "
Expand Down