Engineering standards and laws
The mainframe adopts the Pax Agentica constitution as binding: laws.md, copilot-instructions.md and the per-language standards under instructions/. This page records what that means, and what currently does not comply.
The laws
Eleven laws. The four that change daily practice here:
- Law 3 - lower level first. Terminal work uses bash and GNU tools. When a script outgrows bash, use bun. Agent scripts belong in
.github/scripts/. - Law 4 - no Python. Never, for anything, ever. This is the law with the largest current debt in the estate.
- Law 5 - no emoji, no em-dash, no fancy unicode. Use
[x]not a tick character, and a hyphen not an em-dash. - Law 10 - no node, npm, npx or yarn. Bun is the equivalent tool in all cases.
Two more that change how work is delegated and scoped:
- Law 7 - use subagents whenever possible. The agent system is hierarchical by design; lead agents decompose and delegate.
- Law 6 - do not modify agents or specs without explicit permission. Ask before self-modifying.
Law 11 requires steel-manning the sandbox's intent and never deviating from it. Where a law appears to conflict with local practice, the resolution is to surface the conflict, not to quietly pick a side. That is why this page exists.
The standards
Each standard declares a scope via applyTo, so the correct one is unambiguous at the point of work.
| standard | applies to | headline rules |
|---|---|---|
| bash | **/*.sh | #!/usr/bin/env bash, set -euo pipefail, local camelCase, UPPER_SNAKE globals, no function keyword, quoted expansions, $(...) over backticks |
| rust | **/*.rs, Cargo files | edition 2024, no nightly, safe Rust by default, bounded async, container-only verification |
| markdown | all .md | lint-clean at creation, ` |
| makefile | Makefile | lowercase everything, .PHONY on all targets, orchestrates docker rather than building |
| js | **/*.js, **/*.ts | Bun not Node, const by default, ES modules, pino for logs, UI and automation only |
| html | markup | React shop; semantic and accessible; raw .html kept minimal |
| dockerfile | **/Dockerfile | lowercase, multi-stage, digest-pinned, port 80 for first-party, non-root |
| commit-messages | commits | conventional commits, non-technical summary, changed files listed individually |
Two boundaries in the standards matter more than the style rules, because they forbid whole categories of work rather than prescribing its shape:
- Bash must not implement backends. Bash orchestrates tools and containers. First-party backends are Rust.
- JavaScript must not implement backends. JS and TS are browser UI, UI prototypes and Bun automation.
So a service is never "a shell script plus some glue". The shell orchestrates, the Rust backend implements, and the standards are explicit about which side of the line a given file sits on.
Change lists
Every non-draft document carries a changes list in its front matter: date, ticket, description and agent, newest first. HITL is the ticket value for human-requested work outside a ticket. New documents record init. Existing documents without a change list are left alone.
This page complies. So do the loadout registry and the registry methodology page.
Compliance gap analysis
Measured against the live estate on 2026-10-06. This is the honest position, not the aspirational one.
| law or standard | current state | severity |
|---|---|---|
| Law 4 - no Python | build-pack.py, index-mainframe.py, ascii-banners.py, generate-diagrams.py, generate-plantuml.py, generate-pack-diagrams.py are first-party Python. 3,127 .py files estate-wide, the large majority vendored upstream (mainframe-terminal bundled skills, wazuh forks) | high for first-party tools |
| Law 10 - no npm | the docs site builds with npm run build on host Node | high |
| Law 3 - bun | bun is not installed on the host, so the sanctioned replacement runtime for non-trivial scripting is unavailable | blocking |
| Law 5 - no emoji or em-dash | the published docs use emoji status markers and em-dashes throughout; interfaces/registry.yaml carries emoji icons | medium, cosmetic debt |
| bash standard | collect-registries.sh complies: shebang, set -euo pipefail, camelCase locals, UPPER_SNAKE globals, no function keyword, quoted expansions | compliant |
| bash standard - no host tools | /usr/bin/yq on this host is yq 3.1.0, a Python script. It is used only as jq-over-YAML | grey area, flag it |
The yq problem, stated plainly
collect-registries.sh needs to read YAML. The available tool is a Python program. That is a real tension with law 4 and it is recorded rather than hidden. Three resolutions, in preference order:
- Move the collector to bun. This is what law 3 prescribes for logic bash cannot express cleanly, and YAML parsing is exactly that. Blocked only on bun being available in a pinned container.
- Keep registry sources as YAML and read them with a non-Python parser, if one can be pinned into the verification image.
- Note and accept as a documented exception with an owner and an expiry, which the rust standard already permits for narrowly scoped cases.
Option 1 is the intended path. It is not taken yet because installing host tooling is itself forbidden by the bash standard, so bun must arrive via a pinned container image.
Migration plan
- Get bun into a pinned container. No host installation. Establish the verification image the bash standard requires.
- Port the six first-party Python tools, highest value first: the pack builder, then the registry indexer, then the generators. Bash where it fits, bun where it does not.
- Move the docs build off npm.
npm run buildbecomes a bun invocation in the same container. - Vendor-versus-first-party triage. The 3,127
.pyfiles include upstream forks and bundled skills that are not ours to rewrite. Classify them, then record the boundary so law 4 applies to first-party code only. - Emoji and em-dash debt. Existing content is not swept: the markdown standard says write it right at creation, do not re-lint after the fact. New and edited content complies going forward.
Step 1 and step 3 both touch markdoc, which is the documentation pipeline itself, and step 2 touches generated artefacts the pack depends on. Both need explicit permission under law 6 before they are started.