Skip to content

ci(doop): train S6 — drill mode, authorization and fault injection (CHE-5552) [squash] - #105

Draft
congvc-bot-x99[bot] wants to merge 22 commits into
cheese/mainfrom
agent/x99-claude-sonnet-200k/che-5552-3914c80db5f6
Draft

congvc-bot-x99[bot] wants to merge 22 commits into
cheese/mainfrom
agent/x99-claude-sonnet-200k/che-5552-3914c80db5f6

Conversation

@congvc-bot-x99

Copy link
Copy Markdown

Closes CHE-5552 (slice S6 of CHE-5474, plan r5 C-11, Done-when item 10). Stacked on PR 104 (S3b, head 5f7b64b). Draft. DOOP_DEPLOY_TRAIN stays absent/off: this PR approves no deploy and runs no drill.

What changes

  • scripts/deploy-gate.mjs: drill mode enters. Needs an allowlisted human dispatch, attempt 1, a full candidate_sha, fault in none|fail-readback, switch exactly off, pause empty, and vars.DOOP_DRILL_AUTH = <candidate sha>:<ISO-8601 UTC expiry> (unexpired, at most 24 h ahead, same SHA). Every "no" is a refusal. pre-arm and pre-apply re-read switch and authorization; confirm and rollback do not. A fault is refused outside a drill.
  • deploy/cd/c00.sh readback: DOOP_DRILL_FAULT=1 fails the readback after the real checks (so the rollback by digest is real), records no T0; only in a drill, only the value 1.
  • cd-deploy.yml: fault becomes a choice; INPUT_CANDIDATE_SHA/INPUT_FAULT reach decide and recheck; DOOP_DRILL_FAULT is set on the readback step alone.
  • A drill still writes suspended:* and never clear:* (existing marker tests extended to drill; restore stays train-only).
  • README: entry rules and the DOOP_DRILL_AUTH prerequisite.

Tests (red, then green)

Command: vitest run on tests/deploy*.test.ts tests/c00Deploy.test.ts (7 files; the full suite needs PGlite + Chromium, not run here).

  • Red (tests added before code): 17 failed, 417 passed. Failing: drill entry passes, fault validation, bot/rerun, own-suspended drill pre-apply, drill pre-arm, 7 c00.sh fault tests, 3 workflow wiring tests.
  • Green after the change: Test Files 7 passed (7), Tests 434 passed (434). Baseline before my tests: 395 passed.
  • Item 10 covered: refused with switch on (and absent/unreadable), expired / expiring-now / wrong-SHA / >24 h / malformed / absent authorization (decide, pre-arm, pre-apply), authorization expiring between decide and apply; drill cannot clear the marker.
  • tsgo --noEmit clean; oxlint and prettier clean on the changed files.

Notes for the reviewer

  • Drill with the switch off runs c00.sh apply on the unsupervised migration path (train_on false). Run A's rollback never runs a down migration; a candidate with migrations is not drilled by this PR's design. Choose a candidate with no new migrations for CHE-4586, or say so on that issue.
  • A drill with the switch absent is refused (plan says "must be off"): set DOOP_DEPLOY_TRAIN=off explicitly before the drill.
  • Not done here (need Cheese approvals on CHE-4586): DOOP_DRILL_AUTH write, drill runs A and B, lift, listing text, switch on. Drill live evidence stays open.

congvc-bot[bot] added 22 commits November 18, 2026 11:29
…d (CHE-5548)

- proveQuiescence: kill, wait, record (pid, backend_start), terminate, prove three
  facts inside one 30 s budget; every step bounded; a timeout leaves a fact unproven.
- Failed migration: clone ledger must equal the pre-migration ledger.
- needs_operator writes a guard file that no sweep removes, keeps the sandbox, skips
  the final sweep. runCompat, c00.sh apply, rollback, sweep and guard refuse until
  the facts hold; lift calls c00.sh guard.
- Tests: stuck docker kill/wait/inspect/psql, later job after a failed proof,
  c00.sh refusal. Run against the previous implementation: 67 of 107 failed.
  Written after the code, so retrospective test-first.
…ion, clear it only after proof (CHE-5548)

Red (6 failures) before the change, green (174 passed across compat and c00 suites) after.
…imports (CHE-7020)

