Skip to content

feat(mesh0408-W6): bundle rollback — close the FAILED dead end W5 left - #210

Open
adamkrawczyk wants to merge 3 commits into
mainfrom
tori/bundle-rollback-w6-0809
Open

feat(mesh0408-W6): bundle rollback — close the FAILED dead end W5 left#210
adamkrawczyk wants to merge 3 commits into
mainfrom
tori/bundle-rollback-w6-0809

Conversation

@adamkrawczyk

Copy link
Copy Markdown
Contributor

What

POST /api/cookbook-deploy/{id}/rollback — the atomic recovery path mesh0408-W5 (#201) didn't ship.

Why

W5 gave the bundle-apply path a real terminal state (applying -> converged | failed) — before it, the status endpoint returned a hard-coded applying forever, decoration not observability. But it left failed a dead end: nothing in the codebase ever moved a bundle off it. An operator had to notice and manually re-POST /apply. This was serializing/blocking the fleet-deploy pipeline (#206) on any bundle that hit a real failure.

Behavior

  • 409 unless the bundle's LATEST job is genuinely failed — never touches an applying job (might still converge on its own), never touches converged (nothing to roll back)
  • re-resolves the bundle's CURRENT targets (pin, else newest published version) — a rollback issued after a patch ships retries the FIX, not a frozen replay of the exact broken versions
  • idempotent-safe: a second rollback call after the first succeeds 409s too (the new job is applying, not failed) — no silent job-stacking

Tests

7 new tests in tests/test_bundle_rollback.py, all green:

  • opens a fresh job on a genuinely failed bundle
  • re-targets to a patched version published between failure and rollback
  • 409 on no-job-yet / still-applying / already-converged
  • second rollback call safely rejected, not duplicated
  • tier gate (402 on free tier)

Full W5 regression suite (15 tests) + entire bundle-marked suite (420 tests) pass unaffected.

Deploy note

Per AGENTS.md discipline: deploy.yml auto-deploys prod on merge to main — this PR is left OPEN for Adam's human review/merge, not force-merged.


🤖 Shipped via atomic-habits fallback executor (rank-1 default, 2026-08-09, Adam absent by 21:00).

W5 (#201) gave bundle-apply jobs a real terminal state (applying ->
converged | failed), but nothing ever moved a bundle OFF failed. An
operator had to notice and manually re-POST /apply.

POST /api/cookbook-deploy/{id}/rollback:
  - 409s if the bundle's latest job isn't genuinely 'failed' (covers
    no-job-yet, still-applying, already-converged) -- never races an
    applying job that might still converge, never no-ops silently
  - re-resolves the bundle's CURRENT targets, so a rollback issued after
    a patch ships retries the FIX, not the exact broken versions
  - a second rollback call after the first succeeds also 409s (new job
    is 'applying', not 'failed') -- retries are observably safe, not
    silently stacked

7 new tests (test_bundle_rollback.py), all green. Full W5 suite (15
tests) + bundle-marked suite (420 tests) unaffected.
Copilot AI lite review requested due to automatic review settings August 9, 2026 19:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

adamkrawczyk and others added 2 commits August 9, 2026 21:21
CI caught it: scripts/audit_tier_vocab.py flags the bare word 'operator'
anywhere in the tree (it's a legacy tier name, sunset 2026-06-10, only
allowed inside config/tiers.yaml or near an alias-map marker). My
docstrings used 'operator' in the plain-English sense (a human
noticing a stuck job) — reworded to 'a human' to stay unambiguous
without tripping the SSOT gate.
…ia.org

The `humanizer` skill cites Wikipedia:Signs of AI writing as the source its
entire method derives from, and was rejected at publish time with HTTP 422 on
2026-08-10 because wikipedia.org was absent from no_external_promo's allowlist.

arxiv.org and semanticscholar.org — the same KIND of citation source — were
already allowlisted. The omission was an oversight, not a policy: a skill that
cites where its method came from is doing the honest thing, and the linter was
punishing it.

Found while closing a real demand signal: humanizer had 4 logged zero-result
searches (2026-07-26 x2, 08-07, 08-10) and could not be published because of
this rule.

RED-proof: test_wikipedia_citation_domains_pass fails on the pre-fix allowlist
and passes after. 23/23 in the linter suite.
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.

2 participants