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 @@ -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 <name> -- claude` lays the default branch's skills as a plugin of the session (`.claude-plugin/plugin.json` named `project`, `skills/<skill>/`) 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:<skill>`, 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 — 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 |
Expand Down
53 changes: 53 additions & 0 deletions platform/tests/test_pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,59 @@ 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 == "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)
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"),
"a closure, no next cycle": ("closure", False, None, "accepted"),
}


@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)
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):
"""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
Expand Down
1 change: 1 addition & 0 deletions skeleton/.nstack/handbook/RULES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)* 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

Expand Down
2 changes: 1 addition & 1 deletion skeleton/.nstack/handbook/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion skeleton/.nstack/playbooks/framing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <the day of the word>`: `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,
Expand Down
29 changes: 28 additions & 1 deletion src/napkinstack/pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -919,6 +920,32 @@ 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: <the day of the decider's word> — 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")
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


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."""
Expand Down Expand Up @@ -1309,7 +1336,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}")
Expand Down