Chrome aborts in-flight requests with net::ERR_NETWORK_CHANGED when host
network interfaces change. The module script in drawing.html then never sets
window.drawingHarness and no wait recovers. Print pageerror/requestfailed/
readyState on a stall and load the page again (3 tries, 8s ready wait).
…E-7021)

The first seedPanel wait timed out at the 5 s puppeteer default on CI shard 2
(run 44129413615, job 134202011472). Widen the file default and the one
explicit 5 s poll to 12 s, under the 15 s per-test limit.
…-6841)

cheese/main carries its own flake fix (doop-design#433) and the ci-policy R1 push-trigger
rule, so the #64 commits are dropped here and the test files take main's
version. Smoke routes gain /api/agent-runners and /api/fonts and follow the
new /api/model-account view.
…ce (CHE-5549)

Rules C-9 and C-12 of CHE-5474. Ships with DOOP_DEPLOY_TRAIN absent or off.
…lock (CHE-5549)

Review round 1 on the S5 slice:
- deploy-gate recheck runs the real quiescence proof (c00.sh quiescence) instead of a hardcoded ok.
- c00.sh confirm and rollback prove migration quiescence under the lock, switch on or off.
- The confirm and rollback checks run inside c00.sh after take_lock, so a newer deployment or a changed marker that
  lands while waiting for the lock is seen (superseded, none, refused); the workflow no longer decides before the lock.
- The rollback job is one c00.sh step; the marker token and suspension follow the step's own go output.
… (CHE-5549)

Quiescence in confirm reads the live database, so the job needs the same
C00_COMPOSE_DIR and C00_PG_CONTAINER as deploy and rollback. Test drives
c00.sh with only each job's own env block.
…CHE-5550)

The watchers searched only the 30 newest D2 runs for a confirmed deployment.
After 30 skipped slots the SHA came back null: the live watch then passed an
unreachable /healthz and the freshness watch treated the deployed candidate as
overdue.

- D2's evidence job records each confirmed deploy as a GitHub deployment
  (environment c00-doop, deployments: write), read back before the step passes.
- The last successful D2 SHA is tri-state: known, none (a proven first
  deployment) or unknown. Unknown history alarms and fails visibly.
- Artifact scan is only the fallback: paginated, up to 100 runs, and a green
  run whose evidence is gone counts as unknown.
- /healthz must be healthy with a 40-hex revision even when nothing deployed.
…typed booleans (CHE-5550)

A prior deployment record no longer hides a newer confirmed deploy whose own
record write failed: that history is unknown and fails both watchers visibly.
The record carries its D2 run id; auto_merge and production_environment go
out as JSON booleans (gh api -F) and the request and failure path are tested.
Add cd-lift.yml, the only way from armed/suspended back to clear (plan CHE-5474
C-10.6, C-10.7). Dispatch only, one input (decision_id), allowlisted dispatcher,
C00 runner under the host deploy lock.

scripts/deploy-lift.mjs refuses unless the Multica decision is an approved
doop.deploy_lift by the configured approver, not withdrawn/revoked/expired, its
marker_value equals the standing marker and repo matches, quiescence and
/healthz are proven, and the decision and marker still hold when re-read right
before the write. It then writes clear:<nonce>:<run id>, reads it back and
records lift-evidence.json. A refusal leaves the marker unchanged.

c00.sh gains a `lift` command (guard, lock, quiescence, digest, revision label,
container health). deploy-marker.mjs gains lift() and exports readMarker().
The train switch DOOP_DEPLOY_TRAIN is not touched.
…HE-5552)

Drill dispatch needs the switch exactly off, an unexpired DOOP_DRILL_AUTH for the
candidate (24 h at most), attempt 1 and a known fault; every no is a refusal.
pre-arm and pre-apply re-read the authorization. fault=fail-readback sets
DOOP_DRILL_FAULT=1 on the readback step; c00.sh fails the readback after its
real checks, only in a drill. A drill still never writes clear.
@congvc-bot-x99
congvc-bot-x99 Bot force-pushed the agent/x99-claude-sonnet-200k/che-5551-d4fdb0456e80 branch from 68da5b7 to 40c8ba7 Compare November 20, 2026 23:16
Base automatically changed from agent/x99-claude-sonnet-200k/che-5551-d4fdb0456e80 to agent/tofu/che-5548-2644b627ca4a November 23, 2026 03:57
Base automatically changed from agent/tofu/che-5548-2644b627ca4a to cheese/main November 23, 2026 09:29

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants