Page 4 of 8~144 min topic

Capstone ops lab

Prove behavior with deterministic tests

Executable checks prove versioned release with readyz, flag kill switch, rotated secret, named on-call on fixtures — including the known misshape behind CAP-OPS-PKA-12.

~18 min this pageValidation

1Try it yourself

Decision drill

Capstone ops gate

Before demo day — metrics, flags, and recovery must be real.

Ship readiness50%

1/3Before demo day: latency + groundedness must page someone.

2Learn the idea

Read

Schema and policy checks

Add executable validation at the trust boundaries of Personal Knowledge Assistant API with flags, probes, secrets, on-call owner. Reject unknown fields where they matter, bound string sizes, and coerce only after auth/signature checks when raw bytes are security-relevant. Invariant under test: versioned release with readyz, flag kill switch, rotated secret, named on-call. A TypeScript type or Python annotation is not runtime validation — pair them with parsers.

Read

Golden and adversarial fixtures

Automate the fixtures from setup, including a recreation of CAP-OPS-PKA-12. Assert both the visible error and the absence of side effects (no provider call, no queue write, no flag flip). Where metrics matter, assert label enums stay bounded.

Read

Implementation artifact

test $(python secret_age.py openai/pka) -le 30

Read

Gate semantics

Document which failures are client mistakes (4xx) versus operator/config mistakes (5xx/503). Oracle still stands: ship v1.2.0: smoke+readyz pass; kill switch drill < 60s; on-call roster non-empty. Validation should make accidental “success with empty body” impossible for solo builder operating pka.example for 50 beta users.

Read

Stage depth

Property ideas: shuffled field order, Unicode edges, maximum-length strings, and replayed timestamps. Where money, identity, or citations matter, assertion messages should cite the field name. Do not snapshot entire provider payloads in tests; assert semantically. If validation fails open “to keep the demo working,” you have inverted the lab. Tie at least one CI job to the CAP-OPS-PKA-12 fixture so main cannot regress silently. Re-read versioned release with readyz, flag kill switch, rotated secret, named on-call after each new parser — convenience helpers love to bypass it.

Read

Field notes for `capstone-ops-lab` / `validation`

Table-drive status codes and error codes so reviewers see coverage at a glance. Include a Unicode normalization case if user text is accepted. Verify that oversized bodies fail before CPU-heavy work. Where digests or versions are pinned, assert mismatch behavior. Keep golden files small enough to read in review. CI should fail on skipped tests that mark the incident fixture as xfail without a ticket link. In this chapter the product is Personal Knowledge Assistant API with flags, probes, secrets, on-call owner, the human stakeholder is solo builder operating pka.example for 50 beta users, and the incident id you design against is CAP-OPS-PKA-12. Re-state the oracle in your notes — ship v1.2.0: smoke+readyz pass; kill switch drill < 60s; on-call roster non-empty — and keep the invariant visible: versioned release with readyz, flag kill switch, rotated secret, named on-call. Track readyz_ok, kill_switch_seconds, secret_age_days ≤ 30 as the scoreboard. Surface under change control: https://pka.example/v1/ask. If you only have forty minutes, finish the fixture for app runs on laptop only — no probes, no owner, secret in .env committed before polishing UI. Promotion language stays ternary: promote, hold, or roll back based on evidence, not hope.

Go deeper

Before you start

Why this matters

List three fixtures: one golden success, one schema/auth reject, and one regression for CAP-OPS-PKA-12. For each, write the exact assertion (status, code, metric, or citation) that must turn red if broken.

Capstone gold tests stay versioned beside the app so ship v1.2.0: smoke+readyz pass; kill switch drill < 60s; on-call roster non-empty remains reproducible.

In the wild

See how this idea shows up as a product and a company — then come back to the lesson. Skills transfer across vendors.

Check your understanding

Page assessment

Answer from memory. Completion is saved from this evidence, not from opening the next page.

1. Do parsers run before side effects?
2. Is CAP-OPS-PKA-12 represented as a fixture?
3. Are side-effect absences asserted?

All responses are required.