From 0e9cd47237b0263dab90fe8fc77e6a41432ac9f5 Mon Sep 17 00:00:00 2001 From: John Lianoglou Date: Sun, 29 Nov 2026 23:17:34 -0500 Subject: [PATCH 01/17] test(product-development): use shared-calendar examples in 0.1.0 fixture The modernization fixture's 0.1.0 README carried scenario examples from init.sh's old defaults. Replace the surface-specific example with the day-view swipe and the platform example with the invitation example, matching the expected README and the current init.sh defaults. Refs #46, #35 --- .../fixtures/modernization/start/docs/product/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/product-development/skills/product-development/tests/fixtures/modernization/start/docs/product/README.md b/plugins/product-development/skills/product-development/tests/fixtures/modernization/start/docs/product/README.md index ab5de8c..20ca751 100644 --- a/plugins/product-development/skills/product-development/tests/fixtures/modernization/start/docs/product/README.md +++ b/plugins/product-development/skills/product-development/tests/fixtures/modernization/start/docs/product/README.md @@ -19,7 +19,7 @@ Product governance and cross-surface specifications. Artifacts here describe wha Surface-specific specifications. Artifacts here describe behaviors and interactions that are bound to a specific surface's interaction model. -- `features/{feature}/scenarios/` — surface-specific `.feature` files (e.g., Swiping down during a breathing round triggers haptic feedback) +- `features/{feature}/scenarios/` — surface-specific `.feature` files (e.g., Swiping left on the day view shows the next day) Step definitions (automation code that implements both platform and surface scenarios) live in each app's test directory, not in `docs/`. @@ -59,11 +59,11 @@ When `grill-with-docs` is used, product-domain context may live in `docs/product A specification belongs at **platform level** if it holds true regardless of whether the user is on a phone. -> "Error reports for non-consented users contain no persistent identifier." +> "An accepted invitation adds the event to the invitee's calendar." A specification belongs at **app level** if its language references a surface-specific interaction model. -> "Swiping down during a breathing round triggers haptic feedback." +> "Swiping left on the day view shows the next day." When in doubt, start at platform level. Move to app level only when the Given/When/Then language cannot be written without referencing a specific interaction model. From c3aac9cb1ce54f487beb90cbec7c7f474cf63af4 Mon Sep 17 00:00:00 2001 From: John Lianoglou Date: Sun, 29 Nov 2026 23:19:44 -0500 Subject: [PATCH 02/17] fix(product-development): hold delivery-plan steps on whole-plan questions A release question in the delivery plan scoped to `this document` names roadmap.md, but the check on a step names roadmap.md#, so open-questions.py matched nothing and the rollout passed. A target with an anchor now also carries the questions that block its whole document. The reference and the Release Check say so, with a test. Refs #37, #44, #35 --- .../skills/product-development/SKILL.md | 2 +- .../references/open-questions.md | 2 ++ .../scripts/open-questions.py | 17 +++++++++--- .../tests/open-questions.bats | 27 +++++++++++++++++++ 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/plugins/product-development/skills/product-development/SKILL.md b/plugins/product-development/skills/product-development/SKILL.md index fba6012..b2a2da3 100644 --- a/plugins/product-development/skills/product-development/SKILL.md +++ b/plugins/product-development/skills/product-development/SKILL.md @@ -214,7 +214,7 @@ If implementation would violate `MUST NOT` language, weaken a constitutional pri **Process:** Whoever will fire the ship signal runs the release-level open-questions check (`references/open-questions.md`), `scripts/open-questions.py blocking docs/product {feature}/{change} --level release`: no open `design`, `implementation`, `release` or `none yet` question may name the change unless its deferral is approved. When merging the implementation PR is the ship signal, the implementation workflow runs this check before that merge. While feature folders written with 0.1.0 await modernization, the check runs with `--pending` and the maintainer triages their questions too (`references/open-questions.md#while-modernization-is-in-progress`). -Release questions can also name a delivery-plan step, by path and anchor. Before executing a delivery-plan step, run the same check on the step: `scripts/open-questions.py blocking docs/product roadmap.md#broader-rollout --level release`. When that step fires a change's ship signal, run both checks, the change's and the step's. +Release questions can also name a delivery-plan step, by path and anchor. Before executing a delivery-plan step, run the same check on the step: `scripts/open-questions.py blocking docs/product roadmap.md#broader-rollout --level release`. The step's check also lists the questions that block the whole delivery plan, scoped to `this document` in `roadmap.md`. When that step fires a change's ship signal, run both checks, the change's and the step's. **Gate:** Do not fire the ship signal until its checks pass, and do not execute a delivery-plan step until its check passes. 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 2d4196e..b05f3e5 100644 --- a/plugins/product-development/skills/product-development/references/open-questions.md +++ b/plugins/product-development/skills/product-development/references/open-questions.md @@ -40,6 +40,8 @@ Each question names what it blocks, in its Blocks cell: - `this document`, for a document's own questions, such as a question in the delivery plan or a vision companion. Research notes and foundation snapshots are never edited, so they hold no live questions: a question about a research note's evidence goes in the register, or in the change it concerns. The vision has no Open Questions section; questions about the product's direction go in the register. A question scoped to one of a change's documents, by `this document` or by the document's path, also holds that change's checks. - A change by name, `{feature}/{change}`, or a step in the delivery plan by path and anchor, such as `roadmap.md#invitation-extension`. Separate several targets with commas. +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 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 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 c550913..348376b 100755 --- a/plugins/product-development/skills/product-development/scripts/open-questions.py +++ b/plugins/product-development/skills/product-development/scripts/open-questions.py @@ -14,7 +14,9 @@ blocking Lists the open questions that hold at a check point: those that name it at the checked level or an earlier one, or as `none yet`. A change also carries the questions scoped to its - own documents. Approved deferrals don't hold it. Exits 1 if any do. + own documents, and a document step such as a delivery-plan step + carries the questions that block its whole document. Approved + 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`. @@ -354,8 +356,17 @@ def index_errors(bundle, questions): def holds(question, target): """Whether a question names `target`. A change also carries the questions - scoped to its own documents (`this document`, or a document path).""" - return any(t == target or own_change(t.partition("#")[0]) == target for t in question.targets) + scoped to its own documents (`this document`, or a document path). A + document step, such as `roadmap.md#broader-rollout`, also carries the + questions that block its whole document (`this document`, or the path + without an anchor).""" + document, _, step = target.partition("#") + return any( + t == target + or own_change(t.partition("#")[0]) == target + or (step and t == document) + for t in question.targets + ) def documents(bundle): 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 c26deee..9ebacbd 100644 --- a/plugins/product-development/skills/product-development/tests/open-questions.bats +++ b/plugins/product-development/skills/product-development/tests/open-questions.bats @@ -195,6 +195,8 @@ assert_index_links_resolve() { grep -q "delivery-plan step" <<< "$release" grep -qF 'scripts/open-questions.py blocking docs/product roadmap.md#broader-rollout --level release' <<< "$release" grep -q "run both checks" <<< "$release" + grep -q "questions that block the whole delivery plan" <<< "$release" + grep -q "blocks every step in it" <<< "$(joined "$REF")" grep -qE '^\| About to execute a step in the delivery plan \| Release Check \|$' "$skill" grep -q "A step in the delivery plan is checked before the step is executed" <<< "$(joined "$REF")" } @@ -425,6 +427,31 @@ assert_index_links_resolve() { [[ "$output" == *"No open question holds roadmap.md#broader-rollout"* ]] } +@test "a release check on a delivery-plan step also lists the plan's questions that block the whole plan" { + cat > "$B/roadmap.md" <<'MD' +# Delivery plan + +## Broader rollout + +Every calendar, once invite expiry is live. + +## Open Questions + +| ID | Question | Blocking level | Blocks | Resolution | Deferred to | Approval | +|----|----------|----------------|--------|------------|-------------|----------| +| OQ-1 | Does every region allow the expiry notice wording? | release | this document | research | — | — | +| OQ-2 | Which regions go first? | release | [Rollout plan](roadmap.md) | maintainer decision | — | — | +MD + run "$OQ" blocking "$B" roadmap.md#broader-rollout --level release + [ "$status" -eq 1 ] + [[ "$output" == *"roadmap.md#oq-1 release"* ]] + [[ "$output" == *"roadmap.md#oq-2 release"* ]] + + # A whole-document question holds only steps of its own document. + run "$OQ" blocking "$B" shared-calendars/invite-expiry --level release + [[ "$output" != *"roadmap.md#oq-"* ]] +} + @test "a question table with or without outer pipes holds its change" { local form for form in 's/^//' 's/^|//; s/|$//' 's/^|//'; do From 64167d84b34b67cb4d19676bbfa18d03d049cece Mon Sep 17 00:00:00 2001 From: John Lianoglou Date: Sun, 29 Nov 2026 23:20:45 -0500 Subject: [PATCH 03/17] fix(product-development): permit indexes and split entry in promotion review The promotion-review checklist listed every file a promotion PR may touch outside the change, but left out the generated OKF indexes and the lineage-log Feature split entry a split into a new feature adds, so a correct PR drew findings. Both are now permitted. Ratification regenerates the open-questions and OKF indexes before the promotion review, so the reviewed diff is the one that merges. Refs #18, #23, #25, #35 --- .../references/promotion-review.md | 2 +- .../product-development/references/ratification.md | 11 +++++++++-- .../tests/lifecycle-review-handoff.bats | 13 +++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/plugins/product-development/skills/product-development/references/promotion-review.md b/plugins/product-development/skills/product-development/references/promotion-review.md index a413d1a..d2d91e8 100644 --- a/plugins/product-development/skills/product-development/references/promotion-review.md +++ b/plugins/product-development/skills/product-development/references/promotion-review.md @@ -23,7 +23,7 @@ Say "No findings" for a section with none. Do not edit the PR. - [ ] Shaping content is not treated as binding. No ratified document cites a shaping document, an idea or a spike as the authority for a requirement. Links into `shaping/` are deferral targets or provenance, never requirements. ADRs and contracts the shaping document linked keep their own authority. - [ ] The shaping document moves with the change or is absorbed into the PRD, and the PRD keeps the provenance record ([changes-and-deltas.md](changes-and-deltas.md#provenance)). - [ ] No document says code, a spike or a prototype admits the spec. Behavior that exists only in code still enters through this PR. -- [ ] Outside `changes/{change}/`, the PR deletes the change's shaping directory and touches only: the Ratified entry in the feature log, the open-questions index, links into moved documents, the target rows of deferrals the maintainer approved, the app-local scenario files it lists and, for a new feature, the metadata-only feature overview, `log.md` and `changes/`. +- [ ] Outside `changes/{change}/`, the PR deletes the change's shaping directory and touches only: the Ratified entry in the feature log, the open-questions index, the generated OKF indexes (`index.md`) of the directories it changes, links into moved documents, the target rows of deferrals the maintainer approved, the app-local scenario files it lists and, for a new feature, the metadata-only feature overview, `log.md` and `changes/`. When a split creates a feature, it also adds the Feature split entry in the lineage log, `features/log.md` ([feature-bundles.md](feature-bundles.md#no-stub-bundles)). Both indexes are regenerated before this review, so the diff under review is the one that merges ([ratification.md](ratification.md#1-prepare-the-promotion-pr)). - [ ] Every moved document has OKF `status: stable`. No document carries a status field or changelog of its own ([feature-bundles.md](feature-bundles.md)). ### Deltas diff --git a/plugins/product-development/skills/product-development/references/ratification.md b/plugins/product-development/skills/product-development/references/ratification.md index b6ed610..1d73a2a 100644 --- a/plugins/product-development/skills/product-development/references/ratification.md +++ b/plugins/product-development/skills/product-development/references/ratification.md @@ -24,8 +24,15 @@ Run these before the PR is opened, and put each result in its body. ``` Here the exit code doesn't gate anything; the design-level check already passed. The list says what will hold the handoff (implementation) and the ship decision (release). -5. **Promotion review.** Review the PR against the checklist in [promotion-review.md](promotion-review.md), with the `spec-reviewer` agent where the harness has one, and include its findings. -6. **Index.** The PR moves documents that hold questions, so regenerate the open-questions index in it: `scripts/open-questions.py index docs/product`. +5. **Indexes.** The PR moves documents, some of which hold questions, so regenerate both indexes in it from the project root before the review, and commit the result: + + ```bash + python3 "/scripts/open-questions.py" index docs/product + python3 "/scripts/okf-profile.py" index docs/product + ``` + + `` is the directory that holds this skill's `SKILL.md` ([okf-profile.md](okf-profile.md#indexes)). +6. **Promotion review.** Review the PR against the checklist in [promotion-review.md](promotion-review.md), with the `spec-reviewer` agent where the harness has one, and include its findings. Regenerate the indexes again if the review leads to changes. Before you open the PR, show the maintainer the PR body and wait for their approval. Opening it is a write to GitHub and waits for the maintainer's approval (`SKILL.md`, GitHub Writes). 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 31b6c89..0b775e3 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 @@ -171,6 +171,19 @@ drop_row() { grep -q "overlap report" <<< "$text" } +@test "the promotion-review checklist permits regenerated OKF indexes and a split's lineage entry" { + local text prep + text=$(joined "$REFS/promotion-review.md") + grep -qF "the generated OKF indexes (\`index.md\`)" <<< "$text" + grep -qF "the Feature split entry in the lineage log, \`features/log.md\`" <<< "$text" + grep -q "regenerated before this review" <<< "$text" + # Ratification regenerates both indexes before the promotion review runs. + prep=$(sed -n '/^## 1. Prepare the promotion PR/,/^Before you open the PR/p' "$REFS/ratification.md") + grep -q '^5\. \*\*Indexes\.\*\*' <<< "$prep" + grep -q '^6\. \*\*Promotion review\.\*\*' <<< "$prep" + grep -q "okf-profile.py\" index docs/product" <<< "$prep" +} + @test "the promotion-review checklist checks terminology against the skill's glossary" { local text text=$(joined "$REFS/promotion-review.md") From 3fb636b42dee11990f8098c45f9504968d849b11 Mon Sep 17 00:00:00 2001 From: John Lianoglou Date: Sun, 29 Nov 2026 23:22:10 -0500 Subject: [PATCH 04/17] fix(product-development): rebase question links when archiving a change The archive step said to change only OKF status and regenerate the OKF indexes. Moving the change directory breaks the links of approved deferrals in both directions and stales the open-questions index. The step now keeps the ratified payloads unchanged, rebases links into and out of the archived change, and regenerates and checks both indexes in the canonization PR. The open-questions suite already walks the worked example's links through this move; a canonization test pins the step. Refs #21, #37, #35 --- .../references/canonization.md | 22 ++++++++++++++++--- .../tests/canonization.bats | 17 +++++++++++++- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/plugins/product-development/skills/product-development/references/canonization.md b/plugins/product-development/skills/product-development/references/canonization.md index 7b7996a..3367bdc 100644 --- a/plugins/product-development/skills/product-development/references/canonization.md +++ b/plugins/product-development/skills/product-development/references/canonization.md @@ -75,9 +75,25 @@ A lineage change may empty another feature's bundle; [feature-bundles.md](featur ### 4. Archive the change -Move what is left of the change to `changes/archive/YYYY-MM-DD-{change}/`, dated the day of canonization, with the ratified deltas intact. Set every document's OKF `status` in the archived change from `stable` to `deprecated`; change nothing else. Deferred story and scenario files stay in the archive, where the shaping item's copies came from. +Move what is left of the change to `changes/archive/YYYY-MM-DD-{change}/`, dated the day of canonization. The ratified deltas keep their payloads: every `Text:`, `New text:` and base text stays as ratified, never the reconciled or rebased text, so the archive shows what the maintainer approved. Deferred story and scenario files stay in the archive, where the shaping item's copies came from. In the archived documents, set OKF `status` from `stable` to `deprecated`, and change no wording. -The change is now Canonized. Regenerate the indexes from the project root, `python3 "/scripts/okf-profile.py" index docs/product`, and run the profile checks. +The move breaks relative links in both directions, so the same PR updates them; a rebased link changes its path, never its label or the text around it: + +- **Links into the change** from the rest of the bundle, including the back-links in the target rows of approved deferrals, whose `Deferred from` link points at a question row in the change. +- **Links out of the archived change**, which gain one directory level, including the **Deferred to** links of its deferred rows, which must still reach their open target rows ([open-questions.md](open-questions.md#deferral)). + +The open-questions worked example walks both links through this move ([open-questions.md](open-questions.md#worked-example), step 3). + +The change is now Canonized. From the project root, regenerate the indexes, then check them, so a link the move broke or a stale index fails here instead of on the default branch: + +```bash +python3 "/scripts/open-questions.py" index docs/product +python3 "/scripts/okf-profile.py" index docs/product +python3 "/scripts/open-questions.py" check docs/product +python3 "/scripts/okf-profile.py" check docs/product +``` + +The open-questions index drops the archived change's rows, since the change archive is history, and keeps their open target rows. The generator refuses to run while any question link does not resolve. ### 5. Write the feature-log entry @@ -93,7 +109,7 @@ Write "Nothing deferred." in the outcome when nothing was, and leave out a field ## The canonization PR -One PR canonizes one change. It holds the applied deltas, the moved files, the archived change, the shaping items for deferrals, the Canonized log entry and the regenerated indexes. Its body holds the coverage table, the base-check result with any rebased unit, and the list of shaping items. +One PR canonizes one change. It holds the applied deltas, the moved files, the archived change with its rebased links, the links into it, the shaping items for deferrals, the Canonized log entry and the regenerated OKF and open-questions indexes. Its body holds the coverage table, the base-check result with any rebased unit, and the list of shaping items. Opening it waits for the maintainer's approval, like every write to GitHub (`SKILL.md`, GitHub Writes). The maintainer confirms any change in meaning, any deferred item and any rebased delta before it merges, and the base check runs again just before the merge. When the project tracks changes on a board, the merge moves the change's item to Canonized ([board-mapping.md](board-mapping.md)). diff --git a/plugins/product-development/skills/product-development/tests/canonization.bats b/plugins/product-development/skills/product-development/tests/canonization.bats index ef40cad..d538c7b 100644 --- a/plugins/product-development/skills/product-development/tests/canonization.bats +++ b/plugins/product-development/skills/product-development/tests/canonization.bats @@ -80,7 +80,7 @@ stage_fixture() { text=$(joined "$REF") grep -q "move the story and scenario files the reconciled deltas list to the feature root" <<< "$text" grep -qF 'changes/archive/YYYY-MM-DD-{change}/' <<< "$text" - grep -q "with the ratified deltas intact" <<< "$text" + grep -q "The ratified deltas keep their payloads" <<< "$text" grep -q "The change is now Canonized" <<< "$text" grep -qF 'okf-profile.py" index docs/product' <<< "$text" } @@ -158,6 +158,21 @@ stage_fixture() { done } +@test "archiving keeps the ratified payloads, rebases question links both ways and checks the open-questions index" { + local archive + archive=$(sed -n '/^### 4\. Archive the change/,/^### 5\./p' "$REF" | tr -s '\n ' ' ') + grep -q "The ratified deltas keep their payloads" <<< "$archive" + grep -q "Links into the change" <<< "$archive" + grep -q "back-links in the target rows of approved deferrals" <<< "$archive" + grep -q "Links out of the archived change" <<< "$archive" + grep -qF 'python3 "/scripts/open-questions.py" index docs/product' <<< "$archive" + grep -qF 'python3 "/scripts/open-questions.py" check docs/product' <<< "$archive" + grep -qF 'python3 "/scripts/okf-profile.py" check docs/product' <<< "$archive" + refute_grep -q "change nothing else" <<< "$archive" + # The canonization PR carries the regenerated open-questions index too. + grep -q "the regenerated OKF and open-questions indexes" "$REF" +} + @test "the canonization PR waits for approval and records the accounting" { local text text=$(joined "$REF") From 2d3904b68c071baed7efefdf95e3821693a2ae73 Mon Sep 17 00:00:00 2001 From: John Lianoglou Date: Sun, 29 Nov 2026 23:23:34 -0500 Subject: [PATCH 05/17] fix(product-development): reconcile changed and rebased whole-file units The delta contract gave a whole-file unit reconciled text only when it was split, so a fully shipped story or scenario file that changed in meaning, or whose feature-root version drifted, was moved as ratified and published the old expectation. A changed file's reconciled entry now carries the approved file, a rebased one the current base and the revision on top, and canonization writes that text at the feature root while the ratified file stays in the archive. A fixture test canonizes a story changed in meaning. Refs #21, #23, #35 --- .../references/canonization.md | 6 +-- .../references/changes-and-deltas.md | 10 +++-- .../tests/canonization.bats | 38 +++++++++++++++++++ .../tests/helpers/deltas.py | 7 ++-- 4 files changed, 51 insertions(+), 10 deletions(-) diff --git a/plugins/product-development/skills/product-development/references/canonization.md b/plugins/product-development/skills/product-development/references/canonization.md index 3367bdc..a958c04 100644 --- a/plugins/product-development/skills/product-development/references/canonization.md +++ b/plugins/product-development/skills/product-development/references/canonization.md @@ -50,19 +50,19 @@ Base the accounting on the evidence the Shipped entry links and on what the impl - **Changed:** it went live with a different meaning. A change in meaning needs the maintainer's approval of the text that shipped. An edit that keeps the meaning, such as clearer wording, is not a change. - **Deferred:** it did not go live. Each deferred item becomes a shaping item: a shaping document in `shaping/{feature}--{change}/`, with `x-amends: {feature}`, that starts from copies of the deferred text and files and links the archived change. Name the new change for what it delivers. It is shaped, ratified and canonized like any other change; nothing in it is ratified yet. A deferred spec unit keeps its ID in the archive as provenance, and IDs are never reused ([feature-bundles.md](feature-bundles.md#spec-units)): when the follow-up change's delta is drafted, it assigns the next free ID to a deferred addition. A deferred modification or removal keeps targeting the existing unit's ID: a deferred revision to `FR-02` still modifies `FR-02`. -Then write the reconciled deltas, the deltas to be applied: deferred units are left out, and changed units carry the approved text. A partly shipped story or scenario file, an app-local file or a `DOCUMENT` entry is reconciled as [changes-and-deltas.md](changes-and-deltas.md#deferred-stories-and-scenarios) describes. The ratified deltas stay as they were, for the archive. The reconciled deltas are working copies: the canonization PR shows their effect on the feature spec, its body holds the accounting, and the Canonized log entry records the outcome. +Then write the reconciled deltas, the deltas to be applied: deferred units are left out, and changed units carry the approved text. A story or scenario file that is partly shipped, or a whole-file unit that changed in meaning or was rebased, carries its reconciled text in its entry, so canonization writes that text at the feature root instead of moving the ratified file; it, an app-local file and a `DOCUMENT` entry are reconciled as [changes-and-deltas.md](changes-and-deltas.md#deferred-stories-and-scenarios) describes. The ratified deltas stay as they were, for the archive. The reconciled deltas are working copies: the canonization PR shows their effect on the feature spec, its body holds the accounting, and the Canonized log entry records the outcome. ### 2. Base check Run the base check ([changes-and-deltas.md](changes-and-deltas.md#base-check)) on the reconciled deltas against the current feature spec. Each modified or removed spec unit must still match the base text the delta recorded. -If the feature spec has drifted, usually because another change was canonized after this one was ratified, the delta is rebased first, and the maintainer confirms any change in meaning. Write the rebase into the reconciled deltas only: the rebased entry records the unit as it now stands as its base text, and the change's edit on top of it as its new text. An `ADDED` ID that is now taken is renumbered. +If the feature spec has drifted, usually because another change was canonized after this one was ratified, the delta is rebased first, and the maintainer confirms any change in meaning. Write the rebase into the reconciled deltas only: the rebased entry records the unit as it now stands as its base text, and the change's edit on top of it as its new text. A rebased story or scenario file does the same, with the whole file as both. An `ADDED` ID that is now taken is renumbered. Run it again against the latest feature spec on the default branch just before the canonization PR merges. If a change was canonized in the meantime, rebase again. ### 3. Apply the reconciled deltas -Apply the reconciled deltas to the feature spec, and move the story and scenario files the reconciled deltas list to the feature root. A split file's reconciled text is written at the feature root; a deferred file stays with the change. App-local scenario files are restored or rewritten as the contract says; they don't move. +Apply the reconciled deltas to the feature spec, and move the story and scenario files the reconciled deltas list to the feature root. A whole-file unit whose reconciled entry carries text, because it was split, changed or rebased, is written from that text at the feature root, and the change's own file stays with the change; a deferred file stays with the change. App-local scenario files are restored or rewritten as the contract says; they don't move. Check the result before going on: diff --git a/plugins/product-development/skills/product-development/references/changes-and-deltas.md b/plugins/product-development/skills/product-development/references/changes-and-deltas.md index 0bba037..d8a176d 100644 --- a/plugins/product-development/skills/product-development/references/changes-and-deltas.md +++ b/plugins/product-development/skills/product-development/references/changes-and-deltas.md @@ -111,8 +111,8 @@ Fences follow CommonMark. The outer fence is a run of three or more tildes (or b | Section | Entry holds | |---------|-------------| -| `ADDED` | `Section:` the heading, or heading path, of the feature spec section the unit joins, then `Text:` and the unit. A whole-file unit holds nothing more: its content is the file in the change's `stories/` or `scenarios/`. A reconciled entry for a split file carries `Text:` with the shipped part (see [Deferred stories and scenarios](#deferred-stories-and-scenarios)). | -| `MODIFIED` | `Base text:` and the unit as it stood when the delta was written, then `New text:` and the unit as the change leaves it. A whole-file unit holds only the base text; the new version is the file in the change. A reconciled entry for a split file adds `New text:` with the shipped part. | +| `ADDED` | `Section:` the heading, or heading path, of the feature spec section the unit joins, then `Text:` and the unit. A whole-file unit holds nothing more: its content is the file in the change's `stories/` or `scenarios/`. A reconciled entry for a changed or split file carries `Text:` with the file as canonization writes it at the feature root (see [Deferred stories and scenarios](#deferred-stories-and-scenarios)). | +| `MODIFIED` | `Base text:` and the unit as it stood when the delta was written, then `New text:` and the unit as the change leaves it. A whole-file unit holds only the base text; the new version is the file in the change. A reconciled entry for a changed, rebased or split file adds `New text:` with the file as canonization writes it at the feature root, and a rebased one also records the feature-root file as it now stands as its `Base text:`. | | `REMOVED` | `Base text:` and the unit as it stood when the delta was written. | | `App-local scenario files` | One entry per app-local scenario file, headed by its path from the repository root: `Base text:` with the file before the change for a revised file, nothing for an added one (see [App-local scenario files](#app-local-scenario-files)). | | `DOCUMENT` | No `###` entry. `Text:` and the front matter, title and summary of a document the delta writes; or `Base text:` and `New text:` with the whole document, before and after, for a rewrite. A rewrite holds no other entries. | @@ -219,9 +219,11 @@ features/shared-calendars/ Canonization's accounting decides each story and scenario file, as it decides each requirement: -- **Shipped or changed:** the reconciled delta keeps the file's entry, and canonization moves the file to the feature root. +- **Shipped:** the reconciled delta keeps the file's entry as listed, and canonization moves the change's file to the feature root. +- **Changed:** the reconciled entry carries the approved file as its text, `Text:` for an added file or `New text:` for a revised one, and canonization writes that text at the feature root. The change's own file, with the ratified expectation, stays in the archived change. Moving it would publish the expectation that did not ship. +- **Rebased:** a revised file whose feature-root version drifted since the delta was written, usually because another change canonized an edit to it, fails the base check. Its reconciled entry is rebased like a spec unit, with the maintainer confirming any change in meaning: `Base text:` holds the file as it now stands at the feature root, and `New text:` holds the change's revision applied on top of it, which canonization writes at the feature root. The change's own file stays in the archived change. - **Deferred:** the reconciled delta drops the file's entry. The file stays in the archived change, and the shaping item the deferral creates starts from a copy of it. A deferred file never reaches the feature root. -- **Partly shipped:** a file that holds both shipped and deferred scenarios is split. The reconciled entry carries the shipped scenarios as its text, `Text:` for an added file or `New text:` for a revised one, and canonization writes that text at the feature root. The change's own file, with the deferred scenarios, stays in the archived change for the shaping item. A story whose acceptance criteria shipped only in part is split the same way. +- **Partly shipped:** a file that holds both shipped and deferred scenarios is split. The reconciled entry carries the shipped scenarios as its text, `Text:` for an added file or `New text:` for a revised one, and canonization writes that text at the feature root. The change's own file, with the deferred scenarios, stays in the archived change for the shaping item. A story whose acceptance criteria shipped only in part is split the same way. A split file that also changed or was rebased carries a single text with all of it. - **App-local scenario files:** the promotion PR edited them in place, so a deferral restores the file from its recorded base text (see [App-local scenario files](#app-local-scenario-files)). - **`DOCUMENT` entries:** their text is reconciled like a changed unit, with the maintainer's approval. A description, summary or Facets row that describes deferred behavior is rewritten to describe only what shipped, and links to deferred facet specs, stories or scenarios are removed. A facet spec whose units are all deferred is not written: its delta is left out of the reconciled deltas and stays in the archived change. Canonization resolves every relative link in `DOCUMENT` text, including `./` forms, against the bundle as it will be after canonization, and refuses a link that does not resolve. The rule covers reference-style links: each link reference definition's target resolves the same way. A link to an existing document the change leaves alone resolves; a link to a deferred facet spec, story or scenario, to a file the change removes, or to an app-local scenario file the deferral deletes, does not. The first-version fixture, `tests/fixtures/first-version/`, defers a whole facet this way. diff --git a/plugins/product-development/skills/product-development/tests/canonization.bats b/plugins/product-development/skills/product-development/tests/canonization.bats index d538c7b..e1e3e6d 100644 --- a/plugins/product-development/skills/product-development/tests/canonization.bats +++ b/plugins/product-development/skills/product-development/tests/canonization.bats @@ -257,6 +257,44 @@ stage_fixture() { grep -q "Working hours follow a time-zone change" "$ARCHIVE/scenarios/working-hours.feature" } +@test "a fully shipped whole-file unit changed in meaning or rebased carries its reconciled text, written at the feature root" { + local text + text=$(joined "$SCRIPT_DIR/references/changes-and-deltas.md") + grep -q "\*\*Changed:\*\* the reconciled entry carries the approved file as its text" <<< "$text" + grep -q "\*\*Rebased:\*\* a revised file whose feature-root version drifted" <<< "$text" + grep -q "A reconciled entry for a changed, rebased or split file" <<< "$text" + grep -q "whole-file unit that changed in meaning or was rebased" <<< "$(joined "$REF")" +} + +@test "fixture: a fully shipped story changed in meaning reaches the feature root as approved, and the archive keeps it as ratified" { + stage_fixture + local reconciled="$WORK/reconciled" + mkdir -p "$reconciled" + python3 - "$RECONCILED/free-busy.delta.md" "$reconciled/free-busy.delta.md" <<'PY' +import sys +text = open(sys.argv[1]).read() +entry = "### stories/US-002-set-working-hours.md\n" +approved = ( + "Text:\n\n~~~markdown\n---\ntype: story\ntitle: \"US-002: Set working hours\"\n" + "description: A member sets working hours so others see the time outside them apart from busy blocks.\n" + "status: stable\n---\n\n# US-002: Set working hours\n\n**PRD Requirement:** FR-03, FR-02\n\n" + "## Story\n\nAs a member,\nI want to set the hours of my working day,\n" + "so that others see when I am outside working hours.\n\n## Acceptance Criteria\n\n" + "- [ ] I can set the start and end of my working day\n" + "- [ ] Others see the time outside my working day apart from my busy blocks\n~~~\n" +) +assert entry in text +open(sys.argv[2], "w").write(text.replace(entry, entry + "\n" + approved, 1)) +PY + run python3 "$DELTAS" canonize "$FEATURE" working-hours --date 2027-03-08 --deltas "$reconciled" + echo "$output" + [ "$status" -eq 0 ] + grep -q "apart from my busy blocks" "$FEATURE/stories/US-002-set-working-hours.md" + refute_grep -q "don't invite me to meetings" "$FEATURE/stories/US-002-set-working-hours.md" + grep -q "don't invite me to meetings" "$FEATURE/changes/archive/2027-03-08-working-hours/stories/US-002-set-working-hours.md" + rm -rf "$WORK" +} + @test "fixture: the reconciled deltas leave out deferred units and carry the approved text" { local reconciled="$RECONCILED/free-busy.delta.md" refute_grep -q "FR-04\|US-003\|time.zone" "$reconciled" diff --git a/plugins/product-development/skills/product-development/tests/helpers/deltas.py b/plugins/product-development/skills/product-development/tests/helpers/deltas.py index d4b8786..f156eac 100755 --- a/plugins/product-development/skills/product-development/tests/helpers/deltas.py +++ b/plugins/product-development/skills/product-development/tests/helpers/deltas.py @@ -241,7 +241,7 @@ def change_name(change_dir): def file_units(deltas): """Map each whole-file unit, as (qualifier, path), to (section, text), where text is the Text or New text a reconciled entry carries for a - split file, or None.""" + changed, rebased or split file, or None.""" units = {} for delta, q in deltas: for e in parse_delta(delta): @@ -833,8 +833,9 @@ def apply_canonization(feature, change, date, deltas, reconciled, writes, emptie if text is None: shutil.move(str(change_dir / prefix(q) / rel), str(dest)) else: - # A split file: the reconciled entry carries the shipped part, and - # the change's file, with the deferred part, is archived. + # A changed, rebased or split file: the reconciled entry carries + # the text that shipped, and the change's file, as ratified, is + # archived. dest.write_text(text.rstrip("\n") + "\n") for d in sorted(change_dir.rglob("*"), reverse=True): if d.is_dir() and not any(d.iterdir()): From a8d4995d195f46a823bd67488bc4c0bbb514645b Mon Sep 17 00:00:00 2001 From: John Lianoglou Date: Sun, 29 Nov 2026 23:25:05 -0500 Subject: [PATCH 06/17] fix(product-development): restore app-local scenarios when dropping a change A promotion PR edits app-local scenario files in place on the default branch, but dropping the ratified change only deleted its directory, so the revised scenarios stayed active. The drop PR now restores revised files from their recorded base text and deletes added ones, under the deferral guards; a file another change edited since is refused and reconciled by the maintainer. The lineage log records each file under Restored or Removed. Refs #23, #21, #35 --- .../references/changes-and-deltas.md | 2 ++ .../references/feature-bundles.md | 5 +++-- .../templates/documents/lineage-log.md.tmpl | 2 ++ .../tests/feature-evolution.bats | 13 +++++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/plugins/product-development/skills/product-development/references/changes-and-deltas.md b/plugins/product-development/skills/product-development/references/changes-and-deltas.md index d8a176d..c417240 100644 --- a/plugins/product-development/skills/product-development/references/changes-and-deltas.md +++ b/plugins/product-development/skills/product-development/references/changes-and-deltas.md @@ -195,6 +195,8 @@ Canonization accounts for each app-local file as it does for the change's other Before it restores or rewrites a file, canonization compares it with the file at the promotion PR's merge commit; if another change has edited it since, canonization refuses and the maintainer reconciles the file. Likewise, canonization refuses a deferral whose recorded base text differs from the file at the merge commit's first parent, or that deletes a file present there: putting back a stale base would undo another change's revision. The shaping item a deferral creates starts from the file at the promotion PR's merge commit. +Dropping a Ratified change undoes its app-local edits in the drop PR, since the promotion PR made them on the default branch. For each app-local scenario file the ratified deltas list, the drop PR restores each revised file from its recorded base text and deletes each file the change added, under the same guards as a deferral: the file must still read as the promotion PR's merge commit left it, and the recorded base text must equal the file at the merge commit's first parent. If another change has edited the file since, restoring the base would undo that edit, so the drop PR refuses that file and the maintainer reconciles it, removing only the dropped change's edits and keeping the later ones. A change dropped before its promotion PR merged made no app-local edits on the default branch. + ## A change's stories and scenarios A change carries its own stories and scenarios until it is canonized. The feature root keeps only stories and scenarios of shipped behavior, so an expectation that has not shipped never sits beside shipped ones, and anyone reading `scenarios/` at the feature root reads only what the product does. diff --git a/plugins/product-development/skills/product-development/references/feature-bundles.md b/plugins/product-development/skills/product-development/references/feature-bundles.md index e2b4fa0..e6bd8ef 100644 --- a/plugins/product-development/skills/product-development/references/feature-bundles.md +++ b/plugins/product-development/skills/product-development/references/feature-bundles.md @@ -126,7 +126,7 @@ Change events go in the log, never in the feature spec. - **Feature split**: one feature becomes two or more. - **Feature merge**: two or more features become one. - **Feature drop**: a feature is withdrawn. -- **Dropped change**: a change is withdrawn before it ships, from `shaping/` or from `changes/`. A Shipped change cannot be dropped: withdrawing shipped behavior is a new change that removes it, shaped, ratified and canonized like any other. +- **Dropped change**: a change is withdrawn before it ships, from `shaping/` or from `changes/`. A Shipped change cannot be dropped: withdrawing shipped behavior is a new change that removes it, shaped, ratified and canonized like any other. When the change was Ratified, the drop PR also restores the app-local scenario files its promotion PR revised and deletes the ones it added, with the guards in [changes-and-deltas.md](changes-and-deltas.md#app-local-scenario-files), and the entry lists each under Restored or Removed. - **Promotion PR closed without merging**: the change returns to `shaping/` or is dropped; say which. A closed PR can't carry its own entry, so add it in the next commit to the default branch that touches `docs/product/`. @@ -166,7 +166,7 @@ No `calendar-links` directory remains. Its history is in this entry, in the arch ### Worked example: a dropped change -The change `recurring-invitations` was ratified, then the maintainer withdrew it before it shipped. The PR that drops it deletes `features/shared-calendars/changes/recurring-invitations/` and adds: +The change `recurring-invitations` was ratified, then the maintainer withdrew it before it shipped. Its promotion PR had revised the app-local scenario file `apps/web/docs/features/shared-calendars/scenarios/invitation-list.feature`, and no change has edited it since. The PR that drops it deletes `features/shared-calendars/changes/recurring-invitations/`, restores that file from the base text its delta recorded, and adds: ```markdown ## 2027-02-03 @@ -175,4 +175,5 @@ The change `recurring-invitations` was ratified, then the maintainer withdrew it - Reason: Usage showed organizers re-invite per event; the series model added cost without demand. - State when dropped: Ratified - Removed: `features/shared-calendars/changes/recurring-invitations/`, last present in commit 9b07e3d + - Restored: `apps/web/docs/features/shared-calendars/scenarios/invitation-list.feature`, to its text before the promotion PR ``` diff --git a/plugins/product-development/skills/product-development/templates/documents/lineage-log.md.tmpl b/plugins/product-development/skills/product-development/templates/documents/lineage-log.md.tmpl index b2bad02..b211943 100644 --- a/plugins/product-development/skills/product-development/templates/documents/lineage-log.md.tmpl +++ b/plugins/product-development/skills/product-development/templates/documents/lineage-log.md.tmpl @@ -26,6 +26,8 @@ Product-wide record of feature splits, merges and drops, dropped changes, and pr - Removed: ``, last present in commit - Removed: `features//`, the receiving bundle the change's promotion PR created, last present in commit + - Restored: ``, to its text before the promotion PR + ## diff --git a/plugins/product-development/skills/product-development/tests/feature-evolution.bats b/plugins/product-development/skills/product-development/tests/feature-evolution.bats index 8ea3be5..f19df93 100644 --- a/plugins/product-development/skills/product-development/tests/feature-evolution.bats +++ b/plugins/product-development/skills/product-development/tests/feature-evolution.bats @@ -672,6 +672,19 @@ SPLIT="$SCRIPT_DIR/tests/fixtures/feature-split" grep -qx -- " - Removed: \`features//\`, the receiving bundle the change's promotion PR created, last present in commit " "$tmpl" } +@test "dropping a ratified change restores the app-local scenario files its promotion PR revised, guarded like a deferral" { + local deltas bundles tmpl="$SCRIPT_DIR/templates/documents/lineage-log.md.tmpl" + deltas=$(joined "$SCRIPT_DIR/references/changes-and-deltas.md") + bundles=$(joined "$SCRIPT_DIR/references/feature-bundles.md") + grep -q "Dropping a Ratified change undoes its app-local edits in the drop PR" <<< "$deltas" + grep -q "restores each revised file from its recorded base text and deletes each file the change added" <<< "$deltas" + grep -q "the drop PR refuses that file and the maintainer reconciles it" <<< "$deltas" + grep -q "removing only the dropped change's edits" <<< "$deltas" + grep -q "the drop PR also restores the app-local scenario files" <<< "$bundles" + sed -n '/^### Worked example: a dropped change/,$p' "$SCRIPT_DIR/references/feature-bundles.md" | grep -q " - Restored: \`apps/web/docs/features/shared-calendars/scenarios/" + grep -q " - Restored: \`\`" "$tmpl" +} + @test "a split's promotion PR initializes the receiving bundle and both logs record the split" { local text text=$(joined "$SCRIPT_DIR/references/feature-bundles.md") From 1045550f5b700f9ecfdb632a03a518b5106d9d05 Mon Sep 17 00:00:00 2001 From: John Lianoglou Date: Sun, 29 Nov 2026 23:27:09 -0500 Subject: [PATCH 07/17] docs(product-development): state the --pending contract the script runs The open-questions reference said both that valid tables in pending folders are indexed and that pending questions are invisible to `blocking`. The script indexes valid rows there and passes them to `blocking`; only tables still in the 0.1.0 format are skipped. The reference, the modernization guide, SKILL.md and the script's help now say exactly that, and the maintainer reads the 0.1.0 tables directly before accepting a gate pass. A modernization test puts a valid row in a pending folder and shows it fails `blocking` for the change it names. Refs #37, #46, #35 --- .../skills/product-development/SKILL.md | 2 +- .../references/modernization.md | 2 +- .../references/open-questions.md | 4 +-- .../scripts/open-questions.py | 3 +- .../tests/modernization.bats | 35 +++++++++++++++++++ 5 files changed, 41 insertions(+), 5 deletions(-) diff --git a/plugins/product-development/skills/product-development/SKILL.md b/plugins/product-development/skills/product-development/SKILL.md index b2a2da3..f330b86 100644 --- a/plugins/product-development/skills/product-development/SKILL.md +++ b/plugins/product-development/skills/product-development/SKILL.md @@ -463,7 +463,7 @@ Load `references/source/product-constitution-guide.md` only through `references/ ## Scripts - **`scripts/init.sh`** — Project initialization script. Scaffolds `docs/product/` from templates with placeholder substitution. Supports interactive prompts, CLI arguments, and `--dry-run`. -- **`scripts/open-questions.py`** — Generates the open-questions index in `docs/product/open-questions.md`, checks it in CI, and lists the open questions that hold a change at a check point. `--pending` skips each feature folder still in the 0.1.0 layout while it awaits modernization, as the profile check does. See `references/open-questions.md`. +- **`scripts/open-questions.py`** — Generates the open-questions index in `docs/product/open-questions.md`, checks it in CI, and lists the open questions that hold a change at a check point. `--pending` names each feature folder still in the 0.1.0 layout while it awaits modernization, as the profile check does: the rows of tables still in the 0.1.0 format are skipped, and valid rows there still count. See `references/open-questions.md`. - **`scripts/okf-profile.py`** — OKF profile tooling. `index` regenerates every `index.md` in `docs/product/`, keeping the root front matter; `index --check` reports stale indexes; `check` runs the profile checks, skipping the originals that modernization archives without front matter; `--pending` makes `index` and `check` skip each feature folder still in the 0.1.0 layout while it awaits modernization, and check everything else. Needs PyYAML. ## Templates diff --git a/plugins/product-development/skills/product-development/references/modernization.md b/plugins/product-development/skills/product-development/references/modernization.md index e83a9f3..cee60e8 100644 --- a/plugins/product-development/skills/product-development/references/modernization.md +++ b/plugins/product-development/skills/product-development/references/modernization.md @@ -66,7 +66,7 @@ Live open questions in the original documents move to the shaping document they python3 "/scripts/open-questions.py" index --pending {unconverted} docs/product ``` -Never name the folder being converted, or one converted earlier, with `--pending`: both scripts refuse a folder that is not in the 0.1.0 layout. The script doesn't validate the question tables of the pending folders, since they hold 0.1.0 tables, but it still indexes a valid table there. Every other table is validated, so an error in a feature converted earlier still fails the command. It checks question links everywhere except between pending folders: links into them, and their links out to the rest of the bundle. +Never name the folder being converted, or one converted earlier, with `--pending`: both scripts refuse a folder that is not in the 0.1.0 layout. The script doesn't validate the question tables of the pending folders, since they hold 0.1.0 tables, but a valid row there counts, indexed and seen by `blocking`. Rows in tables still in the 0.1.0 format are skipped, so the maintainer reads those tables directly before accepting a gate pass ([While modernization is in progress](open-questions.md#while-modernization-is-in-progress)). Every other table is validated, so an error in a feature converted earlier still fails the command. It checks question links everywhere except between pending folders: links into them, and their links out to the rest of the bundle. `open-questions.py` doesn't follow the question links inside the archived originals, the PRD and TRD that the profile checks skip, identified the same way. They are history, and history never blocks a live check: a link in them that breaks once they are archived, such as a relative link to a question in another folder, never fails a check, and you don't edit them to fix it. A live document's link into the archive is checked like any other. 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 b05f3e5..d663ffc 100644 --- a/plugins/product-development/skills/product-development/references/open-questions.md +++ b/plugins/product-development/skills/product-development/references/open-questions.md @@ -115,9 +115,9 @@ Until the last feature folder written with 0.1.0 is converted ([modernization.md 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, and a valid one is still indexed; a question link from it 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. 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)). -A pending folder's 0.1.0 questions are invisible to `blocking` 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` 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`. +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`. ## Worked example 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 348376b..984a477 100755 --- a/plugins/product-development/skills/product-development/scripts/open-questions.py +++ b/plugins/product-development/skills/product-development/scripts/open-questions.py @@ -48,7 +48,8 @@ --pending: each feature folder still in the 0.1.0 layout. Repeat it for each one. Everything else is validated in full, the features converted earlier included. Tables in a pending folder are not validated, since it holds 0.1.0 -tables; a valid one there is still indexed. Question links are checked +tables: a valid row there still counts, indexed and seen by blocking, and a +row in a table still in the 0.1.0 format is skipped. Question links are checked everywhere except between pending folders: a link from a pending folder to a document outside them is checked. A command refuses, with exit status 2, a --pending that names a folder not in the 0.1.0 layout: one with a feature diff --git a/plugins/product-development/skills/product-development/tests/modernization.bats b/plugins/product-development/skills/product-development/tests/modernization.bats index 398a9b2..5600cc9 100644 --- a/plugins/product-development/skills/product-development/tests/modernization.bats +++ b/plugins/product-development/skills/product-development/tests/modernization.bats @@ -706,6 +706,41 @@ EOF diff -r "$OTHER_OLD" "$BUNDLE/features/calendar-sharing" } +@test "open-questions: a valid row in a pending folder counts: it is indexed and holds the converted change it names" { + indexed_bundle + local prd="$BUNDLE/features/calendar-sharing/PRD.md" + cat >> "$prd" <<'EOF' + +## Questions for the conversion + +| ID | Question | Blocking level | Blocks | Resolution | Deferred to | Approval | +|----|----------|----------------|--------|------------|-------------|----------| +| OQ-2 | Do SMS reminders reach the members a calendar is shared with? | design | event-reminders/sms-reminders | maintainer decision | — | — | +EOF + run python3 "$OPEN_QUESTIONS" blocking --pending calendar-sharing "$BUNDLE" event-reminders/sms-reminders --level design + echo "$output" + [ "$status" -eq 1 ] + grep -qF "features/calendar-sharing/PRD.md#oq-2 design" <<< "$output" + # The row still in the 0.1.0 format is skipped: no command sees it. + refute_grep -qF "features/calendar-sharing/PRD.md#oq-1" <<< "$output" + run python3 "$OPEN_QUESTIONS" index --pending calendar-sharing "$BUNDLE" + [ "$status" -eq 0 ] + grep -qF "[features/calendar-sharing/PRD.md#oq-2]" "$BUNDLE/open-questions.md" + refute_grep -qF "[features/calendar-sharing/PRD.md#oq-1]" "$BUNDLE/open-questions.md" +} + +@test "the pending contract says valid rows count and 0.1.0 rows are read by hand, in one voice" { + local note mod skill + note=$(awk '/^## / { on = ($0 == "## While modernization is in progress") } on' "$SCRIPT_DIR/references/open-questions.md" | tr -s '\n ' ' ') + mod=$(joined "$SCRIPT_DIR/references/modernization.md") + skill=$(joined "$SCRIPT_DIR/SKILL.md") + grep -q "A valid row in a pending folder counts: it is indexed, and \`blocking\` sees it" <<< "$note" + grep -q "Rows in a table still in the 0.1.0 format are skipped" <<< "$note" + refute_grep -q "invisible to \`blocking\`" <<< "$note" + grep -q "a valid row there counts, indexed and seen by \`blocking\`" <<< "$mod" + grep -q "the rows of tables still in the 0.1.0 format" <<< "$skill" +} + @test "open-questions: a feature converted earlier stays validated and indexed while another is pending" { indexed_bundle convert_other From af5c864a657de084b39b2c25407f6a3a9698fab4 Mon Sep 17 00:00:00 2001 From: John Lianoglou Date: Sun, 29 Nov 2026 23:27:50 -0500 Subject: [PATCH 08/17] docs(product-development): route workflow selection by approved inputs The workflow-selection table sent "PRD exists" to User Stories without an approved TRD, and "Stories exist" to BDD Scenarios though BDD needs defined acceptance criteria. Entry points now follow the workflows' triggers: a workflow starts when its inputs are approved, and a draft PRD, TRD, story set or scenario set goes back to its own workflow. Refs #36, #23, #35 --- .../skills/product-development/SKILL.md | 9 ++++++--- .../tests/lifecycle-review-handoff.bats | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/plugins/product-development/skills/product-development/SKILL.md b/plugins/product-development/skills/product-development/SKILL.md index f330b86..2015170 100644 --- a/plugins/product-development/skills/product-development/SKILL.md +++ b/plugins/product-development/skills/product-development/SKILL.md @@ -376,7 +376,7 @@ All product documentation follows a three-tier hierarchy. See `docs/product/READ ## Workflow Selection -Not every feature starts at the beginning. Match the entry point to the current state: +Not every feature starts at the beginning. Match the entry point to the current state. Route by the gates already passed: a workflow starts only when its inputs are approved, and an unfinished artifact goes back to the workflow that produces it. | Starting point | Enter at | |---------------|----------| @@ -385,8 +385,11 @@ Not every feature starts at the beginning. Match the entry point to the current | 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 | -| PRD exists, needs decomposition | User Stories | -| Stories exist, needs testable criteria | BDD Scenarios | +| 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 | +| Stories approved, with acceptance criteria defined | BDD Scenarios | +| Scenarios drafted, not yet approved | BDD Scenarios: finish their review and approval | | Discovery suggests the work may evolve an existing feature | Discovery and Design: classify the work first | | Approved change in `shaping/`, not yet ratified | Promotion | | Ratified change in `features/{feature}/changes/`, handoff not sent | Handoff | 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 0b775e3..38b06be 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 @@ -308,6 +308,20 @@ drop_row() { grep -q '^\*\*Gate:\*\* Do not start implementation until the handoff has been sent' <<< "$text" } +@test "workflow selection routes by approved inputs and sends unfinished artifacts back to their own workflow" { + local skill="$SCRIPT_DIR/SKILL.md" + grep -qxF '| PRD or TRD drafted, not yet approved | Requirements: finish its review and approval |' "$skill" + grep -qxF '| PRD and TRD approved, no stories yet | User Stories |' "$skill" + grep -qxF '| Stories drafted, not yet approved, or without acceptance criteria | User Stories: finish them |' "$skill" + grep -qxF '| Stories approved, with acceptance criteria defined | BDD Scenarios |' "$skill" + 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" + # 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" +} + @test "the lifecycle map and workflow selection place the handoff before implementation" { local skill="$SCRIPT_DIR/SKILL.md" map map=$(sed -n '/^## Lifecycle Map/,/^## Stages/p' "$skill") From af09d69c2b7215083ca93bcc0d2d063c9a91becf Mon Sep 17 00:00:00 2001 From: John Lianoglou Date: Sun, 29 Nov 2026 23:33:37 -0500 Subject: [PATCH 09/17] fix(product-development): run scripts from the installed skill path SKILL.md and several references ran `scripts/open-questions.py` and `scripts/init.sh` as if the scripts sat in the project, but they ship with the installed skill and init.sh copies none of them. Every invocation now uses `python3 "/scripts/