Skip to content

[Task] B4 — Promotion, atomic publication and rollback #60

Closed

Description

@DavidVFitzGerald

Delivery phase

Phase 2 — backend and real integration (B4)

Goal

Deliver complete maintainer promotion, atomic publication and rollback operations in one issue and one PR, proven end to end with a synthetic candidate and B2 API. Preserve one work unit across sessions and incremental commits.

Context and authority

Roadmap B4; PRD §4; specification §§4.1–4.3, 5.1–5.2, 5.8, 7.3, 8–9.2 and 12; ADR0005 after approved merge (#55/PR #56). Read AGENTS.md, engineering role, current requirements, B1 release/provenance contracts, B3 artifact/report contracts and B2 visibility behavior. Exclude archive/reference folders.

Requirements and constraints

All operations/tooling run in guarded rootless containers and isolated worktrees/projects/ports/volumes. Promotion is not publication; prepare/run/promote cannot alter public visibility. Verify operator role and artifact/manifest checksums. Production publish/Terraform apply remain explicit approval actions and are not authorized by this issue. Use disposable synthetic source and target databases/private object-storage substitutes for automated tests; never use proprietary inputs or production credentials in public CI. No API/frontend component edits except separately coordinated backend contract consistency fixes.

Acceptance criteria

  • AC1 — Maintainer CLI exposes promote/publish/rollback with validated arguments, clear dry-run/verification output, explicit target and authenticated operator authorization; IAM/DB credentials cannot be supplied by ordinary users. Record safe structured operation/audit events, actor, artifact/revision/rule identity and before/after pointer, without secrets/raw rows.
  • AC2 — Promotion verifies source readiness, manifest/artifact/file checksums, counts, rules and source references, then transfers archive/artifacts and revision-scoped harmonized data efficiently into a non-visible target candidate. Support local test targets and documented private GCS/Cloud SQL production paths without provisioning cloud infrastructure. Promoted provenance is complete with source objects/archive paths/original source coordinates even when staging is not transferred.
  • AC3 — Target-side verification rejects missing/corrupt artifacts, unresolved critical issues, invalid references, cross-release membership and incomplete candidates. Idempotent retry/resume after interruption cannot duplicate, overwrite immutable published data or activate partial loads. Prepare/run/promote leave release_publication unchanged.
  • AC4 — Publish is a separate explicit operation; inside one transaction it verifies ready target data and same-release membership, atomically swaps the active pointer, and records immutable revision history/status. Concurrent publishers serialize safely; stale/conflicting requests fail clearly. Published identities, measurements and provenance remain immutable.
  • AC5 — Rollback atomically restores a previously published revision of the same release, preserves both revisions and audit history, and never reconstructs/rewrites values. Invalid/unpublished/cross-release rollback targets fail safely. Repeated explicit operations are idempotent or return a clear conflict.
  • AC6 — End-to-end synthetic source→artifact→promotion→publication→rollback validation proves B2 sees no candidate before publish and switches coherently afterward. Existing comparison snapshots continue reading their original published immutable revision, and no response mixes old/new revisions during pointer switches.
  • AC7 — Focused Postgres/CLI integration checks cover valid promotion/publish/rollback, denied operator, checksum/readiness failure, interrupted retry, concurrent pointer update, cross-release FK denial and self-contained provenance without staging. Frozen-lock/Ruff/MyPy/unit/targeted integration checks pass in containers; retain existing frontend checks without claiming UI integration complete.
  • AC8 — Document exact dry-run/promote/publish/rollback/recovery commands and artifact lifecycle, operator roles, permissions and approval boundaries. Roadmap/verification handoff includes commands/results, failure recovery evidence and independent QA at the delivered SHA. No production publish/deploy occurred; one PR references this issue and remains reviewable.

Out of scope and follow-ups

I1 owns real frontend adapter/generated DTOs and integrated browser E2E; R1 owns actual Terraform/cloud provisioning, backup/restore/deployment operations; R2 owns full-data ingestion audit/license/date signoff and actual production release. Production approval cannot be inferred from this implementation request. Do not implement post-MVP user uploads, entitlement UI or managed cloud ETL. Link B1/B2/B3 and I1/R1/R2 milestone ownership rather than creating additional B4 implementation PRs.

Verification plan

Run B1 backend quality/frozen-lock/unit/Postgres checks plus documented make backend-test-publication (new planned target) against isolated disposable source/target databases and checksummed synthetic archives. Inside the guarded containers: uv lock --check, frozen selected-package sync, make backend-format-check backend-lint backend-typecheck backend-test-unit backend-test-integration backend-test-publication. Exercise CLI prepare/run/report from B3 and promote/publish/rollback with the B2 API; compare pointer/state/cell/provenance outcomes before/during/after each action. Include one interruption/retry and one concurrency scenario, avoiding redundant full-suite expansion. Record exact invocations and target IDs. Production transfer/publication is not part of automated verification.

Dependencies and readiness

BLOCKED until B3 ready candidate/artifact delivery and B2 API/auth/snapshot delivery, both based on verified B1, plus accepted ADR0005. Link actual issue/PR numbers after publication. Implementation of isolated promotion mechanics may use B3 after its gate; issue cannot pass until B2 API visibility evidence is present. I1 still requires Phase 1 completion, B2 and B4. No approved merge is claimed by issue creation or internal QA.

Published dependencies: B1 #57, B2 #58 and B3 #59.

Activity

  1. added
    task
    blocked
    on Nov 14, 2026
  2. DavidVFitzGerald commented on Nov 15, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Coordinator: READY — B4

    Dependencies B1 #57, B2 #58 and B3 #59 are verified on main at 9b0ebbaf07130ed0a8e8c964a1aca4f2e30b53ac through approved recovery PR #82. Independent QA and all four required checks passed; backend tree equality to the reviewed delivery was confirmed. Completed issues are closed.

    The existing #60 acceptance criteria and scope are unchanged. One B4 implementation PR will target main from isolated /tmp/lca-diff-b4, branch feat/b4-publication. Implement authenticated promotion, independent readiness checks, immutable operation audit, explicit atomic publication/rollback and synthetic API-visibility/concurrency/retry checks. Production actions and I1 remain out of scope.

    The PM and engineering role agents were invoked but hit an account usage limit before edits. The coordinator has read the role/current requirements and verified readiness, and will carry the implementation forward. This does not waive independent final QA: if a separate reviewer remains unavailable, the PR stays pending QA rather than being self-certified. Rootless preflight passes; all tooling remains container-backed.

  3. removed
    blocked
    on Nov 15, 2026
  4. DavidVFitzGerald commented on Nov 15, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Engineering: READY FOR QA — B4

    PR #86 (draft), branch feat/b4-publication, delivered HEAD d3bd9ed;
    application implementation 1b9ee46. Based on merged B1–B3 main 9b0ebba.

    AC1–5 are implemented: role-authenticated explicit target/operation CLI with
    dry-run; create-only checksummed archive transfer and batched non-visible target
    loading; independent readiness/provenance/rule/reference verification; atomic
    publication/rollback with expected-pointer serialization and immutable history.
    Migration 0003 adds append-only receipts with database-derived actor/role/time.
    AC6–7 have focused synthetic CLI/PostgreSQL/B2 API evidence, including old and
    new exact cell values, concurrent publishers, denial, checksum/semantic failure,
    interrupted transfer/retry, audit immutability and no staging dependence.
    AC8 playbook and verification record are committed. Final independent QA and
    hosted checks remain required before readiness for maintainer review.

    Container commands: ./dev publication-run uv lock --check and
    ./dev publication-run make backend-format-check backend-lint backend-typecheck backend-test-unit backend-test-integration backend-test-publication using the
    isolated B4 project. Results: lock174 packages, Ruff and MyPy pass;12 unit checks,
    5 PostgreSQL scenarios and3 B4 scenarios pass. Final B4 rerun41.93s includes
    actual snapshot-cell assertions. Exact setup and reproducible commands are in
    docs/engineering/b4-publication.md and b4-verification.md.

    Local fresh dependency copy hit tmpfs quota; checks used an existing compatible
    backend environment mounted read-only inside the container. Hosted CI retains
    fresh frozen installation and all existing checks, plus the new publication
    scenario. No host dependencies were installed, frontend source changed, provider
    inputs imported or production operations performed.

    Next: independent QA at delivered SHA and hosted checks; fix any in-scope
    findings under this same issue/PR. No merge performed. Leave #60 open until QA,
    passing checks and explicit maintainer merge. I1/R1/R2 retain integration, actual
    cloud operations and full-data/license/release gates.

  5. DavidVFitzGerald commented on Nov 15, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Engineering: READY FOR QA — final delivery

    PR #86, branch feat/b4-publication, HEAD 8fd71db. The branch incorporates
    current main f1fd944 without frontend differences in the PR.

    Independent QA identified coordinated candidate-value drift. Fix 7dc0802
    binds exact target contents to the immutable promotion receipt and verifies
    them on publication, rollback and retry. Final fix 8fd71db locks compared
    shared rows through receipt creation/commit, closing a concurrent metadata
    change window. The existing fault scenario now rejects an amount and provenance
    sum changed together, even when semantic sums still agree.

    Final local container checks pass: format/lint, MyPy (44 source files), and all
    3 focused publication scenarios in 68.57 seconds. Earlier same-branch unit and
    database checks passed (12 and 5 respectively). Hosted commit 3ec471e passed
    all four checks; final 8fd71db CI and independent QA are running. Fresh frozen
    installs have passed in hosted backend/ETL/API checks, resolving the local tmpfs
    installation limitation. The one unrelated frontend assertion failure passed
    on its single retry and remains tracked in #87.

    No production operations occurred. Keep #60 open and PR #86 draft until final
    checks and independent QA pass. Next owner: QA, then maintainer review/merge.

  6. DavidVFitzGerald commented on Nov 15, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Independent QA: PASS

    Issue #60 / PR #86, exact delivered commit 8fd71db3a58b8203cf7b93b4c222307597a3b6ff.

    AC1–8 verified against the current specification, accepted ADRs, issue criteria and publication documentation. No unresolved acceptance-criterion gap was found.

    • Authenticated explicit-target CLI dry-run, promotion, publication and rollback; database-derived actor/role and append-only operation audit; denied-role and immutable-history checks pass.
    • Synthetic B3 artifacts are checked, durably transferred and promoted without API visibility or target staging dependencies. Invalid/corrupt artifacts, incomplete state and interrupted transfer are rejected; retries preserve pointer state and remain idempotent.
    • Real PostgreSQL transactions enforce same-release activation, expected-pointer conflicts, concurrent publication and rollback rules. B2 API checks confirm coherent visibility changes and unchanged values in previous revision snapshots.
    • Two QA findings were corrected and independently rechecked: coordinated candidate-value/provenance changes now fail receipt verification on activation and retry; shared pre-existing rows remain locked between artifact equality checking and receipt creation. A separate synthetic concurrent metadata-write probe confirmed the latter lock, followed by successful publication with the artifact's units preserved.
    • Production approval/representativeness gates and conditional object creation/checksums are covered with invented inputs and a fake object store. No production publication, real cloud operation or private provider processing was performed by this QA run.
    • Documentation accurately describes lifecycle, commands, approval boundaries and cloud limitations. No frontend implementation changes are introduced by this PR; no historical/private source material was added.

    Container evidence: final-SHA uv lock --check and make backend-format-check backend-lint backend-typecheck backend-test-publication passed: 57 formatted files, Ruff, MyPy (44 source files), and 3 focused publication scenarios. Earlier unchanged-code evidence also passed 12 unit and 5 database scenarios. Local tests used the documented read-only, lock-compatible dependency environment because of local temporary-storage limits; this is not claimed as a fresh local installation.

    All four hosted checks at this exact SHA passed, including fresh frozen installs and applicable backend, API/Auth, ETL/publication and frontend gates: backend/API, ETL, frontend.

    Real cloud IAM/storage/Cloud SQL validation and production approval remain deployment/release responsibilities; mock frontend integration remains I1. These are not reported as completed here. Next action: coordinator/maintainer review and explicit merge decision. QA made no application edits and performed no merge.

  7. DavidVFitzGerald commented on Nov 15, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Coordinator: READY FOR REVIEW

    B4 is implemented in PR #86 at 8fd71db3a58b8203cf7b93b4c222307597a3b6ff. Independent QA passed AC1–8 with exact-SHA evidence: #60 (comment) . All four hosted checks pass at that head; the PR is ready for review, conflict-free, and the worktree is clean.

    The maintainer may merge PR #86 into main. No merge or production publication was performed. Issue #60 remains open until the approved merge is confirmed. Completed B1–B3 and recovery issues #57, #58, #59 and #81 are closed. Stopping backend implementation here; no I1 work started.

  8. DavidVFitzGerald commented on Nov 15, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Completed through PR #86, merged by the maintainer into main at f0e2f9c. Independent QA passed AC1–8 at delivered head 8fd71db, and all four hosted checks passed. QA evidence: #60 (comment) . Merge verified before closure; no production publication is claimed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    task

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions