You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cfs validate-toc reads no configuration at all: it parses files, --max-level, --max-section-lines and --verbose, and nothing else (skills/studio/scripts/studio/commands/validate_toc.py). Every Markdown file with headings and no Table of Contents is therefore an error with no way to disable or scope the rule — the problem reported in #53, where a run across a docs tree flagged 23 files that have no TOC by design.
The artifact pipeline already has a per-kind gate that the standalone command cannot see: validate_artifact_file runs the TOC phase only when toc = true in the kit's constraints (skills/studio/scripts/studio/utils/constraints.py:1866). That same phase hardcodes max_heading_level=3 (_validate_artifact_toc, utils/constraints.py:1158), even though validate_toc() is fully parameterised and the standalone command exposes both knobs — so the depth rule #141 wants relaxable is unreachable from cfs validate.
The existing toc boolean keeps its type. _parse_kind_toc rejects a non-boolean and fails the whole constraints file, so widening that key would make an older engine drop a newer kit's constraints entirely.
_validate_artifact_toc reads the table instead of its hardcoded depth.
The TOC rules get their first documentation: nothing in guides/ currently describes toc-missing, toc-stale, the anchor and coverage rules, or the JIT-readiness warnings.
cfs validate-toc — honour project rule configuration and per-artifact-kind TOC options
Part of #140. Depends on #174. Closes #53.
Context
cfs validate-tocreads no configuration at all: it parsesfiles,--max-level,--max-section-linesand--verbose, and nothing else (skills/studio/scripts/studio/commands/validate_toc.py). Every Markdown file with headings and no Table of Contents is therefore an error with no way to disable or scope the rule — the problem reported in #53, where a run across a docs tree flagged 23 files that have no TOC by design.The artifact pipeline already has a per-kind gate that the standalone command cannot see:
validate_artifact_fileruns the TOC phase only whentoc = truein the kit's constraints (skills/studio/scripts/studio/utils/constraints.py:1866). That same phase hardcodesmax_heading_level=3(_validate_artifact_toc,utils/constraints.py:1158), even thoughvalidate_toc()is fully parameterised and the standalone command exposes both knobs — so the depth rule #141 wants relaxable is unreachable fromcfs validate.Scope
validate-tocloads the context, maps each path to its registered artifact kind, and applies the severity policy from cfs validate — kit-supplied and project-level severity configuration, and one report contract #174:toc-missingset towarningis reported and the run exits 0.The existing
tocboolean keeps its type._parse_kind_tocrejects a non-boolean and fails the whole constraints file, so widening that key would make an older engine drop a newer kit's constraints entirely._validate_artifact_tocreads the table instead of its hardcoded depth.guides/currently describestoc-missing,toc-stale, the anchor and coverage rules, or the JIT-readiness warnings.Acceptance criteria
toc-missingtowarning;cfs validate-tocreports the finding and exits successfully. (cfs validate — Severity Model: Warnings, Not Only Errors #140 AC1, closing the general case behind validate-toc: no way to disable/scope the toc-missing rule (hardcoded, ignores config) #53)max_levelfor one artifact kind andcfs validatehonours it instead of the hardcoded 3.cfs validate-tocover this repository's own guides stays green.Delivery
One PR,
feat(validate-toc): honour project severity and per-kind TOC options, closing this issue and #53.