Skip to content

Quality Assurance

The provisioning repository enforces code quality and prose hygiene through a suite of automated, vendored Python tools integrated directly into the Git pre-push workflow. These checks ensure that hand-authored code remains modular, documentation remains free of AI-generated artifacts, and branching conventions are strictly maintained. The gates operate locally before any changes are transmitted to remote repositories, providing immediate feedback to engineers.

To prevent code bloat and encourage modular design, the repository enforces a strict line-count ceiling on hand-authored code files. This check is implemented in tools/check_file_ceiling.py and is executed as part of the pre-push hook 1.

The gate applies to specific programming languages identified by file extension, including Python, Go, JavaScript, TypeScript, Astro, Shell, CSS, and HTML. Files are excluded from this check if they are binary, generated, or part of standard dependency lockfiles (e.g., package-lock.json, go.sum). The line count is calculated using the formula n_lines = text.count("\n") + 1.

Any hand-authored code file exceeding 1000 lines causes the check to fail with a non-zero exit code, listing the offending files sorted by size. There is no grandfathering or allowlist; files must be refactored into smaller modules to pass.

diagram

The repository bans specific markers of AI-generated prose to maintain a consistent, human-authored documentation style. This is enforced by tools/check_prose_hygiene.py, which scans tracked text files for em/en-dashes, decorative emoji, and stock AI-speak phrases 2.

The gate supports two modes: a default check mode that fails if violations are found, and a --fix mode that automatically replaces em/en-dashes with hyphens and removes decorative emoji. AI-speak phrases are reported for manual rewording and are not auto-fixed. A file can opt out of these checks by including the marker prose-hygiene: allow.

These quality checks are integrated into the repository’s Git pre-push hook located at .githooks/pre-push 3. This hook runs locally before any push is accepted, ensuring that code and prose standards are met before they reach the remote repository.

The hook first executes the file ceiling check. If any file exceeds the 1000-line limit, the push is aborted with an error message instructing the engineer to split the file. Next, it runs the prose hygiene check. If violations are detected, the push is blocked, and the engineer is instructed to run the --fix command and manually reword any AI-speak phrases.

Additionally, the pre-push hook enforces branching conventions by blocking pushes of the dev branch to the public remote, ensuring that only main is published. This ensures that the public-facing codebase remains clean and adheres to the established quality gates.