diff --git a/plugins/product-development/skills/product-development/SKILL.md b/plugins/product-development/skills/product-development/SKILL.md index 9d16ef1..9c26698 100644 --- a/plugins/product-development/skills/product-development/SKILL.md +++ b/plugins/product-development/skills/product-development/SKILL.md @@ -122,6 +122,8 @@ A missing foundation document does not trigger this workflow during ideas, disco Override the brainstorming skill's own hand-off. It saves its design under `docs/superpowers/specs/` and then invokes `writing-plans`. Here, save the approved design as the change's shaping document in `docs/product/shaping/{feature}--{change}/`, then return control to this skill. The shaping document includes the change's provenance record (`references/changes-and-deltas.md`, Provenance). A change to an existing feature names it in the shaping document's front matter: `x-amends: {feature}`. The override ends there: this skill never invokes `writing-plans` or plans implementation, which belongs to the implementation workflow. +When the requirements are already clear and the Foundation Gate has passed, skip brainstorming: write them as the change's shaping document, provenance record included, and get the maintainer's approval of it as the design. + An early idea that nobody is shaping yet goes to `docs/product/ideas/` instead, with no gate. **Output:** Approved design, saved as the change's shaping document in `docs/product/shaping/{feature}--{change}/`. @@ -177,7 +179,7 @@ An early idea that nobody is shaping yet goes to `docs/product/ideas/` instead, **Trigger:** Scenarios are reviewed and cover the acceptance criteria. -**Process:** Follow `references/ratification.md` for the ratification checks and the promotion PR body, and review the PR against the checklist in `references/promotion-review.md`, which the `spec-reviewer` agent uses. Run the overlap check (`references/changes-and-deltas.md`) and put its report in the promotion PR. With the maintainer's approval, open a promotion PR that moves the change's approved documents from `docs/product/shaping/{feature}--{change}/` into `docs/product/features/{feature}/changes/{change}/`, sets their OKF `status` to `stable`, and adds a Ratified entry to the feature log. For a new feature, the PR also creates the feature bundle: a metadata-only feature overview that claims no behavior, `log.md` and `changes/`. The first canonization writes the complete overview and the facet specs (`references/feature-bundles.md`). The maintainer reviews it and orders or combines any overlapping changes. Run the overlap check again just before the PR merges. At both points, also run the design-level open-questions check (`references/open-questions.md`): no open `design` or `none yet` question may name the change unless the maintainer approved its deferral. Merging the promotion PR ratifies the change; the merge is the approval record. Code alone never admits a spec, so a change whose code has already shipped still goes through promotion. +**Process:** Follow `references/ratification.md` for the ratification checks and the promotion PR body, and review the PR against the checklist in `references/promotion-review.md`, which the `spec-reviewer` agent uses. Run the overlap check (`references/changes-and-deltas.md`) and put its report in the promotion PR. Before the promotion PR opens, the approved change must be on the default branch in `docs/product/shaping/{feature}--{change}/`: if its approved documents are not there yet, land them first, in a PR of its own, opened with the maintainer's approval. The promotion PR then shows the move from `shaping/` to `features/` that board mapping detects, and closing it without merging leaves the change in `shaping/` (`references/board-mapping.md`). With the maintainer's approval, open a promotion PR that moves the change's approved documents from `docs/product/shaping/{feature}--{change}/` into `docs/product/features/{feature}/changes/{change}/`, sets their OKF `status` to `stable`, and adds a Ratified entry to the feature log. For a new feature, the PR also creates the feature bundle: a metadata-only feature overview that claims no behavior, `log.md` and `changes/`. The first canonization writes the complete overview and the facet specs (`references/feature-bundles.md`). The maintainer reviews it and orders or combines any overlapping changes. Run the overlap check again just before the PR merges. At both points, also run the design-level open-questions check (`references/open-questions.md`): no open `design` or `none yet` question may name the change unless the maintainer approved its deferral. Merging the promotion PR ratifies the change; the merge is the approval record. Code alone never admits a spec, so a change whose code has already shipped still goes through promotion. The promotion PR also lists each app-local scenario file under `apps/{surface}/docs/features/{feature}/scenarios/` that it adds or changes, so the maintainer ratifies surface-specific scenarios with the rest of the change. @@ -385,7 +387,7 @@ Not every feature starts at the beginning. Match the entry point to the current | Missing, unapproved, or unversioned constitution or vision before first PRD | Foundation workflow | | Early idea nobody is shaping yet | Record it in `ideas/` | | Vague idea, no clarity on approach | Discovery and Design | -| Clear requirements, needs documentation | Requirements after Foundation Gate | +| Clear requirements, needs documentation | Discovery and Design: record them as the change's shaping document and get it approved, skipping brainstorming once the Foundation Gate passes; then Requirements | | PRD or TRD drafted, not yet approved | Requirements: finish its review and approval | | PRD and TRD approved, no stories yet | User Stories | | Stories drafted, not yet approved, or without acceptance criteria | User Stories: finish them | @@ -406,7 +408,7 @@ Not every feature starts at the beginning. Match the entry point to the current | A codebase whose features have no product docs, or specs only in other formats (Spec Kit, OpenSpec, design and plan files) | Retrofit (`references/retrofit.md`) | | Specs written with version 0.1.0 of this skill (a PRD and TRD per feature folder, changelog tables, committed plans) | Modernization (`references/modernization.md`) | -Clear requirements may skip brainstorming only after Foundation Gate passes. If this is the first PRD and `docs/product/constitution.md` or `docs/product/vision.md` is missing, unapproved, or unversioned, run the Foundation workflow before Requirements. +Clear requirements may skip brainstorming only after the Foundation Gate passes, never the approved shaping document: Requirements starts from an approved design (`references/requirements.md`), so record them as the change's shaping document and get it approved first. If this is the first PRD and `docs/product/constitution.md` or `docs/product/vision.md` is missing, unapproved, or unversioned, run the Foundation workflow before Requirements. ## Skill Delegation diff --git a/plugins/product-development/skills/product-development/references/board-mapping-github-projects.md b/plugins/product-development/skills/product-development/references/board-mapping-github-projects.md index fb21355..fb29062 100644 --- a/plugins/product-development/skills/product-development/references/board-mapping-github-projects.md +++ b/plugins/product-development/skills/product-development/references/board-mapping-github-projects.md @@ -12,7 +12,7 @@ Every `gh project` command below that writes to the board runs only after the ma gh auth refresh -s project ``` -Name the project, its owner and the repository once per session. `OWNER` is the organization or user that owns the project; use `@me` for a project you own. `REPO` is the repository whose `docs/product/` holds the changes. +Name the project, its owner and the repository once per session. `OWNER` is the organization or user that owns the project; use `@me` for a project you own. `REPO` is the repository whose `docs/product/` holds the changes. Every `gh pr` command and REST call below names it, with `--repo "$REPO"` or `repos/$REPO/`, so it reads that repository whichever directory the shell is in. ```sh OWNER= @@ -131,9 +131,9 @@ set_spec_state() { # it reads fewer files than the pull request changed. promotion_change() { local total moves got - total=$(gh api "repos/{owner}/{repo}/pulls/$1" --jq .changed_files) || return 1 + total=$(gh api "repos/$REPO/pulls/$1" --jq .changed_files) || return 1 # One "file" line per file read, then one line per move out of shaping or into changes. - moves=$(gh api --paginate "repos/{owner}/{repo}/pulls/$1/files" --jq '.[] + moves=$(gh api --paginate "repos/$REPO/pulls/$1/files" --jq '.[] | "file", (select(.status == "renamed" or .status == "removed") | (.previous_filename // .filename) @@ -160,16 +160,16 @@ promotion_change() { closing_refs() { local closers total commits got closers='def closers: [scan("(?i)\\b(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?):?\\s+(?:https://github\\.com/[\\w.-]+/[\\w.-]+/issues/|(?:[\\w.-]+/[\\w.-]+)?#)[0-9]+")] | .[];' - total=$(gh api "repos/{owner}/{repo}/pulls/$1" --jq .commits) || return 1 + total=$(gh api "repos/$REPO/pulls/$1" --jq .commits) || return 1 # One bare SHA line per commit read, then one line per closing keyword in it. - commits=$(gh api --paginate "repos/{owner}/{repo}/pulls/$1/commits" --jq "$closers"' + commits=$(gh api --paginate "repos/$REPO/pulls/$1/commits" --jq "$closers"' .[] | .sha[0:7] as $sha | $sha, (.commit.message | closers | "commit \($sha): \(.)")') || return 1 got=$(grep -cv '^commit ' <<< "$commits") if [ "$got" -ne "$total" ]; then echo "closing_refs $1: read $got of $total commits; check the rest by hand" >&2 return 1 fi - gh pr view "$1" --json title,body,closingIssuesReferences --jq "$closers"' + gh pr view "$1" --repo "$REPO" --json title,body,closingIssuesReferences --jq "$closers"' ((.title, .body) | closers | "title or body: \(.)"), (.closingIssuesReferences[] | "closes on merge: \(.url)")' || return 1 grep '^commit ' <<< "$commits" || true @@ -178,7 +178,7 @@ closing_refs() { # promotion_prs: each open promotion PR and the change it promotes, tab-separated promotion_prs() { local prs pr changes - prs=$(gh api --paginate "repos/{owner}/{repo}/pulls?state=open&per_page=100" \ + prs=$(gh api --paginate "repos/$REPO/pulls?state=open&per_page=100" \ --jq '.[].number') || return 1 while read -r pr; do [ -n "$pr" ] || continue @@ -236,9 +236,9 @@ Each move follows [Board moves](board-mapping.md#board-moves). The evidence is w |-------|----------|-----------| | The maintainer asks to track an idea | The idea in `docs/product/ideas/` on the default branch | Idea | | The idea moves to shaping | `docs/product/shaping/{feature}--{change}/` on the default branch | Shaping | -| The promotion PR opens or reopens | `gh pr view --json state` says `OPEN`, and `closing_refs ` prints nothing | In review | -| The promotion PR closes without merging | `gh pr view --json state` says `CLOSED`; the change is still in `shaping/` | Shaping | -| The promotion PR merges | `gh pr view --json state` says `MERGED`; the change is in `features/{feature}/changes/{change}/` | Ratified | +| The promotion PR opens or reopens | `gh pr view --repo "$REPO" --json state` says `OPEN`, and `closing_refs ` prints nothing | In review | +| The promotion PR closes without merging | `gh pr view --repo "$REPO" --json state` says `CLOSED`; the change is still in `shaping/` | Shaping | +| The promotion PR merges | `gh pr view --repo "$REPO" --json state` says `MERGED`; the change is in `features/{feature}/changes/{change}/` | Ratified | | The Shipped entry lands | A `Shipped: {change}` entry in `features/{feature}/log.md` on the default branch | Shipped | | The canonization PR merges | The change is in `features/{feature}/changes/archive/YYYY-MM-DD-{change}/` | Canonized | | The drop lands | The change's directory is gone, and `features/log.md` has its `Dropped change` entry | Dropped | @@ -270,7 +270,7 @@ Run a drift check when the maintainer asks, before a planning or review session, promotion_prs ``` - `gh pr list --json files` gives one path per renamed file, so it can't show a move from `shaping/` to `changes/`. `promotion_change` reads the pull request's files from the REST API instead (`gh api` fills `{owner}/{repo}` from the current repository), where a renamed file carries both `previous_filename` and `filename`, and counts a pull request as a promotion only when files leave `shaping/{feature}--{change}/` and arrive in `features/{feature}/changes/{change}/` for the same change. It stops if it read fewer files than the pull request's `changed_files`, since the files endpoint lists at most 3,000. + `gh pr list --json files` gives one path per renamed file, so it can't show a move from `shaping/` to `changes/`. `promotion_change` reads the pull request's files from the REST API instead (at `repos/$REPO/`, the repository named in [Setup](#setup), not whichever one the current directory belongs to), where a renamed file carries both `previous_filename` and `filename`, and counts a pull request as a promotion only when files leave `shaping/{feature}--{change}/` and arrive in `features/{feature}/changes/{change}/` for the same change. Those files leave `shaping/` because a promotion PR opens only once the change is in `shaping/` on the default branch ([ratification.md](ratification.md#1-prepare-the-promotion-pr)); a pull request that adds a change straight to `features/` shows no such move and is not detected. It stops if it read fewer files than the pull request's `changed_files`, since the files endpoint lists at most 3,000. Check that no promotion PR would close an issue: @@ -336,7 +336,7 @@ set_spec_state shared-calendars/invite-expiry "Shaping" The promotion PR #214 (promote invite-expiry) opens. Its body and its commit say `Refs #210`, with no closing keyword. The agent checks the evidence: ```sh -gh pr view 214 --json state --jq .state +gh pr view 214 --repo "$REPO" --json state --jq .state closing_refs 214 ``` @@ -370,13 +370,13 @@ The next commit to the default branch that touches `docs/product/` adds to `feat The maintainer reworks the change on the promotion PR's branch, adding a per-calendar expiry window, and reopens the original promotion PR: ```sh -gh pr reopen 214 +gh pr reopen 214 --repo "$REPO" ``` The agent checks that #214 is open again and still closes nothing: ```sh -gh pr view 214 --json state --jq .state +gh pr view 214 --repo "$REPO" --json state --jq .state ``` ```text diff --git a/plugins/product-development/skills/product-development/references/board-mapping.md b/plugins/product-development/skills/product-development/references/board-mapping.md index 2da7f46..466064c 100644 --- a/plugins/product-development/skills/product-development/references/board-mapping.md +++ b/plugins/product-development/skills/product-development/references/board-mapping.md @@ -41,7 +41,7 @@ A Shipped change cannot be dropped, so no item moves from Shipped to Dropped. ## Closed promotion PRs -A promotion PR closed without merging returns the change to Shaping: its documents are still in `shaping/{feature}--{change}/`. The lineage log, `features/log.md`, gets a "Promotion PR closed without merging" entry saying why. A closed PR can't carry its own entry, so the next commit to the default branch that touches `docs/product/` adds it ([feature-bundles.md](feature-bundles.md#lineage-log)). +A promotion PR closed without merging returns the change to Shaping: its documents are still in `shaping/{feature}--{change}/`, because a promotion PR opens only once the change is in `shaping/` on the default branch ([ratification.md](ratification.md#1-prepare-the-promotion-pr)). The lineage log, `features/log.md`, gets a "Promotion PR closed without merging" entry saying why. A closed PR can't carry its own entry, so the next commit to the default branch that touches `docs/product/` adds it ([feature-bundles.md](feature-bundles.md#lineage-log)). If the maintainer drops the change instead, the lineage log gets both entries: the "Promotion PR closed without merging" entry, with the outcome Dropped, and a "Dropped change" entry with the drop's reason and the state when dropped ([feature-bundles.md](feature-bundles.md#lineage-log)). The PR that adds the Dropped change entry also deletes the shaping directory. The item moves to Dropped only once the PR that deletes the shaping directory and adds the Dropped change entry merges; until then it stays at Shaping. diff --git a/plugins/product-development/skills/product-development/references/implementation-handoff.md b/plugins/product-development/skills/product-development/references/implementation-handoff.md index cac1b17..e7f5d58 100644 --- a/plugins/product-development/skills/product-development/references/implementation-handoff.md +++ b/plugins/product-development/skills/product-development/references/implementation-handoff.md @@ -13,7 +13,7 @@ The handoff gives the implementation workflow: - **the affected feature spec:** every document a delta targets, and the overview of each feature a delta touches. A `DOCUMENT` entry that writes a new facet spec targets a document that does not exist yet, so the handoff names the delta instead. A `DOCUMENT` entry that rewrites an existing document, such as the feature overview, links the document as it stands at the merge commit and names the delta that rewrites it. For a feature's first change, which has no shipped spec yet, the change's deltas describe the spec to be: their `DOCUMENT` entries and added units; - **answers since ratification:** each answer the maintainer approved after the merge, with the question it answers; - **the foundation documents:** the approved constitution and vision, with their versions; -- **the project's ship signal, and any open release-level questions,** with the release check that must pass before the signal fires. +- **the project's ship signal, and any open release-level questions,** with the release checks that must pass before the signal fires: the change's, and the step's when a delivery-plan step fires it. It also carries the provenance record's non-goals and boundaries from the PRD, so the implementation workflow knows what to leave alone. @@ -41,7 +41,7 @@ Run it from the project root. `` is the directory that holds this ski Exit 0 means it can be sent. The check fails on any open `design`, `implementation` or `none yet` question that names the change without an approved deferral ([open-questions.md](open-questions.md#blocking-level)). On exit 1, work through the listed questions with the maintainer ([open-question-triage.md](open-question-triage.md)), then run the check again. While feature folders written with 0.1.0 await modernization, the check runs with `--pending` and the maintainer triages their questions too ([While modernization is in progress](open-questions.md#while-modernization-is-in-progress)). -Before sending, add the answers approved since the draft. Then list the open release-level questions in the handoff, from the check run on the commit the handoff is sent from, and record that commit. They don't hold the handoff; they hold the ship decision: +Before sending, add the answers approved since the draft. Then list the open release-level questions in the handoff, from the check run on the commit the handoff is sent from, and record that commit; when a delivery-plan step fires the ship signal, list the step's check too ([The ship signal and the release check](#the-ship-signal-and-the-release-check)). They don't hold the handoff; they hold the ship decision: ```bash python3 "/scripts/open-questions.py" blocking docs/product {feature}/{change} --level release @@ -51,7 +51,7 @@ Sending means giving the handoff to the implementation workflow, for example by ## The ship signal and the release check -The handoff names the project's ship signal: the event that makes the change live, such as the implementation PR merging, a release, or a feature flag reaching everyone. Whoever fires the ship signal runs the release check first: `python3 "/scripts/open-questions.py" blocking docs/product {feature}/{change} --level release` must exit 0 (`SKILL.md`, Release Check). If merging the implementation PR is itself the ship signal, the implementation workflow runs it before that merge. While feature folders written with 0.1.0 await modernization, it runs with `--pending` and the maintainer triages their questions too ([While modernization is in progress](open-questions.md#while-modernization-is-in-progress)). +The handoff names the project's ship signal: the event that makes the change live, such as the implementation PR merging, a release, or a feature flag reaching everyone. Whoever fires the ship signal runs the release check first: `python3 "/scripts/open-questions.py" blocking docs/product {feature}/{change} --level release` must exit 0 (`SKILL.md`, Release Check). If merging the implementation PR is itself the ship signal, the implementation workflow runs it before that merge. When a delivery-plan step fires the ship signal, the handoff carries both checks, the change's and the step's, `python3 "/scripts/open-questions.py" blocking docs/product roadmap.md# --level release`, with the step taken from the ship signal it names; both must exit 0. While feature folders written with 0.1.0 await modernization, each check runs with `--pending` and the maintainer triages their questions too, reading their 0.1.0 question tables by hand ([While modernization is in progress](open-questions.md#while-modernization-is-in-progress)). The handoff carries that note, since the implementation workflow may fire the signal. When the signal fires, a Shipped entry in the feature log records it with its evidence, and canonization follows ([canonization.md](canonization.md)). @@ -116,9 +116,13 @@ New code for this change carries `@feature {feature}`, or sits under `features/{ ## Ship signal - Before firing it, run `python3 "/scripts/open-questions.py" blocking docs/product {feature}/{change} --level release`<, with one `--pending` for each feature folder written with 0.1.0 still awaiting modernization, if any>; it must exit 0. If merging the implementation PR is the ship signal, run it before that merge. + Before firing it, run `python3 "/scripts/open-questions.py" blocking docs/product {feature}/{change} --level release`; it must exit 0. If merging the implementation PR is the ship signal, run it before that merge. -Open release-level questions, as of ``, the commit this handoff was sent from: +, the step the signal executes.> This signal executes the delivery-plan step `roadmap.md#`, so run both checks: the change's, above, and the step's, `python3 "/scripts/open-questions.py" blocking docs/product roadmap.md# --level release`. Both must exit 0. + + Run each check with one `--pending` for each feature folder written with 0.1.0 still awaiting modernization: . The checks skip their 0.1.0 rows, so the maintainer reads the 0.1.0 question tables in those folders by hand: before sending, to list any open release question that applies below, and again before firing, to triage any question that might hold the change or the step. See the skill's `references/open-questions.md#while-modernization-is-in-progress`. + +Open release-level questions, as of ``, the commit this handoff was sent from<, from both checks when a step fires the signal><, and from the 0.1.0 question tables the maintainer reviewed by hand in the folders still awaiting modernization>: - diff --git a/plugins/product-development/skills/product-development/references/open-questions.md b/plugins/product-development/skills/product-development/references/open-questions.md index 64e5080..e5aa2e0 100644 --- a/plugins/product-development/skills/product-development/references/open-questions.md +++ b/plugins/product-development/skills/product-development/references/open-questions.md @@ -42,6 +42,8 @@ Each question names what it blocks, in its Blocks cell: A question that blocks a whole document, by `this document` or by the document's path without an anchor, blocks every step in it: the check on `roadmap.md#broader-rollout` lists the delivery plan's own `this document` questions as well as the questions that name that step. +A document target, a path ending in `.md` or a path and anchor, written plainly or as a link, must resolve: to its file and to the heading or HTML anchor it names. A step's anchor is its heading's anchor as GitHub generates it, so `## Broader rollout` is `#broader-rollout`. Renaming a heading that a Blocks cell names, or moving its document, updates those Blocks cells in the same PR. Otherwise the block would silently clear, so every command refuses to run while a target does not resolve, and `blocking` refuses a target that names a missing document or step. + A product-wide release question blocks only the targets it names. A question about regional sender rules for expiry notices that names `shared-calendars/invite-expiry` holds that change's ship decision and no other. ## Identity @@ -105,7 +107,7 @@ python3 "/scripts/open-questions.py" blocking docs/product shared-cal Run the commands from the project root. `` is the directory that holds this skill's `SKILL.md`, wherever the plugin is installed; the script stays there, since `scripts/init.sh` copies no scripts into the project ([okf-profile.md](okf-profile.md#indexes)). -Every command first validates the tables and refuses to continue on any of these: a table with other columns, an ID without its matching anchor, a duplicate ID in one document, an unknown blocking level or resolution method, a deferral whose target is not a link to an open question row that links back, a chain of deferrals that loops, an approval without a real date and a link or issue or PR number for where it was given, `this change` outside a change directory, a question answered by measurement after shipping that blocks ratification or the handoff, or that is release-level and names anything but a delivery-plan step, and a link to a question anchor that does not resolve, in any document. Links may be inline, with or without a title (`[OQ-2](PRD.md#oq-2 "Expiry decision")`), or reference-style (`[label][ref]` with a `[ref]: path#oq-N` definition). +Every command first validates the tables and refuses to continue on any of these: a table with other columns, an ID without its matching anchor, a duplicate ID in one document, an unknown blocking level or resolution method, a deferral whose target is not a link to an open question row that links back, a chain of deferrals that loops, an approval without a real date and a link or issue or PR number for where it was given, `this change` outside a change directory, a question answered by measurement after shipping that blocks ratification or the handoff, or that is release-level and names anything but a delivery-plan step, a Blocks target that names a document or a step that does not resolve, and a link to a question anchor that does not resolve, in any document. Links may be inline, with or without a title (`[OQ-2](PRD.md#oq-2 "Expiry decision")`), or reference-style (`[label][ref]` with a `[ref]: path#oq-N` definition). The index sits between two marker comments in `docs/product/open-questions.md`. Regeneration replaces everything between them, so running it twice changes nothing. The index copies each question's text, with its relative links rewritten to resolve from the register; the generator refuses to run if a link in the index would not resolve, to its file or to the heading or HTML anchor it names. A register without the markers gains an `## Index` section at its end. Regenerate the index in the same PR that adds, defers, answers or moves a question. @@ -117,7 +119,7 @@ Until the last feature folder written with 0.1.0 is converted ([modernization.md python3 "/scripts/open-questions.py" blocking --pending {unconverted} docs/product {feature}/{change} --level design ``` -Every converted folder is still validated: its tables, its question links and its place in the index, so an error there fails the command as it would without `--pending`. In a pending folder, the tables are not validated. A valid row in a pending folder counts: it is indexed, and `blocking` sees it, like a row anywhere else. Rows in a table still in the 0.1.0 format are skipped: no command reads them. A question link from a pending folder to a document outside the pending folders is checked, and so is a link into it from anywhere else. The commands refuse, with exit status 2, a `--pending` that names a folder not in the 0.1.0 layout: one with a feature spec overview, `{feature}-spec.md`, or a `changes/` directory, one with no `PRD.md`, or one whose `PRD.md` or `TRD.md` has front matter. `scripts/okf-profile.py` takes the same `--pending` ([okf-profile.md](okf-profile.md#checks)). +Every converted folder is still validated: its tables, its question links and its place in the index, so an error there fails the command as it would without `--pending`. In a pending folder, the tables are not validated. A valid row in a pending folder counts: it is indexed, and `blocking` sees it, like a row anywhere else. Rows in a table still in the 0.1.0 format are skipped: no command reads them. A question link from a pending folder to a document outside the pending folders is checked, and so is a link into it from anywhere else. Blocks targets that name a document follow the same rule. The commands refuse, with exit status 2, a `--pending` that names a folder not in the 0.1.0 layout: one with a feature spec overview, `{feature}-spec.md`, or a `changes/` directory, one with no `PRD.md`, or one whose `PRD.md` or `TRD.md` has front matter. `scripts/okf-profile.py` takes the same `--pending` ([okf-profile.md](okf-profile.md#checks)). The skipped 0.1.0 rows are absent from `blocking`'s output and missing from the generated index, so a pass doesn't cover them, and the triage workflow's listing steps won't show them. Before accepting a pass at ratification, the handoff or the release check, the maintainer reads the original question tables in each pending folder's `PRD.md` and `TRD.md` that are still in the 0.1.0 format directly and triages any question that might hold the target ([open-question-triage.md](open-question-triage.md)); the gate passes only when the check exits 0 and that reading finds none that holds it. After the last conversion, the commands run without `--pending`. diff --git a/plugins/product-development/skills/product-development/references/product-vision.md b/plugins/product-development/skills/product-development/references/product-vision.md index 4826644..0de729f 100644 --- a/plugins/product-development/skills/product-development/references/product-vision.md +++ b/plugins/product-development/skills/product-development/references/product-vision.md @@ -23,7 +23,7 @@ First feature PRD work is blocked until both foundation documents exist and are - `docs/product/constitution.md` — approved product governance principles with version metadata. - `docs/product/vision.md` — approved, versioned product north star. -Do not draft the first feature PRD while either document is missing, unapproved, or unversioned. The Foundation Gate blocks drafting a PRD, not ideas or shaping. Clear requirements may skip brainstorming only after Foundation Gate passes. +Do not draft the first feature PRD while either document is missing, unapproved, or unversioned. The Foundation Gate blocks drafting a PRD, not ideas or shaping. Clear requirements may skip brainstorming only after the Foundation Gate passes; they still need an approved shaping document before Requirements. Run the Vision workflow after Product Constitution approval. The vision must reconcile against the approved constitution and cannot weaken constitutional principles. diff --git a/plugins/product-development/skills/product-development/references/ratification.md b/plugins/product-development/skills/product-development/references/ratification.md index 6d58c1d..4e1c8f5 100644 --- a/plugins/product-development/skills/product-development/references/ratification.md +++ b/plugins/product-development/skills/product-development/references/ratification.md @@ -6,6 +6,8 @@ Ratification is the maintainer's approval of a change, recorded by merging its p ## 1. Prepare the promotion PR +**Shaping on the default branch.** The approved change must already be on the default branch in `shaping/{feature}--{change}/`, with every document the promotion PR moves: its shaping document, PRD, TRD, deltas, stories and platform-level scenarios. If any is missing there or differs from its approved version, land it first, in a PR of its own that the maintainer approves opening and merges, and branch the promotion PR from the result. The promotion PR then shows the move from `shaping/` to `features/`, which board mapping reads to find promotions, and a promotion PR closed without merging leaves the change in `shaping/`, back at Shaping ([board-mapping.md](board-mapping.md#closed-promotion-prs)). + Run these before the PR is opened, and put each result in its body. Run the scripts from the project root; `` is the directory that holds this skill's `SKILL.md`, wherever the plugin is installed ([okf-profile.md](okf-profile.md#indexes)). 1. **Collision check.** If the change is named `archive` (reserved for the change archive), `features/{feature}/changes/{change}/` already exists, the change name is used in the change archive, or a new feature's bundle already exists, stop and ask the maintainer. diff --git a/plugins/product-development/skills/product-development/references/retrofit.md b/plugins/product-development/skills/product-development/references/retrofit.md index a5e89fe..e539c0b 100644 --- a/plugins/product-development/skills/product-development/references/retrofit.md +++ b/plugins/product-development/skills/product-development/references/retrofit.md @@ -17,6 +17,8 @@ Before step 1, if `docs/product/` lacks the 0.2.0 scaffold, run `"/sc A project can mix 0.1.0 feature folders with undocumented features. Version 0.1.0 also installed `docs/product/AGENTS.md` and `docs/product/README.md`, which `scripts/init.sh` keeps, and their instructions still tell agents to edit PRDs in place under `features/`. When they are present, reconcile them before seeding, as modernization's setup describes ([modernization.md](modernization.md#how-it-runs)), in the retrofit PR or a PR of its own before it. +A 0.1.0 constitution and vision have no front matter until the modernization guide's setup adds it, so the profile check fails on them. When the project has them, prepare them as that setup does ([modernization.md](modernization.md#how-it-runs)) before the retrofit PR's profile check: give both front matter as [okf-profile.md](okf-profile.md#front-matter) describes, and split a 0.1.0 vision as [product-vision.md](product-vision.md#splitting-an-existing-vision) describes, in its own PR. Then regenerate the indexes, since the front matter moves both into the root index. + ## The four steps ### 1. Maintainer braindump @@ -188,7 +190,7 @@ Return candidate features with evidence: each scope or pull request, its commit The retrofit PR writes the seeded ideas, shaping documents and research notes, and lists each feature routed to modernization. Opening it waits for the maintainer's approval, like every write to GitHub (`SKILL.md`, GitHub Writes), and the maintainer merges it. Its body lists each approved feature with its destination and records the maintainer's approval of the inventory; the inventory itself is deleted. -Regenerate both indexes, the bundle's and the open-questions index ([open-questions.md](open-questions.md#the-index-generator)), then run the checks from the project root, the profile check and the pinned upstream validator ([okf-profile.md](okf-profile.md#checks)), with one `--pending` for each 0.1.0 feature folder awaiting modernization, as [modernization.md](modernization.md#how-it-runs) describes. A question recorded during the retrofit leaves the open-questions index stale until it is regenerated: +Regenerate both indexes, the bundle's and the open-questions index ([open-questions.md](open-questions.md#the-index-generator)), then run the checks from the project root, the profile check and the pinned upstream validator ([okf-profile.md](okf-profile.md#checks)), with one `--pending` for each 0.1.0 feature folder awaiting modernization, as [modernization.md](modernization.md#how-it-runs) describes. The profile check fails on foundation documents without front matter, so a 0.1.0 constitution and vision are prepared first ([How it runs](#how-it-runs)). A question recorded during the retrofit leaves the open-questions index stale until it is regenerated: ```bash python3 "/scripts/okf-profile.py" index --pending {unconverted} docs/product diff --git a/plugins/product-development/skills/product-development/scripts/open-questions.py b/plugins/product-development/skills/product-development/scripts/open-questions.py index 5b27cf7..813d9ba 100755 --- a/plugins/product-development/skills/product-development/scripts/open-questions.py +++ b/plugins/product-development/skills/product-development/scripts/open-questions.py @@ -19,10 +19,16 @@ deferrals don't hold it. Exits 1 if any do. is a change as `{feature}/{change}`, or a document path relative to , with an optional `#anchor`, such as - the delivery-plan step `roadmap.md#broader-rollout`. + the delivery-plan step `roadmap.md#broader-rollout`. Exits 1 if + a document target does not resolve: its file, and the heading + or HTML anchor it names. Every command first validates each open-questions table and every link to a -question anchor (`#oq-N`), and exits 1 on any problem. A table is an +question anchor (`#oq-N`), and exits 1 on any problem. Each Blocks target +that names a document, by a path ending in `.md` or by a path and anchor, +must resolve to its file and to the heading or HTML anchor it names, so a +renamed heading or a moved document fails the check instead of silently +clearing the block. A table is an open-questions table when it sits under an Open Questions heading, starts with ID and Question columns, or has a row with a question ID; its header must then match the columns exactly. Tables are read with or without outer pipes, @@ -313,8 +319,13 @@ def inline(match): def slug(heading): - """A heading's anchor as GitHub generates it.""" - return re.sub(r"[^\w\- ]", "", heading.strip().lower()).replace(" ", "-") + """A heading's anchor as GitHub generates it: from the rendered text, so + link targets, HTML tags and emphasis markers drop out, while underscores + inside words stay.""" + text = re.sub(r"!?\[([^\]]*)\]\([^)]*\)", r"\1", heading.strip()) + text = re.sub(r"<[^>]+>", "", text) + text = re.sub(r"(?> "$GH_WRITES" return 0 - elif [[ "$cmd" =~ ^pr\ view\ ([0-9]+)\ --json\ title,body,closingIssuesReferences$ ]]; then + elif [[ "$cmd" =~ ^pr\ view\ ([0-9]+)\ --repo\ example-org/calendar\ --json\ title,body,closingIssuesReferences$ ]]; then key="pr-view-${BASH_REMATCH[1]}" elif [[ "$cmd" =~ $list_re ]]; then key=pr-list @@ -454,7 +454,7 @@ load_helpers() { load_helpers run promotion_prs [ "$status" -eq 0 ] - grep -qxF 'api --paginate repos/{owner}/{repo}/pulls?state=open&per_page=100' "$GH_CALLS" + grep -qxF 'api --paginate repos/example-org/calendar/pulls?state=open&per_page=100' "$GH_CALLS" refute_grep -q 'gh pr list --state open' "$GITHUB" } @@ -466,7 +466,7 @@ load_helpers() { # 222 promotes nothing; 233 moves one change's files into another change. [ "$output" = $'214\tshared-calendars/invite-expiry\n230\tcalendar-links/embed' ] \ || { echo "got: $output" >&2; return 1; } - grep -q 'gh api --paginate "repos/{owner}/{repo}/pulls/$1/files"' "$GITHUB" + grep -q 'gh api --paginate "repos/$REPO/pulls/$1/files"' "$GITHUB" refute_grep -q 'files\[\]\.path' "$GITHUB" } @@ -475,7 +475,7 @@ load_helpers() { run promotion_change 214 [ "$status" -eq 0 ] [ "$output" = "shared-calendars/invite-expiry" ] - grep -qxF 'api repos/{owner}/{repo}/pulls/214' "$GH_CALLS" + grep -qxF 'api repos/example-org/calendar/pulls/214' "$GH_CALLS" # The REST files endpoint lists at most 3,000 files. GH_SWAP='pr-214:pr-214-over-cap' run promotion_change 214 @@ -488,6 +488,21 @@ load_helpers() { grep -q 'the files endpoint lists at most 3,000' <<< "$(joined "$GITHUB")" } +@test "every GitHub read and write names the repository from setup" { + # gh api fills {owner}/{repo} from the current directory's remote, which + # may not be $REPO; bind each call to $REPO instead. + refute_grep -qF '{owner}/{repo}' "$GITHUB" + local calls + calls=$(awk '/^ *```(sh|bash)$/ { inb = 1; next } inb && /^ *```$/ { inb = 0; next } inb' "$GITHUB" | + grep -E '(^|[^[:alnum:]_])gh (pr|api) ') + [ -n "$calls" ] + refute_grep -vE 'gh pr [a-z]+ [^ ]+ --repo "\$REPO"|gh api (--paginate )?"repos/\$REPO/' <<< "$calls" + local rows + rows=$(sed -n '/^## Event moves/,/^## /p' "$GITHUB" | grep -F 'gh pr view') + [ "$(grep -c . <<< "$rows")" -eq 3 ] + refute_grep -vF 'gh pr view --repo "$REPO" --json state' <<< "$rows" +} + @test "the helpers block is fenced as bash and says it needs bash" { # Here-strings and $'...' quoting fail under sh and Dash. [ "$(awk '/^```/ { fence = $0 } /^item_id\(\) \{/ { print fence; exit }' "$GITHUB")" = '```bash' ] @@ -512,9 +527,9 @@ load_helpers() { load_helpers run closing_refs 230 [ "$status" -eq 0 ] - grep -qxF 'api repos/{owner}/{repo}/pulls/230' "$GH_CALLS" - grep -qxF 'api --paginate repos/{owner}/{repo}/pulls/230/commits' "$GH_CALLS" - grep -qxF 'pr view 230 --json title,body,closingIssuesReferences' "$GH_CALLS" + grep -qxF 'api repos/example-org/calendar/pulls/230' "$GH_CALLS" + grep -qxF 'api --paginate repos/example-org/calendar/pulls/230/commits' "$GH_CALLS" + grep -qxF 'pr view 230 --repo example-org/calendar --json title,body,closingIssuesReferences' "$GH_CALLS" # gh pr view --json commits returns only the first 100 commits. refute_grep -q 'title,body,commits' "$GITHUB" } @@ -573,8 +588,8 @@ Promotion PR #230 (calendar-links/embed): commit 2a4c6e8: Closes #301" ] \ local walkthrough again walkthrough=$(sed -n '/^## Walkthrough/,$p' "$GITHUB") again=$(sed -n '/^### In review again/,/^### /p' "$GITHUB") - grep -q 'gh pr reopen 214' <<< "$again" - grep -q 'gh pr view 214 --json state --jq .state' <<< "$again" + grep -qF 'gh pr reopen 214 --repo "$REPO"' <<< "$again" + grep -qF 'gh pr view 214 --repo "$REPO" --json state --jq .state' <<< "$again" grep -q '^OPEN$' <<< "$again" grep -q 'closing_refs 214' <<< "$again" grep -q 'set_spec_state shared-calendars/invite-expiry "In review"' <<< "$again" diff --git a/plugins/product-development/skills/product-development/tests/fixtures/open-questions/bundle/roadmap.md b/plugins/product-development/skills/product-development/tests/fixtures/open-questions/bundle/roadmap.md new file mode 100644 index 0000000..4708251 --- /dev/null +++ b/plugins/product-development/skills/product-development/tests/fixtures/open-questions/bundle/roadmap.md @@ -0,0 +1,20 @@ +--- +type: delivery-plan +title: Delivery plan +description: The order in which shared-calendar capabilities ship, and the conditions each step meets. +status: stable +--- + +# Delivery plan + +## Invite expiry + +Invitations expire after a set period. Condition: organizers see who has not answered. + +## Invitation extension + +Organizers extend an expired invitation. Condition: expiry has been live for a month. + +## Broader rollout + +Every calendar, once invite expiry is live. diff --git a/plugins/product-development/skills/product-development/tests/lifecycle-review-handoff.bats b/plugins/product-development/skills/product-development/tests/lifecycle-review-handoff.bats index 66ec8fb..6b4b453 100644 --- a/plugins/product-development/skills/product-development/tests/lifecycle-review-handoff.bats +++ b/plugins/product-development/skills/product-development/tests/lifecycle-review-handoff.bats @@ -132,6 +132,21 @@ drop_row() { grep -q "open-questions.md" <<< "$text" } +@test "the promotion PR opens only once the approved change is in shaping/ on the default branch" { + local skill promotion prep model + skill=$(sed -n '/^### Promotion$/,/^### Handoff$/p' "$SCRIPT_DIR/SKILL.md" | tr -s '\n ' ' ') + grep -qF 'Before the promotion PR opens, the approved change must be on the default branch in `docs/product/shaping/{feature}--{change}/`' <<< "$skill" + grep -q "in a PR of its own, opened with the maintainer's approval" <<< "$skill" + # The prerequisite comes before the step that opens the promotion PR. + [[ "$skill" == *"Before the promotion PR opens"*"open a promotion PR that moves"* ]] + prep=$(sed -n '/^## 1\. Prepare the promotion PR$/,/^## 2\./p' "$REFS/ratification.md" | tr -s '\n ' ' ') + grep -qF '**Shaping on the default branch.**' <<< "$prep" + [[ "$prep" == *"**Shaping on the default branch.**"*"**Collision check.**"* ]] + grep -q "the move from \`shaping/\` to \`features/\`" <<< "$prep" + model=$(joined "$REFS/board-mapping.md") + grep -qF 'opens only once the change is in `shaping/` on the default branch ([ratification.md](ratification.md#1-prepare-the-promotion-pr))' <<< "$model" +} + @test "ratification runs both checks again against the PR's final head and the current features tree" { local text text=$(joined "$REFS/ratification.md") @@ -273,6 +288,28 @@ drop_row() { grep -q "the implementation workflow runs it before that merge" <<< "$text" } +@test "the handoff carries both release checks when a delivery-plan step fires the ship signal" { + local text template ship + text=$(joined "$REFS/implementation-handoff.md") + grep -q "When a delivery-plan step fires the ship signal, the handoff carries both checks, the change's and the step's" <<< "$text" + template=$(section "$REFS/implementation-handoff.md" "Template") + ship=$(sed -n '/^## Ship signal$/,$p' <<< "$template" | tr -s '\n ' ' ') + grep -qF 'blocking docs/product {feature}/{change} --level release' <<< "$ship" + grep -qF 'blocking docs/product roadmap.md# --level release' <<< "$ship" + grep -q "run both checks" <<< "$ship" + # The step comes from the ship signal the handoff names. + grep -qF '' <<< "$ship" +} + +@test "the handoff template links the rules for a check run while modernization is in progress" { + local ship + ship=$(sed -n '/^## Ship signal$/,$p' <<< "$(section "$REFS/implementation-handoff.md" "Template")" | tr -s '\n ' ' ') + grep -qF -- 'one `--pending` for each feature folder written with 0.1.0' <<< "$ship" + grep -q "the maintainer reads the 0.1.0 question tables in those folders by hand" <<< "$ship" + grep -qF '`references/open-questions.md#while-modernization-is-in-progress`' <<< "$ship" + grep -qF '## While modernization is in progress' "$REFS/open-questions.md" +} + @test "the handoff stops at the boundary and leaves implementation to its own workflow" { local text text=$(joined "$REFS/implementation-handoff.md") @@ -319,6 +356,10 @@ drop_row() { grep -qxF '| Scenarios drafted, not yet approved | BDD Scenarios: finish their review and approval |' "$skill" refute_grep -qF '| PRD exists, needs decomposition |' "$skill" refute_grep -qF '| Stories exist, needs testable criteria |' "$skill" + # Clear requirements still get an approved shaping design before Requirements. + grep -qxF '| Clear requirements, needs documentation | Discovery and Design: record them as the change'"'"'s shaping document and get it approved, skipping brainstorming once the Foundation Gate passes; then Requirements |' "$skill" + refute_grep -qF '| Requirements after Foundation Gate |' "$skill" + grep -q 'Clear requirements may skip brainstorming only after the Foundation Gate passes, never the approved shaping document' "$skill" # The rows agree with the workflows' own triggers. grep -qx '\*\*Trigger:\*\* PRD and TRD are reviewed and stable.' "$skill" grep -qx '\*\*Trigger:\*\* User stories have acceptance criteria defined.' "$skill" @@ -651,3 +692,9 @@ drop_row() { @test "docs/development.md lists this suite" { grep -qF "nix develop -c bats plugins/product-development/skills/product-development/tests/lifecycle-review-handoff.bats" "$REPO_ROOT/docs/development.md" } + +@test "the handoff lists open release questions from hand-reviewed 0.1.0 tables" { + local ref="$SCRIPT_DIR/references/implementation-handoff.md" + grep -qF 'before sending, to list any open release question that applies below, and again before firing' "$ref" + grep -qF 'and from the 0.1.0 question tables the maintainer reviewed by hand in the folders still awaiting modernization' "$ref" +} diff --git a/plugins/product-development/skills/product-development/tests/open-questions.bats b/plugins/product-development/skills/product-development/tests/open-questions.bats index 6a33b11..922cbc9 100644 --- a/plugins/product-development/skills/product-development/tests/open-questions.bats +++ b/plugins/product-development/skills/product-development/tests/open-questions.bats @@ -431,6 +431,10 @@ assert_index_links_resolve() { cat > "$B/roadmap.md" <<'MD' # Delivery plan +## Invitation extension + +Organizers extend an expired invitation. + ## Broader rollout Every calendar, once invite expiry is live. @@ -452,6 +456,81 @@ MD [[ "$output" != *"roadmap.md#oq-"* ]] } +@test "a Blocks target naming a delivery-plan step resolves to its heading" { + run "$OQ" index "$B" + [ "$status" -eq 0 ] || { echo "status $status: $output" >&2; return 1; } + # A linked target resolves from its own document, like any link. + sed -i.bak 's#| this change | maintainer decision |#| this change, [Broader rollout](../../roadmap.md\#broader-rollout) | maintainer decision |#' "$B/$INVITE" + rm "$B/$INVITE.bak" + grep -qF '(../../roadmap.md#broader-rollout)' "$B/$INVITE" + run "$OQ" index "$B" + [ "$status" -eq 0 ] || { echo "status $status: $output" >&2; return 1; } + run "$OQ" blocking "$B" roadmap.md#broader-rollout --level release + [ "$status" -eq 1 ] + [[ "$output" == *"$INVITE#oq-"* ]] +} + +@test "renaming a delivery-plan step's heading without updating its Blocks cells fails every command" { + run "$OQ" index "$B" + [ "$status" -eq 0 ] || { echo "status $status: $output" >&2; return 1; } + sed -i.bak 's/^## Invitation extension$/## Extend expired invitations/' "$B/roadmap.md" + rm "$B/roadmap.md.bak" + local command + for command in check index; do + run "$OQ" "$command" "$B" + [ "$status" -eq 1 ] || { echo "$command: status $status: $output" >&2; return 1; } + [[ "$output" == *"open-questions.md:"*"OQ-2"*"roadmap.md#invitation-extension"*"does not resolve"* ]] + done + # The block is not silently cleared: the check point fails instead of passing. + run "$OQ" blocking "$B" roadmap.md#extend-expired-invitations --level release + [ "$status" -eq 1 ] + [[ "$output" == *"roadmap.md#invitation-extension"*"does not resolve"* ]] + # Updating the Blocks cell in the same change makes the check pass again. + sed -i.bak 's/roadmap.md#invitation-extension/roadmap.md#extend-expired-invitations/' "$B/open-questions.md" + rm "$B/open-questions.md.bak" + run "$OQ" index "$B" + [ "$status" -eq 0 ] || { echo "status $status: $output" >&2; return 1; } + run "$OQ" blocking "$B" roadmap.md#extend-expired-invitations --level release + [ "$status" -eq 1 ] + [[ "$output" == *"open-questions.md#oq-2 release"* ]] +} + +@test "a Blocks target matches GitHub's anchor for a heading with inline formatting" { + # GitHub drops emphasis markers and link targets from heading anchors, and + # keeps underscores inside words. + sed -i.bak 's/^## Invitation extension$/## Extend _expired_ invitations, per [policy](https:\/\/example.com\/policy) and invite_ttl/' "$B/roadmap.md" + sed -i.bak 's/roadmap.md#invitation-extension/roadmap.md#extend-expired-invitations-per-policy-and-invite_ttl/' "$B/open-questions.md" + rm "$B/roadmap.md.bak" "$B/open-questions.md.bak" + run "$OQ" index "$B" + [ "$status" -eq 0 ] || { echo "status $status: $output" >&2; return 1; } + run "$OQ" check "$B" + [ "$status" -eq 0 ] || { echo "status $status: $output" >&2; return 1; } + run "$OQ" blocking "$B" roadmap.md#extend-expired-invitations-per-policy-and-invite_ttl --level release + [ "$status" -eq 1 ] + [[ "$output" == *"open-questions.md#oq-2 release"* ]] +} + +@test "a Blocks target naming a missing document fails the check" { + sed -i.bak 's/| roadmap.md#invitation-extension |/| rollout-plan.md#invitation-extension |/' "$B/open-questions.md" + rm "$B/open-questions.md.bak" + run "$OQ" check "$B" + [ "$status" -eq 1 ] + [[ "$output" == *"OQ-2"*"rollout-plan.md#invitation-extension"*"does not resolve"* ]] +} + +@test "a blocking check on a step that does not exist fails instead of passing" { + run "$OQ" blocking "$B" roadmap.md#no-such-step --level release + [ "$status" -eq 1 ] + [[ "$output" == *"roadmap.md#no-such-step"*"does not resolve"* ]] +} + +@test "the reference says a renamed heading updates its Blocks cells in the same PR" { + local text + text=$(joined "$REF") + grep -q "Renaming a heading that a Blocks cell names, or moving its document, updates those Blocks cells in the same PR" <<< "$text" + grep -q "a Blocks target that names a document or a step that does not resolve" <<< "$text" +} + @test "a question table with or without outer pipes holds its change" { local form for form in 's/^//' 's/^|//; s/|$//' 's/^|//'; do diff --git a/plugins/product-development/skills/product-development/tests/retrofit.bats b/plugins/product-development/skills/product-development/tests/retrofit.bats index fb1ffcf..0703b24 100644 --- a/plugins/product-development/skills/product-development/tests/retrofit.bats +++ b/plugins/product-development/skills/product-development/tests/retrofit.bats @@ -254,6 +254,20 @@ example_inventory() { grep -q "reconcile" <<< "$(section '^## Worked example')" } +@test "a mixed retrofit prepares a 0.1.0 constitution and vision before its profile check" { + local text finish + text=$(section '^## How it runs') + grep -q "A 0.1.0 constitution and vision have no front matter until the modernization guide's setup adds it" <<< "$text" + grep -qF '](okf-profile.md#front-matter)' <<< "$text" + grep -qF '](product-vision.md#splitting-an-existing-vision)' <<< "$text" + grep -q "before the retrofit PR's profile check" <<< "$text" + # The same wording as Setup's note on a 0.1.0 upgrade. + grep -q "constitution and vision have no front matter until the modernization guide's setup adds it" \ + <<< "$(joined "$SCRIPT_DIR/references/initialization.md")" + finish=$(section '^## Finishing the retrofit PR') + grep -qF 'a 0.1.0 constitution and vision are prepared first ([How it runs](#how-it-runs))' <<< "$finish" +} + @test "an already-live change stops at its promotion PR and gets no invented ship signal" { local text text=$(section '^### 4\. ')