package main import ( "os" "testing" ) // zddCopyIDs is the zero-downtime plan 6 copy inventory, pinned as a literal: // the 149 strings Paul approved on 2026-10-11. The record must name every one, // once, and nothing else. A record that loses an entry fails here even though // every entry left in it is applied. var zddCopyIDs = []string{ "zdd.settings.heading", "zdd.settings.intro", "zdd.settings.swap-label", "zdd.settings.overlap-option", "zdd.settings.hold-option", "zdd.settings.concurrency-label", "zdd.settings.migrations-note", "zdd.settings.save", "zdd.settings.saved", "zdd.settings.invalid", "zdd.settings.store-failed", "zdd.settings.rate-limited", "zdd.settings.unread", "zdd.settings.no-bucket", "zdd.instance.installed", "zdd.instance.serving", "zdd.instance.hold", "zdd.instance.hold-text", "zdd.instance.hold-down-text", "zdd.instance.promote-retry", "zdd.instance.retry-button", "zdd.instance.rolling", "zdd.instance.asleep", "zdd.instance.retry-title", "zdd.instance.retry-line", "zdd.instance.retry-done", "zdd.instance.retry-failed", "zdd.instance.retry-limited", "zdd.instance.not-held", "zdd.instance.audit", "zdd.api.swap-nothing", "zdd.api.swap-bad", "zdd.api.concurrency-bad", "zdd.api.swap-limited", "zdd.api.swap-audit", "zdd.api.ship-swap-bad", "zdd.api.ship-swap-conflict", "zdd.api.retry-store", "zdd.api.retry-host-audit", "zdd.api.retry-not-held", "zdd.api.retry-no-bucket", "zdd.api.retry-limited", "zdd.apps.usage-line", "zdd.apps.usage-set", "zdd.apps-set.usage", "zdd.apps-set.flag-swap", "zdd.apps-set.flag-concurrency", "zdd.apps-set.flag-app", "zdd.apps-set.nothing", "zdd.apps-set.bad-swap", "zdd.apps-set.bad-concurrency", "zdd.apps-set.two-apps", "zdd.apps-set.direct-mode", "zdd.apps-set.done", "zdd.apps-set.overlap-note", "zdd.apps-set.hold-note", "zdd.apps-set.mismatch", "zdd.apps-set.old-console", "zdd.apps-set.error", "zdd.apps-set.unreadable", "zdd.ship.flag-swap", "zdd.ship.usage-flag", "zdd.ship.bad-swap", "zdd.ship.hold-note", "zdd.ship.no-echo", "zdd.deploy.usage-flag", "zdd.deploy.held-until", "zdd.instances-retry.usage-line", "zdd.instances-retry.usage-para", "zdd.instances-retry.done", "zdd.instances-retry.old-console", "zdd.list.header", "zdd.list.retry-hint", "zdd.state.held", "zdd.state.rolling-out", "zdd.state.asleep", "zdd.state.config-pending", "zdd.cause.release", "zdd.cause.install", "zdd.cause.retry", "zdd.cause.restart", "zdd.cause.config", "zdd.reason.health", "zdd.reason.settle", "zdd.reason.exit", "zdd.reason.staging", "zdd.reason.reused", "zdd.reason.unknown", "zdd.unavailable.declined", "zdd.unavailable.store", "zdd.unavailable.release-key", "zdd.unavailable.failure-book", "zdd.unavailable.unknown", "zdd.event.swapping", "zdd.event.swapped", "zdd.event.swap-failed", "zdd.event.hold-down", "zdd.event.cohort-halted", "zdd.event.fallback-served", "zdd.event.config-pending", "zdd.event.staging-refused", "zdd.event.bounce-instance", "zdd.event.bounce-sidecar", "zdd.refuse.not-installed", "zdd.refuse.held-down", "zdd.refuse.not-staged", "zdd.refuse.attempt-running", "zdd.refuse.not-installable", "zdd.refuse.held-since-plan", "zdd.refuse.no-store", "zdd.refuse.no-release-key", "zdd.refuse.book-unreadable", "zdd.refuse.no-swaps", "zdd.refuse.restart", "zdd.wake.not-published", "zdd.sidecar.restart-retrying", "zdd.watch.intro", "zdd.watch.word-swapped", "zdd.watch.word-installed", "zdd.watch.asleep-tail", "zdd.watch.word-failed", "zdd.watch.word-held", "zdd.watch.held-tail", "zdd.watch.box", "zdd.watch.count-swapped", "zdd.watch.count-asleep", "zdd.watch.count-failed", "zdd.watch.count-held", "zdd.watch.failed-summary", "zdd.watch.hold-down-summary", "zdd.watch.timeout", "zdd.watch.pending-not-installed", "zdd.watch.pending-other", "zdd.watch.pending-queued", "zdd.watch.pending-running", "zdd.watch.pending-settling", "zdd.watch.pending-waiting", "zdd.watch.pending-dark", "zdd.watch.box-busy", "zdd.watch.pending-unlisted", "zdd.watch.pending-unread", "zdd.watch.list-failed", "zdd.docs.apps-set", "zdd.docs.deploy-watch", "zdd.docs.deploy-watch-lead", "zdd.docs.deploy-swap-and-retry", "zdd.docs.migrations", "zdd.docs.instances", "zdd.docs.sidecars", } // zddCopyFragments are entries shorter than shortCopyBytes that sit inside a // longer literal. var zddCopyFragments = map[string]bool{"zdd.ship.usage-flag": true, "zdd.deploy.usage-flag": true} // Every string Paul approved in the zero-downtime plan 6 copy review is // present, byte for byte, in the file the record names. func TestZeroDowntimeCopyIsApplied(t *testing.T) { raw, err := os.ReadFile("docs/superpowers/plans/2026-10-07-zero-downtime-deploys-6-copy.json") if err != nil { t.Fatal(err) } checkApprovedCopy(t, raw, ".", zddCopyIDs, zddCopyFragments) } // zddReadinessCopyIDs is the flag-readiness copy inventory: the three // no-signing-key retry strings Paul approved unchanged on 2026-10-12. var zddReadinessCopyIDs = []string{ "zdd-readiness.retry-no-key.api", "zdd-readiness.retry-no-key.browser-title", "zdd-readiness.retry-no-key.browser-body", } // Every string Paul approved in the flag-readiness copy review is present, // byte for byte, in the file the record names. func TestZeroDowntimeReadinessCopyIsApplied(t *testing.T) { raw, err := os.ReadFile("docs/superpowers/plans/2026-10-11-zero-downtime-flag-readiness-copy.json") if err != nil { t.Fatal(err) } checkApprovedCopy(t, raw, ".", zddReadinessCopyIDs, nil) } // zddReadiness2CopyIDs is the flag-readiness round 2 copy inventory: the // seven declined-box and old-box strings Paul approved unchanged on // 2026-10-13. var zddReadiness2CopyIDs = []string{ "zdd-readiness2.hold-declined", "zdd-readiness2.hold-declined-down", "zdd-readiness2.retry-line-declined", "zdd-readiness2.retry-unsupported.api", "zdd-readiness2.retry-unsupported.browser", "zdd-readiness2.retry-unsaved.api", "zdd-readiness2.retry-unsaved.browser", } // Every string Paul approved in the flag-readiness round 2 copy review is // present, byte for byte, in the file the record names. func TestZeroDowntimeReadiness2CopyIsApplied(t *testing.T) { raw, err := os.ReadFile("docs/superpowers/plans/2026-10-12-zero-downtime-flag-readiness-2-copy.json") if err != nil { t.Fatal(err) } checkApprovedCopy(t, raw, ".", zddReadiness2CopyIDs, nil) }