diff --git a/docs/superpowers/plans/2026-08-15-access-navigation-icon-intern-picker.md b/docs/superpowers/plans/2026-08-15-access-navigation-icon-intern-picker.md index 59ac8eb..e21d537 100644 --- a/docs/superpowers/plans/2026-08-15-access-navigation-icon-intern-picker.md +++ b/docs/superpowers/plans/2026-08-15-access-navigation-icon-intern-picker.md @@ -15,9 +15,9 @@ feature-branch ownership areas. `work/` ref exists. 4. Regenerate the local SRS after amending the existing operational requirement; do not add a requirement ID or a use case. -5. Prove GREEN with exact searches, requirement/use-case counts, local-link - resolution, and whitespace validation. Commit the tracked guidance locally; - do not push or merge. +5. Prove GREEN with the executable six-guide regression, requirement/use-case + counts, local-link resolution, and an immutable base-to-candidate whitespace + check. Commit the tracked guidance locally; do not push or merge. ## Exit criteria diff --git a/docs/superpowers/specs/2026-08-15-access-navigation-icon-intern-picker-design.md b/docs/superpowers/specs/2026-08-15-access-navigation-icon-intern-picker-design.md index ffcac8a..e64f2a1 100644 --- a/docs/superpowers/specs/2026-08-15-access-navigation-icon-intern-picker-design.md +++ b/docs/superpowers/specs/2026-08-15-access-navigation-icon-intern-picker-design.md @@ -32,6 +32,7 @@ push or merge without separate authority. ## Validation -The documentation evidence record checks the required spelling, rejects the -nested form, verifies requirement counts and generated SRS use-case count, and -resolves local Markdown links. +The executable documentation validator checks the exact approved statement in +each tracked guide and rejects an injected positive nested-branch recommendation. +The evidence record also verifies requirement counts, generated SRS use-case +count, and local Markdown links. diff --git a/scripts/verify-fix-branch-workflow.cjs b/scripts/verify-fix-branch-workflow.cjs new file mode 100644 index 0000000..ecaf72f --- /dev/null +++ b/scripts/verify-fix-branch-workflow.cjs @@ -0,0 +1,71 @@ +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); + +const repositoryRoot = path.resolve(__dirname, '..'); +const validForm = '`work/fix//`'; +const invalidForm = '`work//fix/`'; +const documents = [ + { + file: 'AGENTS.md', + approved: '- A targeted repair uses a clean, isolated `work/fix//` branch and worktree from the taskmaster-verified current `main`. Do not use `work//fix/`: the persistent `work/` ref already occupies that Git ref prefix.' + }, + { + file: 'README.md', + approved: 'For a targeted repair, create a clean isolated branch and worktree from the\ntaskmaster-verified current `main` named\n`work/fix//`. Do not nest it as\n`work//fix/`: the persistent `work/` ref already\nuses that Git ref prefix.' + }, + { + file: 'DEVELOPMENT.md', + approved: 'For a targeted repair, start a clean worktree from the taskmaster-verified\ncurrent `main` on `work/fix//`. Keep it separate from the\nfive persistent `work/` branches. Do not use\n`work//fix/` because the persistent `work/` ref\nalready occupies that Git ref prefix.' + }, + { + file: 'TESTING.md', + approved: 'Run that check from the clean targeted-fix branch named\n`work/fix//` when repairing one feature. Do not use\n`work//fix/`: a persistent `work/` ref already\noccupies that Git ref prefix. Record the expected RED and the matching GREEN\nshell output in the evidence record.' + }, + { + file: 'docs/superpowers/specs/2026-08-15-access-navigation-icon-intern-picker-design.md', + approved: 'Use `work/fix//` for each targeted repair. Create its clean,\nisolated worktree from the taskmaster-verified current `main`. The ``\nsegment identifies the owning persistent area; it does not nest below that\npersistent branch.\n\nThe forbidden form is `work//fix/`. A repair owner preserves\nother worktrees, records RED and GREEN evidence, commits locally, and does not\npush or merge without separate authority.' + }, + { + file: 'docs/superpowers/plans/2026-08-15-access-navigation-icon-intern-picker.md', + approved: '2. Add one branch rule everywhere contributors, coordinators, and requirement\n reviewers rely on it: `work/fix//` from verified `main`.\n3. State why `work//fix/` is invalid while its persistent\n `work/` ref exists.' + } +]; + +/** Validates that every tracked guide contains only its approved branch wording. */ +function validate(contents) { + const failures = []; + + for (const {file, approved} of documents) { + const content = contents.get(file); + if (count(content, validForm) !== 1) failures.push(`${file} must contain ${validForm} exactly once`); + if (!content.includes(approved)) failures.push(`${file} is missing its approved branch workflow statement`); + + const outsideApprovedStatement = content.replace(approved, ''); + if (outsideApprovedStatement.includes(validForm) || outsideApprovedStatement.includes(invalidForm)) { + failures.push(`${file} contains an unapproved branch-form reference`); + } + } + + if (failures.length) throw new Error(failures.join('\n')); +} + +function count(content, value) { + return content.split(value).length - 1; +} + +function readContents() { + return new Map(documents.map(({file}) => [file, fs.readFileSync(path.join(repositoryRoot, file), 'utf8')])); +} + +const contents = readContents(); +validate(contents); + +if (process.argv.includes('--self-test')) { + const positiveRecommendation = new Map(contents); + positiveRecommendation.set('AGENTS.md', `${contents.get('AGENTS.md')}\nUse ${invalidForm} for a targeted repair.\n`); + assert.throws(() => validate(positiveRecommendation), /AGENTS\.md contains an unapproved branch-form reference/); +} + +console.log(`Fix-branch workflow documentation: ${documents.length} approved statements validated`); +if (process.argv.includes('--self-test')) console.log('Positive nested branch recommendation: rejected');