* fix(artifacts): register RETROSPECTIVE.md as canonical planning artifact Adds RETROSPECTIVE.md to CANONICAL_EXACT in artifacts.cjs so gsd-health no longer raises W019 after any /gsd-complete-milestone run. The file was established as a living artifact in PR #644 but omitted from the W019 registry created in PR #2488. Closes #3198 * chore(changeset): point pr metadata to #3200
54 lines
1.5 KiB
JavaScript
54 lines
1.5 KiB
JavaScript
/**
|
|
* Canonical GSD artifact registry.
|
|
*
|
|
* Enumerates the file names that gsd workflows officially produce at the
|
|
* .planning/ root level. Used by gsd-health (W019) to flag unrecognized files
|
|
* so stale or misnamed artifacts don't silently mislead agents or reviewers.
|
|
*
|
|
* Add entries here whenever a new workflow produces a .planning/ root file.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
// Exact-match canonical file names at .planning/ root
|
|
const CANONICAL_EXACT = new Set([
|
|
'PROJECT.md',
|
|
'ROADMAP.md',
|
|
'STATE.md',
|
|
'REQUIREMENTS.md',
|
|
'MILESTONES.md',
|
|
'BACKLOG.md',
|
|
'LEARNINGS.md',
|
|
'THREADS.md',
|
|
'config.json',
|
|
'CLAUDE.md',
|
|
'RETROSPECTIVE.md',
|
|
]);
|
|
|
|
// Pattern-match canonical file names (regex tests on the basename)
|
|
// Each pattern includes the name of the workflow that produces it as a comment.
|
|
const CANONICAL_PATTERNS = [
|
|
/^v\d+\.\d+(?:\.\d+)?-MILESTONE-AUDIT\.md$/i, // gsd-complete-milestone (pre-archive)
|
|
/^v\d+\.\d+(?:\.\d+)?-.*\.md$/i, // other version-stamped planning docs
|
|
];
|
|
|
|
/**
|
|
* Return true if `filename` (basename only, no path) matches a canonical
|
|
* .planning/ root artifact — either an exact name or a known pattern.
|
|
*
|
|
* @param {string} filename - Basename of the file (e.g. "STATE.md")
|
|
*/
|
|
function isCanonicalPlanningFile(filename) {
|
|
if (CANONICAL_EXACT.has(filename)) return true;
|
|
for (const pattern of CANONICAL_PATTERNS) {
|
|
if (pattern.test(filename)) return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
module.exports = {
|
|
CANONICAL_EXACT,
|
|
CANONICAL_PATTERNS,
|
|
isCanonicalPlanningFile,
|
|
};
|