Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript
7.3 KB
Raw Blame
---
description: Local Minikube T0/T1/T2 certification contract — entry points, what counts as a T2 verdict, profile ownership, and evidence rules
alwaysApply: true
---

# Local Minikube T0/T1/T2 contract

Development-only. Requires a clean branch descended from `origin/dev`, the
branch-owned `MINIKUBE_PROFILE`, and an explicit Kubernetes context. Never a
production/GKE/Cloudflare/staging runbook. `evenfire-infra` is a different
repository — never mix its PRs or clusters into this lane.

## Entry points (only these)

- `make minikube-t2-preflight` — read-only planner. NOT T0/T1/T2. Default
  `T2_PLAN_MODE=false` fails loud (`BOOTSTRAP_REQUIRED`) on an unbootstrapped
  profile and never calls `pre-gate-sync`.
- `make minikube-t2` — full orchestrator: T0, planner (`T2_PLAN_MODE=true` so
  `full-bootstrap` is reachable), bootstrap/reconcile, T1, then the T2 verdict.
- `make minikube-t2-runtime` — closes T2 only (`T2_RUN_T0=false T2_RUN_T1=false`)
  when T0 and T1 are already green on the same HEAD and the pre-gate marker is
  `already-synced`. Never use those flags to skip an uncertified lane.

## What T2 is / is not

- A T2 verdict is ONLY the final exact-head preflight inside `make minikube-t2`
  or `make minikube-t2-runtime`: it runs with `T2_PLAN_MODE=false` and the plan
  state must be `already-synced`, ending in `MINIKUBE_T2_PASS` with
  `T0=`/`T1=`/`T2=` statuses.
- `T2_PREFLIGHT_PASS` from the standalone planner is NOT T2.
- `make minikube-pre-gate-sync` is NOT T2.
- Product E2E scripts (e.g. `scripts/e2e/e2e-hcc-rollout-readiness.sh`), CI,
  unit suites, and Playwright are separate lanes; none stands in for T2.
- Health is mandatory and bounded for `targeted-sync` via
  `T2_HEALTHCHECK_COMMAND`. After `T2_PREFLIGHT_PASS` the orchestrator still
  fail-louds `PROFILE_UNHEALTHY` if that command is unset — planner PASS is
  not T2. Health stays opt-in for bootstrap, full reconcile, and
  already-synced. Playwright is opt-in via `T2_PLAYWRIGHT_COMMAND`
  (`T2_REQUIRE_PLAYWRIGHT=true` refuses `NOT_RUN`).

## Branch-profile UI port-forwards

First-hand: `scripts/minikube-profiles/branch.mk`.
Implementation: `branch-profile.sh` in that directory. HARD DENY:
`ls`/`cat` `~/.cache/clerum/minikube-profiles/`.

```bash
MINIKUBE_PROFILE=<owned-profile> \
  make -f scripts/minikube-profiles/branch.mk branch-profile-pf
MINIKUBE_PROFILE=<owned-profile> \
  make -f scripts/minikube-profiles/branch.mk branch-profile-health
```

Host-side hold for Control UI / Desktop. Profile-owned random ports only
(never `:3000` / `:8090`). Run on the host, not a sandboxed agent shell:
`make ... branch-profile-pf` that prints `PF` lines and exits 0 can still
leave registered-but-dead pidfiles when the runner reaps `nohup kubectl`
children. The planner then fail-louds `PORT_FORWARD_CONFLICT` +
`DEVELOPMENT_SCOPE_REQUIRED` **before** a transition.
`T2_PORT_FORWARD_COMMAND` does not skip that pre-transition check. Restore
with a lasting host `branch-profile-pf` + `branch-profile-health`, then
re-enter `make minikube-t2`. Not a new profile. Do not `ls`/`cat` the cache.
`make minikube-pf-all-bg` is a gate refresh only — it does not replace
`branch-profile-pf`. Do not kill this lane's forwards.
`branch-profile-pf-health` stops PFs on EXIT. Inner `pre-gate-sync` may use
`--skip-port-forwards`; never pass that globally into `make minikube-t2`.
`pre-gate-sync` can restart every deployment and leave the hold bound to
terminated pods: run `make minikube-t2` on the host with
`T2_PORT_FORWARD_COMMAND` set to the `branch-profile-pf` command; T2 runs it
once after an in-run sync, before Health/Playwright (`PortForwards=` evidence).

