Skip to main content

Module gates

Module gates 

Source
Expand description

The delivered gates: every check an instance wires as a pre-commit hook.

This module owns the registry — identity, display name, hook wiring, citable rules, and implementation for each gate — so a gate cannot exist unwired: the exhaustive match over GateId is the declaration. Gate implementations live one per file below; rendering the registry into pre-commit YAML and running one gate from the command line live in services and commands.

Modules§

adr_cites_a_live_rule
Gate: a record’s Enforced by line names rules the specs still define.
adr_filename_shape
Gate: a record filename is ADR-<slug>.md, and the slug carries no digit.
adr_word_cap
Gate: a decision record’s body stays within 350 words, or within the ceiling its project recorded for it.
agents_digest_size
Gate: agent digests stay within their line budgets, or within the ceiling its project recorded for one.
budget
What every budget gate does once it has measured: read the debt, judge each measurement against its ceiling or its budget, and report the entries the measurements no longer support.
chapter_size_cap
Gate: a chapter stays within its line cap, or within the ceiling its project recorded for it.
comparison_dated_tables
Gate: a comparison document carrying tables carries a verification date.
comparison_escaped_pipes
Gate: a pipe inside a comparison cell’s code span is escaped.
comparison_legend
Gate: a comparison document carrying tables carries a legend.
comparison_one_reference_per_cell
Gate: a comparison cell carries at most one reference.
comparison_verdict_word
Gate: every verdict symbol carries the word the legend gives it.
gate_message_cites_a_rule
Gate: every rule ID a gate can print resolves to a requirement in the local specs.
instance_manifest
Gate: the instance manifest is present and fits the schema.
ki_bugzilla_report_width
Gate: a Bugzilla report body fits in 79 columns.
ki_checked_date
Gate: a record whose handling depends on an upstream state carries the date that state was last confirmed, and no other record carries one.
ki_filename_shape
Gate: a case id is KI-<slug>.md, and the slug is not a counter.
ki_filing
Gate: a known-issue record carries one filing state.
ki_mechanism_walkthrough
Gate: every known-issue record walks its mechanism step by step.
ki_record
What every known-issue gate reads: a record’s one-word axes.
ki_report_body
Gate: a filed known-issue record carries the body it was filed with, and the issue it was filed as.
ki_retire_when
Gate: a masked known-issue record carries the condition under which it is removed, and a mitigated one carries none.
ki_state
Gate: a known-issue record carries one state.
markdown_prose
Shared markdown structure for the prose gates.
no_personal_path
Gate: a document carries no path into a person’s home directory.
no_self_narration
Gate: a document states what is true now.
paths
Where an instance keeps the documents the gates read.
prose_stays_unwrapped
Gate: prose stays unwrapped — a paragraph is one source line.
spec_change_is_typed
Gate: a spec change an entry document cites carries a well-formed clause.
spec_requirement_parts
Gate: every requirement in a spec is a rule ID heading that owns exactly one verification.
spec_rule_id_unique
Gate: a rule ID resolves to exactly one requirement across the project.
spec_size_cap
Gate: a spec stays within 300 authored lines and carries a TOC above 100, or within the ceiling and exception its project recorded for it.
spec_verify_hooks_exist
Gate: every rule whose verification runs a hook names a hook that is still defined.
suppression_names_its_case
Gate: a cited known-issue case resolves to a record.
tracking_registry
Gate: the tracking registry is valid, current, and its dependents exist.

Structs§

GateCtx
Where a gate runs: the repository root pre-commit invoked it from, and the subject filter that bounds what it judges there.
GateSpec
One registry row: everything the deliveries need to know about a gate.

Enums§

GateError
A gate that could not run at all — distinct from one that found violations.
Violation
One line a failing gate prints.

Constants§

PRUNED_DIRS
The directories every repository walk prunes: vendored or generated trees a consumer cannot be asked to author.

Statics§

GATES
The delivered gate set, in GateId::ALL order.

Functions§

front_matter_values
Every value a front-matter key carries, in the order the keys appear.
line_count
Count the newline-terminated lines of a text, as wc -l does.
read_text
Read a repository-relative text file for a gate.
spec
Look up one gate’s registry row.
walk_files
Walk the repository and yield every file as a ./-prefixed repository-relative path in sorted order.

Type Aliases§

GateFn
The implementation shape shared by every gate.
GateResult
What every gate returns: the violations it found, or why it could not run.