Notes

I stopped writing the code. I did not stop being the engineer.

Read as
working implementation · tests
Build treatmentUpdated 14 Jul 2026

Production AI systems · Operating model

What you will leave with

Create a bounded task brief, an isolated implementation lane, and a verifier that checks the deployed artifact.

For engineers setting up a repeatable agent-assisted delivery workflow.~4 min read
PrerequisitesGit repositoryNode 20+A staging URLCI that can run a script
01 · System view

What you will build

One small control loop with evidence at every boundary.

  1. 01BriefScope and acceptance contract.
  2. 02Worker laneA bounded implementation surface.
  3. 03CI wallType, test, build, drift, and permission checks.
  4. 04Staging deployThe real artifact, not a local assumption.
  5. 05CanaryScreenshots, links, and data freshness fail loudly.
02 · Implementation

Build it in sequence

01

Write the contract before dispatch

Make scope, exclusions, evidence, and stop conditions explicit. The worker may choose implementation details; it may not choose the product direction.

tasks/remove-fake-metric.mdmarkdown
# Outcome
Remove the fabricated engagement count from every article.

## May change
- Article UI and tests

## Must not change
- Published article copy
- Analytics configuration

## Evidence required
- Search returns zero matches for the old label
- Production build passes
- Staging HTML does not contain the fabricated count

## Stop and ask
- Any real count source is discovered
- Work requires a database or tracking change

Teaching template. The production repository stores the resulting implementation and evidence, not a reusable orchestration framework.

02

Give independent work an isolated lane

A worktree makes the ownership boundary physical. Parallel agents can run without sharing uncommitted files or silently overwriting one another.

terminalbash
git worktree add ../lane-remove-metric -b task/remove-metric
cd ../lane-remove-metric
npm ci
npm test
03

Run the same wall every change must pass

The production workflow does not stop at unit tests. It runs typechecking, tests, the framework build, duplication, database type drift, permission snapshots, and path-scoped end-to-end checks.

.github/workflows/ci.yml · public reconstructionyaml
jobs:
  verify:            # lint changed files, typecheck, tests, production build
  duplication:       # token-based copy-paste ratchet
  type-drift:        # rebuild schema and diff generated database types
  permission-snapshot: # prove protected grants remain denied
  e2e-filter:        # decide whether the full browser suite must run
  e2e:               # path-scoped end-to-end verification
04

Verify the deployed artifact with the real canary pattern

After a successful staging deploy, a separate workflow runs Playwright against staging. It checks screenshot baselines, link destinations, HTTP failures, gate misroutes, and freshness of live data.

.github/workflows/post-deploy-canary.yml · sanitized excerptyaml
name: Post-deploy Canary
on:
  workflow_run:
    workflows: ["Deploy Staging"]
    types: [completed]
jobs:
  canary:
    if: github.event.workflow_run.conclusion == 'success'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npx playwright install --with-deps chromium
      - run: npx playwright test --config playwright.canary.config.ts
05

Make the canary fail loudly on the wrong surface

The helper treats a 4xx response or a bounce to the staging share gate as a failed release. It never screenshots the password page and reports green.

tests/canary/helpers.ts · sanitized excerpttypescript
export async function gotoGated(page: Page, path: string) {
  const response = await page.goto(path, { waitUntil: 'networkidle' })
  const status = response?.status() ?? 0

  if (status >= 400) {
    throw new Error(`Canary: ${path} returned HTTP ${status}`)
  }

  if (new URL(page.url()).pathname === '/staging-gate') {
    throw new Error('Canary: share-gate cookie was not honoured')
  }
}
03 · Review

Definition of done

  • The task says what is out of scope.
  • The worker runs in an isolated lane.
  • CI checks the implementation.
  • A separate script checks staging.
  • The evidence step fails when the old behaviour is reintroduced.
04 · Failure modes

What breaks and what it means

The verifier passes locally but fails in CI.

Log the resolved URL and status. Deployment hooks often provide a preview URL, not the canonical domain.

The page is cached.

Assert a build-specific marker or add a cache-busting query; do not weaken the check to “eventually maybe.”

Public discussion

Questions, corrections, and useful disagreement

Moderated on GitHub ↗

Sign in with GitHub to join the conversation. Comments are public. Article views are anonymous and counted once per browser, per article, each day.

Read next02

I built a check, and the first thing it caught was me

I turned one rule I only enforced by discipline into a gate that fails the build. The first thing it caught was my own half-finished work.

3 depths