# 03 — The owned disciplines, in depth

The five topic areas this site owns outright, each with its position, its best verbatim material, and its honest counter-evidence. These become the site's core pages; `01__` gave each a summary, this gives the substance.

---

## 1. Testing

**The four non-negotiables, verbatim:**

> 1. **No mocks. No patches.** Use `register_playwright_service__in_memory()` and `in_memory_stack`-style composition.
> 2. **Assert on contracts** — schemas, status codes, persisted artefacts — not implementation details.
> 3. **Real Chromium for integration tests.** Gate on `SG_PLAYWRIGHT__CHROMIUM_EXECUTABLE`; skip cleanly when absent.
> 4. **Deploy-via-pytest.** Deploy tests are numbered (`test_1__create_lambda`, `test_2__invoke__health_info`, …) and run top-down.

**Why no-mocks is affordable here and not elsewhere:** `Type_Safe` objects are cheap to construct, and every service has an in-memory composition path — so the real thing is as easy to instantiate as a mock would be. The philosophy and the type system are one decision. The proof: **4,785 tests in 81 seconds.**

**The structural-guard pattern** — CI tests that enforce architecture rules rather than behaviour (`object = None` banned, UI-in-the-wheel, component snapshots) — with the rule that makes the set healthy: **every guard encodes a rule that was violated at least once.** Grown from incidents, not checklists.

**Counter-evidence to publish:** CI runs 67.4% of collectible tests; six import-level breakages hide in the un-run third; one guard has never worked; three tests fail on date arithmetic. All measured, all in the sg-compute pack.

## 2. CI pipelines

The pattern, distilled from the 36,815-byte pipeline: **build once, verify before naming.** Native per-arch builds → **push by digest only** → integration-test the *pre-tag* image → only then combine digests into a manifest and tag. Nothing gets a name until it has passed as an anonymous digest.

Same shape one level up: the AMI bake **relaunches from the baked image and re-verifies** before tagging `healthy` — the artefact must prove itself twice, once as built and once as booted.

Versioning: one repo-root `version` file, auto-incremented by branch policy (dev bumps minor, main bumps major), read at runtime, used as the image tag. **One source, many consumers, no drift** — and the counter-evidence is `sg_compute/version`, a second version file read by nothing.

## 3. Documentation and the reality system

The governing rule, which is the estate's single best NFR idea:

> *"**If the reality document doesn't list it, it does not exist.** … **Briefs are aspirations, not facts.**"*

With its supporting disciplines: `PROPOSED` labels on unbuilt features · the markdown twin · day-indexes closing *"all documents are em-dash-free and released under CC BY 4.0"* · debriefs classifying failures as good-failure/bad-failure · the session-handover guide (*"Don't improvise"*).

**The full honest story:** the system exists, 72,339 words across 12 domains — and the index was 41 versions stale while the README described a repository that does not exist. **The rule is right and enforcement is manual**, which is the same finding as the coding pack's: discipline without tooling is real but fragile. The page should propose the fix the estate would recognise: a reality-doc freshness check in CI, exactly like the licence audit.

## 4. Budgets and finance

Three pillars, all publishable as discipline (never the estate's own figures):

**Profitability-first** — *"until we know the traction, the product lines, the services, the cost lines, and what users actually buy, financial projections and future predictions are made-up… The path is to discover the market and ship quasi-daily; investment only accelerates the path to profitability."* The Explorer-phase corollary: do not build Town-Planner financial artefacts on hypothesis.

**Pre-approve the ladder** — the overrun positions approved at approval time, the kill point *"named while it is still cheap to name"*, value milestones and sponsor probabilities recorded as a calibration record, grounded in the escalation literature (*"the person who approved the first million is, on the evidence, the worst available decider on the second"* — with the preregistered finding that a public conditional pledge makes stopping *raise* trust). Plus the original move: **opportunity cost as a first-class acceptance, with an owner.**

**Budget-on-the-step** — budgets attached to workflow steps rather than projects, so containment is structural.

## 5. Project management

Two layers. **The position:** *"the project manager is where the register becomes work"* — a register per project, net score, erosion, the missing reference class; risk management and project management as one discipline with two vocabularies.

**The demonstrated system:** the estate's own way of working *is* its PM methodology — briefs with acceptance criteria (the naming brief's nine, scored in the sg-compute pack), cross-team reviews the same day, numbered asks and tasks, version-prefixed filenames sorting chronologically, handover guides, and the good-failure/bad-failure debrief convention. Roughly 4,000 documents of it. **No page anywhere describes it as a system.** Writing that page — "how a brief becomes work here" — is this site's most original PM contribution, and it doubles as onboarding for every new agent session.

---

This document is released under the Creative Commons Attribution 4.0 International licence (CC BY 4.0).
