Skip to content

Commit 3fc09d7

Browse files
montfortclaude
andauthored
fix(framework): docs-validation.yml recognizes all DocTypes (fw-4.4.1) (#66)
The workflow's VALID_PATTERN regex listed only 12 of the 16 canonical DocType prefixes (missing the four China-specific PIPIA, CACFILE, TC260RA, AILABEL) plus 2 stale entries (OPS, DOC) that aren't real DocType variants. The governance-metrics job had the same 12-element TYPES array, undercounting China docs in the metrics summary. The EXCLUDED blacklist also missed ~18 framework / governance / NIST guide files added in later releases, so an adopter running `devtrail update-framework` on a tracked checkout would see the workflow fail per-file with "Invalid naming". Refactored to a whitelist approach: a workflow-level env var DOC_TYPE_PREFIXES enumerates the 16 canonical prefixes once. Per-step checks skip files whose basename does not start with one of those prefixes — framework / governance / template files are silently skipped with no manual exclude list to maintain. The governance-metrics TYPES array is derived from the same env var. cli/src/document.rs::ALL_PREFIXES gains a doc-comment pointing at the workflow's env var. Adding a new DocType still requires updating both sides, but the bidirectional pointer makes the obligation discoverable from either entry point. Framework-only patch. CLI behavior unchanged; cli-3.6.0 unaffected. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2fea763 commit 3fc09d7

26 files changed

Lines changed: 105 additions & 62 deletions

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,27 @@ and this project uses [independent versioning](README.md#versioning) for Framewo
77

88
---
99

10+
## Framework 4.4.1 — `docs-validation.yml` workflow recognizes all DocTypes and recent governance files
11+
12+
### Fixed (Framework)
13+
14+
- `dist/.github/workflows/docs-validation.yml` had three pre-existing divergences that surfaced once Charters Phase 1 made adopters revisit the framework:
15+
- **`VALID_PATTERN` regex** missed the four China-specific DocTypes (`PIPIA`, `CACFILE`, `TC260RA`, `AILABEL`) that shipped earlier and incorrectly listed two stale prefixes (`OPS`, `DOC`) that aren't real DocType variants. A China-region adopter creating `PIPIA-2026-01-15-001-foo.md` would have the workflow reject it as "Invalid naming".
16+
- **`TYPES` array in the `governance-metrics` job** was a 12-element list missing the same four China DocTypes. The metrics summary on `$GITHUB_STEP_SUMMARY` always reported zero PIPIA/CACFILE/TC260RA/AILABEL counts, even when those documents existed.
17+
- **`EXCLUDED` regex** (referenced in 5 places) listed only 8 framework files but the framework now ships ~18 additional governance / reference files at the root of `00-governance/` and `03-implementation/` (C4-DIAGRAM-GUIDE, MANAGEMENT-REVIEW-TEMPLATE, AI-KPIS, AI-LIFECYCLE-TRACKER, AI-RISK-CATALOG, AI-GOVERNANCE-POLICY, CHINA-REGULATORY-FRAMEWORK, CAC-FILING-GUIDE, GB-45438-LABELING-GUIDE, PIPL-PIPIA-GUIDE, ISO-25010-2023-REFERENCE, OBSERVABILITY-GUIDE, TC260-IMPLEMENTATION-GUIDE, the four NIST-AI-RMF guides). When an adopter ran `devtrail update-framework` on a tracked checkout, the workflow flagged each of these as "Invalid naming" and the job failed.
18+
19+
### Changed (Framework)
20+
21+
- The workflow now uses a **whitelist approach** instead of the blacklist. A new top-level `env: DOC_TYPE_PREFIXES` enumerates the 16 canonical DocType prefixes (in sync with `cli/src/document.rs::DocType::ALL_PREFIXES`); per-step checks skip files whose basename does not start with one of those prefixes. Framework / governance / template files are silently skipped with no manual exclude list to maintain. The `governance-metrics` job derives its `TYPES` array from the same env var.
22+
- `cli/src/document.rs::ALL_PREFIXES` gains a doc-comment pointing at the workflow's env var, and the workflow's env var has a comment pointing back. Adding a new DocType still requires updating both sides, but the bidirectional pointer makes the obligation discoverable from either entry point.
23+
24+
### Notes
25+
26+
- This is a Framework-only patch. CLI behavior is unchanged; `cli-3.6.0` is unaffected. Existing adopters can pick up the fix with `devtrail update-framework`.
27+
- Charter validation in CI is intentionally still out of scope for this workflow — the `--include-charters` flag on `devtrail validate` is opt-in and the workflow's path filter (`.devtrail/**`) does not cover `docs/charters/`. Adding Charter validation to CI is queued for cli-3.7.0 along with `--include-charters --staged` integration.
28+
29+
---
30+
1031
## Framework 4.4.0 / CLI 3.6.0 — Charters as a first-class entity
1132

1233
The first user-visible step of the post-Sentinel roadmap (`Propuesta/devtrail-cli-roadmap.md` Fase 1). Crystallizes the Charter pattern — bounded, auditable units of work declared ex-ante and validated ex-post — that emerged from the 6-cycle Sentinel `/plan-audit` experiment. The artifact was historically called "Plan" in Sentinel; renamed to **Charter** to disambiguate from GitHub SpecKit's `plan.md`. Sentinel's historical files preserve "Plan"; everything DevTrail ships from this release on uses "Charter".

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ DevTrail uses independent version tags for each component:
206206

207207
| Component | Tag prefix | Example | Includes |
208208
|-----------|-----------|---------|----------|
209-
| Framework | `fw-` | `fw-4.4.0` | Templates (12 types), governance, directives, Charter template + schema |
209+
| Framework | `fw-` | `fw-4.4.1` | Templates (12 types), governance, directives, Charter template + schema |
210210
| CLI | `cli-` | `cli-3.6.0` | The `devtrail` binary |
211211

212212
Check installed versions with `devtrail status` or `devtrail about`.
@@ -238,7 +238,7 @@ See [CLI Reference](https://github.com/StrangeDaysTech/devtrail/blob/main/docs/a
238238
```bash
239239
# Download the latest framework release ZIP from GitHub
240240
# Go to https://github.com/StrangeDaysTech/devtrail/releases
241-
# and download the latest fw-* release (e.g., fw-4.4.0)
241+
# and download the latest fw-* release (e.g., fw-4.4.1)
242242
243243
# Extract and copy to your project
244244
unzip devtrail-fw-*.zip -d your-project/

cli/src/document.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,13 @@ impl DocType {
7171
}
7272
}
7373

74-
/// All valid prefixes
74+
/// All valid prefixes.
75+
///
76+
/// Adding a DocType? Update BOTH this array and the
77+
/// `DOC_TYPE_PREFIXES` env var at the top of
78+
/// `dist/.github/workflows/docs-validation.yml`. The CI workflow uses
79+
/// that env var as its single source of truth for valid type prefixes,
80+
/// but it cannot import from Rust — the two must be kept in manual sync.
7581
pub const ALL_PREFIXES: &'static [&'static str] = &[
7682
"AILOG", "AIDEC", "ADR", "ETH", "REQ", "TES", "INC", "TDE",
7783
"SEC", "MCARD", "SBOM", "DPIA",

dist/.devtrail/00-governance/AGENT-RULES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,4 +270,4 @@ When a change modifies API endpoints:
270270
271271
---
272272
273-
*DevTrail v4.4.0 | [Strange Days Tech](https://strangedays.tech)*
273+
*DevTrail v4.4.1 | [Strange Days Tech](https://strangedays.tech)*

dist/.devtrail/00-governance/C4-DIAGRAM-GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,4 @@ Use a Level 1 (Context) diagram to illustrate:
234234

235235
---
236236

237-
*DevTrail v4.4.0 | [Strange Days Tech](https://strangedays.tech)*
237+
*DevTrail v4.4.1 | [Strange Days Tech](https://strangedays.tech)*

dist/.devtrail/00-governance/DOCUMENTATION-POLICY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,4 +257,4 @@ See also [ADR-2025-01-20-001] for architectural context.
257257
258258
---
259259

260-
*DevTrail v4.4.0 | [Strange Days Tech](https://strangedays.tech)*
260+
*DevTrail v4.4.1 | [Strange Days Tech](https://strangedays.tech)*

dist/.devtrail/00-governance/QUICK-REFERENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,4 @@ Mark `review_required: true` when:
213213

214214
---
215215

216-
*DevTrail v4.4.0 | [Strange Days Tech](https://strangedays.tech)*
216+
*DevTrail v4.4.1 | [Strange Days Tech](https://strangedays.tech)*

dist/.devtrail/00-governance/i18n/es/AGENT-RULES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,4 +270,4 @@ Cuando un cambio modifica endpoints de API:
270270
271271
---
272272
273-
*DevTrail v4.4.0 | [Strange Days Tech](https://strangedays.tech)*
273+
*DevTrail v4.4.1 | [Strange Days Tech](https://strangedays.tech)*

dist/.devtrail/00-governance/i18n/es/C4-DIAGRAM-GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,4 @@ Usar un diagrama de Nivel 1 (Contexto) para ilustrar:
234234

235235
---
236236

237-
*DevTrail v4.4.0 | [Strange Days Tech](https://strangedays.tech)*
237+
*DevTrail v4.4.1 | [Strange Days Tech](https://strangedays.tech)*

dist/.devtrail/00-governance/i18n/es/DOCUMENTATION-POLICY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,4 +249,4 @@ Ver también [ADR-2025-01-20-001] para contexto arquitectónico.
249249

250250
---
251251

252-
*DevTrail v4.4.0 | [Strange Days Tech](https://strangedays.tech)*
252+
*DevTrail v4.4.1 | [Strange Days Tech](https://strangedays.tech)*

0 commit comments

Comments
 (0)