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:

  1. 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/.
  2. Law 4 - no Python. Never, for anything, ever. This is the law with the largest current debt in the estate.
  3. Law 5 - no emoji, no em-dash, no fancy unicode. Use [x] not a tick character, and a hyphen not an em-dash.
  4. 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.

standardapplies toheadline 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 filesedition 2024, no nightly, safe Rust by default, bounded async, container-only verification
markdownall .mdlint-clean at creation, `
makefileMakefilelowercase everything, .PHONY on all targets, orchestrates docker rather than building
js**/*.js, **/*.tsBun not Node, const by default, ES modules, pino for logs, UI and automation only
htmlmarkupReact shop; semantic and accessible; raw .html kept minimal
dockerfile**/Dockerfilelowercase, multi-stage, digest-pinned, port 80 for first-party, non-root
commit-messagescommitsconventional 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:

  1. Bash must not implement backends. Bash orchestrates tools and containers. First-party backends are Rust.
  2. 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 standardcurrent stateseverity
Law 4 - no Pythonbuild-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 npmthe docs site builds with npm run build on host Nodehigh
Law 3 - bunbun is not installed on the host, so the sanctioned replacement runtime for non-trivial scripting is unavailableblocking
Law 5 - no emoji or em-dashthe published docs use emoji status markers and em-dashes throughout; interfaces/registry.yaml carries emoji iconsmedium, cosmetic debt
bash standardcollect-registries.sh complies: shebang, set -euo pipefail, camelCase locals, UPPER_SNAKE globals, no function keyword, quoted expansionscompliant
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-YAMLgrey 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:

  1. 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.
  2. Keep registry sources as YAML and read them with a non-Python parser, if one can be pinned into the verification image.
  3. 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

  1. Get bun into a pinned container. No host installation. Establish the verification image the bash standard requires.
  2. 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.
  3. Move the docs build off npm. npm run build becomes a bun invocation in the same container.
  4. Vendor-versus-first-party triage. The 3,127 .py files 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.
  5. 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.