## Profile and evidence

- Reuse the owned `MINIKUBE_PROFILE`; do not create a new profile because HEAD
  changed. Never touch another worktree's profile or its port-forwards.
- Every `kubectl` uses `--context=<owned profile>`; never switch the global
  current-context.
- Bootstrap/reconcile must build the worktree: `IMAGE_SOURCE=local`.
- T1 is fail-loud: unavailable DSN or zero executed tests is FAIL, never green.
 The JSON reporter must be complete and green and the Vitest process must also
 exit zero. Role-reset suites use the throwaway `postgres:16-alpine`, never
 shared `control-postgres`.
- A T1 `next:` line or `REAL_PG_REQUIRED_BUT_UNAVAILABLE` is not a Docker
  license. Do not `docker run` probes, `docker desktop restart` (destroys the
  Minikube container), or experiment with published ports. Re-enter
  `make minikube-t2` or `make minikube-t2-real-postgres` on the owned profile.
- Self-healing single run: the orchestrator planner (`T2_PLAN_MODE=true`)
 selects `full-reconcile` (naming the deployment) for a bootstrapped profile
 with an unready required deployment — never `PROFILE_UNHEALTHY` before a
 transition. Standalone preflight and the final exact-head check stay
 fail-loud. T1 restores branch-profile GFS credentials on exit, and
 `pre-gate-sync` provisions GFS serving with `GFS_RESTORE_ACTIVE_NOLOGIN=true`
 and `GFS_RECOVER_ABANDONED_STATE=true` only in the `minikube-t2` transition;
 other security gates refresh MCP auth with `--skip-gfs` and do not mutate GFS,
 so no manual repair script sits between plan and verdict.
 `settle-gfs-reader-rollout.sh` clears
 Ready-reader leftovers (claim, stale ReplicaSets, CrashLoopBackOff pods)
 first, and the `gfs-rollout-shim` PATH prefix replaces the reader
 `rollout status` wait with a readiness poll because HCC's gfsReconciler
 now preserves `restartedAt`; leftover ReplicaSets can still poison a
 generation-based wait, so the harness still judges reader readiness.
- Evidence lives under ignored `.local-notes/infra/runs/`; never commit it.

## Host npm vs cluster Ready

`[real-pg-preflight] PASS ... packages=2` only proves host `vitest`+`pg` in
`control-api` and `gfs-controller`. It does **not** cover `pre-gate-sync`
`run_if_changed`. `sh: vitest: command not found` +
`make[1]: *** [minikube-pre-gate-sync] Error 127` after `T2_PREFLIGHT_PASS`
and Ready deployments is a host `npm ci` gap in the named directory — not
GFS, not a new profile, not `REAL_PG_SUITE_FAILED`. Cluster Ready ≠ host
runner. `run_if_changed` dirs: `packages/workflow-runtime-core`,
`packages/network-policy-core` (`node --test`), `control-api`,
`external-rest-api`, `rpc-proxy`, `mcp-host`, `host-context-controller`,
`workflow-recipes`, `packages/workflow-sdk`,
`workflow-approval-request-reader`, `control-ui`, `desktop-app` (Node 24 +
`verify:electron`; no `--ignore-scripts`). `gfs-controller` is not on that
list. `npm ci` the named dir **and every remaining** package that declares
dependencies but has no `node_modules` (zero-dependency `node --test`
packages legitimately have none), then re-enter `make minikube-t2` on the
same HEAD/profile. `PROFILE_METADATA_MISSING` surfaces as
`PROFILE_OWNERSHIP_MISMATCH`: restore `profile.env` or stop and ask
(`scripts/minikube-profiles/branch.mk` never regenerates metadata for an
existing profile directory), never invent ports. A never-created profile
has no directory: run `branch-profile-start` (an explicit `MINIKUBE_PROFILE`
must equal this branch's derived name), then retry. Do not edit tracked files while `make minikube-t2`
is running: T0 fixtures fail with `fixture mutated the host checkout
working tree`, and T2 refuses a dirty tree (`DEVELOPMENT_SCOPE_REQUIRED`).

Full workflow: skill `.cursor/skills/minikube-t0-t1-t2/SKILL.md`.
Deep contract: `docs/testing/minikube-t2-runbook.md`.