Skip to content

star lint markdown's frontmatter check is a 33-line stub while two bash gates enforce the real standard #932

Open

Description

@David-Noble-at-work

Lane 2 of NobleFactor/noblefactor-engprod#232, the lint tooling schedule. noblefactor-ops#231 deletes Test-Frontmatter.sh first (repurposed 2026-10-19 from an interim fail-closed fix); this lane builds its replacement.

that the base repository's frontmatter gate and star's own check disagree about what a document must
carry. #837's standing ruling applies: "the linter is embedded in star — and all linters should be
embedded in star."
The frontmatter check already is embedded, which is the good part; what it
checks is the problem.

Context

star lint markdown advertises "Run markdownlint and frontmatter check on markdown files". The
frontmatter half is a 33-line stub (cmd/star/provider/lint/provider.go:798-831) that checks two
hard-coded fields and nothing else. Meanwhile two bash scripts in two repositories enforce a much
larger standard, neither reachable from star:

  • noblefactor-ops/.github/scripts/Test-Frontmatter.sh (148 lines) — the reference implementation of
    documentation-standards.md.
  • devlore-cli/scripts/Test-GuideFrontmatter.sh — this repository's own, separate gate.

The standard says the rule is "uniform across repositories; only the vocabulary differs". It is not
uniform. It is three implementations, one per place, and the weakest of them is the one that ships.

The parity gap

Test-Frontmatter.sh star lint markdown today
Required fields title; type as well for catalogue documents title, description, hard-coded at provider.go:799
Document families Two, discriminated by type, plus CATALOGUE_PATHS to pin a tree None — every file, one rule
Status vocabulary 5 working, 9 catalogue, and the Superseded by <ref> shape None — status is not a recognised field
Type vocabulary 17 values None
Exemptions .github/frontmatter-exempt, explicit by design None — no allowlist, no opt-out, no path exclusion
Enumeration git ls-files '*.md' — tracked files file.find('**/*.md') — gitignore-filtered walk
Tests — Zero. No _test.go in the repository mentions frontmatter

Defects found while measuring the gap

  1. It is not a YAML parse. Field presence is strings.HasPrefix(strings.TrimSpace(line), field+":")
    over \n-split lines (:819-820). A bare title: with no value satisfies the check, as does a
    nested key named title: inside another mapping.
  2. The closing delimiter is not anchored to a line. strings.Index(content[4:], "\n---") at
    :811 — a thematic break in the body ends the frontmatter region.
  3. An empty file set is a pass. provider.go:168-170 returns Passed: true for zero files, and
    the Starlark layer short-circuits green at lint-markdown.star:47-49. This is the same
    silent-pass shape docs/plans/shell-lint-via-star.md step 3 flags for lint.Shell.
  4. A dead config key ships. star setup config seeds markdown.frontmatter.required: [title, description] into star/config.yaml (cmd/star/provider/setup/provider.go:336-353). Nothing
    reads it — it is absent from the extension schema and from checkFrontmatter.
  5. Two more declared-but-unread keys. lint.markdown.path and lint.markdown.exclude are in the
    config: block (com.noblefactor.star.LintMarkdown/extension.yaml:22-34) and have no reader;
    collect_files consults no config at all.
  6. Two call sites pass the wrong keyword. HookPreCommit/commands/hook-pre-commit.star:103 and
    HookPrePush/commands/hook-pre-push.star:103 call lint.markdown(path=".", fix=False), but the
    binding is {"files?", "fix?=false"}. Same defect class as shell-lint-via-star.md:21-25
    documents for lint.go and lint.shell in the same two files.
  7. CRLF is half-handled. :807 accepts ---\r\n, then :811 and :816 use a fixed offset of 4,
    which is the LF delimiter's length.

The trap this must not fall into

Pointing a repository's CI at star lint markdown before parity would make its gate quietly weaker:
no exemptions honoured, no vocabulary enforced, and an empty discovery set green. That is exactly
what docs/plans/shell-lint-via-star.md:59-67 exists to prevent:

Step 8 last, and only after 4. Deleting the script before discovery is fixed would silently
drop .githooks/pre-commit — a live, tracked, extensionless script that shell-lint.sh lints
today and star lint shell does not — from every check. That is the invisible-removal pattern this
campaign exists to stop.

shell-lint-via-star.md is the pattern document for this migration and should be read before the
design: parity and fixtures first, the swap second, the shell script deleted last; CI invokes
./build/star lint <thing> <path> directly while make is the hook entry point; and an empty set, an
unparseable report or a missing tool must be an error rather than a pass.

Work

The design is deliberately not settled here. Ruled 2026-09-23: it is worked out once
noblefactor-ops#231 lands, so that the
shell gate is honest while this runs, and so the design review can take in the command hierarchy as a
whole rather than one command. 2026-10-19: #231 is now the script's deletion, so the design no longer waits on it.

What the design must decide:

  • Whether the frontmatter check stays inside lint markdown or becomes its own command, and what
    that implies for the star <service> <resource> <verb> grammar.
  • How the vocabularies stop being hard-coded. Test-Frontmatter.sh already admits the duplication in
    its own comment — "the five statuses docs/plans/TEMPLATE.md lists … Change them there first, then
    here" — and moving it into Go unchanged only relocates the second copy.
  • How .github/frontmatter-exempt survives. Its explicitness is the design, not an accident:
    "a file lacking frontmatter is a decision, and decisions belong somewhere a reviewer can see them."
  • Which config surface carries it. cmd/star/config/config.go:4-9 reads <git root>/star/config.yaml
    then ${XDG_CONFIG_HOME}/star/config.yaml; ~/.config/devlore/config.d/star.yaml is not read
    by this path, despite what the global --config help text suggests.
  • Whether enumeration becomes git ls-files, stays a gitignore-filtered walk, or is configurable —
    the two disagree on tracked-but-ignored and untracked files.
  • The command-hierarchy review this is the occasion for, including the LintStarlark hole
    docs/plans/lint-starlark.md:61-64 names.

