* feat(#163): tighten gsd-roadmapper granularity defaults to reduce thin-phase fragmentation Tighten the Granularity Calibration buckets in gsd-roadmapper (Coarse 3-5->2-4, Standard 5-8->4-6, Fine 8-12->6-10) and append inline Key guidance naming the thin-phase failure pattern (single requirement / internal-quality goal / task-shaped success criteria) with instruction to fold into a neighbor rather than create a standalone phase. Implements the maintainer-approved proposal verbatim. Update the canonical English docs that hardcoded the old phase-count numbers: docs/CONFIGURATION.md and docs/FEATURES.md. Translated docs are community-maintained and are not updated per-PR (CONTRIBUTING.md language policy). Prompt/doc text only; no code, format, or downstream-consumer changes. Agent size-budget and skills-awareness tests pass; full suite green. Closes #163 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore(#163): add Changed changeset for roadmapper granularity tightening Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * test(#163): lock tightened gsd-roadmapper granularity buckets source-text-is-the-product test asserting the Granularity Calibration table holds the tightened ranges (Coarse 2-4, Standard 4-6, Fine 6-10), that no row maps to an old bucket, and that the Key paragraph carries the thin-phase folding guidance. Would fail if the values regress. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
59 lines
2.5 KiB
JavaScript
59 lines
2.5 KiB
JavaScript
// allow-test-rule: source-text-is-the-product
|
|
// agents/gsd-roadmapper.md is the installed agent — the Granularity Calibration
|
|
// table IS the deployed instruction. Asserting on its text asserts what runs in
|
|
// production. Locks the tightened phase-count buckets from #163.
|
|
'use strict';
|
|
|
|
const { describe, test } = require('node:test');
|
|
const assert = require('node:assert/strict');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const AGENTS_DIR = path.join(__dirname, '..', 'agents');
|
|
|
|
function readAgent(name) {
|
|
return fs.readFileSync(path.join(AGENTS_DIR, `${name}.md`), 'utf8');
|
|
}
|
|
|
|
// Extract the "## Granularity Calibration" section (up to the next "## " heading)
|
|
// so number-range assertions are scoped and cannot be satisfied by unrelated text
|
|
// elsewhere in the agent file.
|
|
function granularitySection(content) {
|
|
const start = content.indexOf('## Granularity Calibration');
|
|
assert.ok(start !== -1, 'Granularity Calibration section must exist');
|
|
const rest = content.slice(start + '## Granularity Calibration'.length);
|
|
const nextHeading = rest.indexOf('\n## ');
|
|
return nextHeading === -1 ? rest : rest.slice(0, nextHeading);
|
|
}
|
|
|
|
describe('gsd-roadmapper granularity calibration (#163)', () => {
|
|
const section = granularitySection(readAgent('gsd-roadmapper'));
|
|
|
|
test('Coarse bucket is tightened to 2-4', () => {
|
|
assert.ok(/\|\s*Coarse\s*\|\s*2-4\s*\|/.test(section), 'Coarse must be 2-4');
|
|
});
|
|
|
|
test('Standard bucket is tightened to 4-6', () => {
|
|
assert.ok(/\|\s*Standard\s*\|\s*4-6\b/.test(section), 'Standard must be 4-6');
|
|
});
|
|
|
|
test('Fine bucket is tightened to 6-10', () => {
|
|
assert.ok(/\|\s*Fine\s*\|\s*6-10\s*\|/.test(section), 'Fine must be 6-10');
|
|
});
|
|
|
|
test('no granularity row maps to an old bucket (3-5 / 5-8 / 8-12)', () => {
|
|
// Scope to the second ("Typical Phases") column of each row so the approved
|
|
// explanatory footnote mentioning "5-8" in the third column does not false-fail.
|
|
assert.ok(!/\|\s*Coarse\s*\|\s*3-5\b/.test(section), 'Coarse must not map to 3-5');
|
|
assert.ok(!/\|\s*Standard\s*\|\s*5-8\b/.test(section), 'Standard must not map to 5-8');
|
|
assert.ok(!/\|\s*Fine\s*\|\s*8-12\b/.test(section), 'Fine must not map to 8-12');
|
|
});
|
|
|
|
test('Key paragraph names the thin-phase pattern and prefers folding into a neighbor', () => {
|
|
assert.ok(
|
|
section.includes('fold it into the most-related neighbor'),
|
|
'Key guidance must instruct folding thin phases into the most-related neighbor'
|
|
);
|
|
});
|
|
});
|