It is a header lint, and its peer is lint.copyright

Observed 2026-09-24. The check is filed under lint.markdown, beside markdownlint, and that is the
wrong neighbor. It has nothing to do with markdown syntax. It asks the question lint.copyright
asks: does every file of this kind carry a well-formed header of this shape?

lint.copyright Test-Frontmatter.sh
Subject a header at the top of a file a header at the top of a file
Scope tracked files, by type git ls-files '*.md'
What is valid patterns per file type: regex match and replace required fields, plus the status and type vocabularies
Exemption exclude: []string, in config .github/frontmatter-exempt, one path per line
Vocabulary lives in config — CopyrightConfig: license, holder, patterns code — readonly VALID_STATUS_CATALOG=(...) in bash arrays
--fix yes no
Shape embedded extension over a Go provider a 148-line bash script in one repository

lint.copyright is the frontmatter checker done properly. Same job, expressed as configuration
rather than as shell arrays, with a fixer and a provider behind it.

Three consequences for the work above, none of them settled:

It wants to be its own command. star lint frontmatter, beside star lint copyright, rather
than a check hiding inside lint.markdown. A caller who wants headers validated should not have to
run markdownlint to get it, and lint.all reaches both either way.

The vocabularies belong in config. Test-Frontmatter.sh admits the duplication itself, above its
status array: "the five statuses docs/plans/TEMPLATE.md lists and docs/guides/development-process.md
draws (#219). Change them there first, then here."
A FrontmatterConfig carrying the two families,
their status vocabularies, the type vocabulary and the exemption list removes the second copy — the
same move CopyrightConfig already made for headers.

--fix becomes conceivable. A missing title cannot be invented. But a status of Approved
where the working family wants approved is mechanically fixable, and that is the same class of
repair as the copyright updater's "update old format".

This does not change what the check must enforce — the parity table above still governs — only where
the command sits and where its vocabulary lives.

Plan and design documents

Kind Document
Plan arrives with the branch
Design docs/plans/shell-lint-via-star.md — the migration pattern, and its ordering discipline
Design docs/plans/lint-gate-verdict.md — CI invocation form, and the no-silent-pass rule
Design docs/plans/lint-starlark.md — naming and placement in the Lint* extension family
Design noblefactor-ops documentation-standards.md — the standard to reach
Design noblefactor-ops#231 — the shell gate is deleted (repurposed 2026-10-19)
Design noblefactor-ops#152 — the portable-tooling thread

Activity

  1. David-Noble-at-work commented on Sep 28, 2026

    @David-Noble-at-work
    ContributorAuthor

    Two checks this lane owes beyond the frontmatter standard

    Ruled 2026-09-28, recorded here because this is the lane that carries FrontmatterConfig and so is
    where a document rule gets a gate.

    1. The status vocabulary

    Five statuses are fixed by
    noblefactor-ops#219: draft, approved,
    active, complete, abandoned. Measured across this repository's docs/plans/ on 2026-09-28,
    counting both the frontmatter field and the **Status:** line some documents restate it on,
    21 distinct words are in use:

    Word Occurrences
    valid complete 161
    valid draft 64
    valid active 10
    valid abandoned 1
    valid approved 0
    invalid in-progress 34
    invalid charter 13
    invalid proposed 5
    invalid settled, completed, not-started 2 each
    invalid ready, pending, in, done, closed, deferred, design, implemented, design-solidified, chartered, re-chartered 1-2 each

    #219 retired in-progress by name. It has been written 34 times since. approved -- the one status
    meaning a human reviewed the document -- appears nowhere. status: in is a truncation nobody caught.

    No sweep. Ruled the same day: "we'll deal with these as we encounter them." The existing ones are
    corrected when a document is touched for another reason. The check stops new ones.

    2. The plan-path rule

    development-process.md
    states it:

    The plan's path below docs/plans/ is therefore its branch's name exactly, so neither can be searched
    for without finding the other, and the issue number is visible in both.

    Three checks fall out of that, and the third is the one that catches live drift:

    1. The path below docs/plans/ is <type>/<issue>-<name>.md, <type> from the ruleset alternation.
    2. <issue> is a number.
    3. The issue: frontmatter field's number equals the <issue> in the path.

    Measured 2026-09-28: personal and noblefactor-ops are 72 of 72 conforming, path and frontmatter
    agreeing in every case. This repository is 284 of 328 off-scheme -- binding-unification/phase-3.md
    and its like -- which the process document names directly: "A plan named for its subject rather than
    its issue is reachable only by someone who already knows what it is called."
    Most predate the rule, so
    that is history rather than fresh breakage, and the same no-sweep ruling applies.

    The rule was nearly broken on 2026-09-28 by a script that built docs/plans/fix/$branch.md when
    $branch already carried its type segment. Nothing would have reported it; the script happened to check
    that the file existed and threw. See NobleFactor/noblefactor-engprod#145 for why that class keeps recurring.

  2. David-Noble-at-work commented on Nov 9, 2026

    @David-Noble-at-work
    ContributorAuthor

    star github triage sweep added this issue to Triage: devlore, for the rules it breaks:

    • severity: a Bug whose Severity is blank; a bug is Critical, High, Medium or Low
    • no-evidence: no Evidence of completion section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions