3.2 KiB
3.2 KiB
#1146 — CI Queue Guard Purpose Semantics
Objective
Make the pre-push queue guard wait for queued/running CI without requiring the previous remote head to have successful CI. Preserve fail-closed merge readiness.
Scope
packages/mosaic/framework/tools/git/ci-queue-wait.sh- focused queue-guard regression tests
- design and scratchpad documentation
- local framework activation required before the fixed guard can authorize this branch's push
Plan
- Freeze purpose-specific behavior in failing process-level tests.
- Implement the smallest state-dispatch change.
- Run focused shell tests and repository quality gates.
- Obtain independent review and remediate findings.
- Install the reviewed framework source locally, run the mandatory pre-push queue guard, and push.
- Open a PR against
next, verify terminal-green CI, and close #1146 after merge.
Budget
- ASSUMPTION: no explicit token cap was provided.
- Working estimate: 12K tokens.
- Scope reduction: change only final-state dispatch and focused tests; do not redesign provider adapters.
Progress
- Confirmed source and installed guards are byte-identical.
- Reproduced
terminal-failureblocking--purpose push. - Root cause: final-state dispatch requires terminal success for both push and merge.
- Design approved: push is queue-clear on valid non-pending states; merge remains fail-closed.
Tests
- RED confirmed before implementation: the focused tri-state harness reported push
terminal-failureandno-statusasASSERTED_NOT_READY. - GREEN:
bash packages/mosaic/framework/tools/git/test-ci-queue-wait-tristate.sh— all outcome classes passed. - GREEN:
bash packages/mosaic/framework/tools/git/test-ci-queue-wait-github-checks.sh— 6/6 purpose-aware cases passed. - GREEN:
bash -npassed for the changed guard and both focused harnesses. - GREEN:
pnpm preflight,pnpm typecheck, andpnpm lintpassed. pnpm testran 45/46 workspace test tasks successfully, but the pre-existing Gatewaycross-user-isolation.test.tsfailed during cleanup with PostgreSQL error28P01(localmosaicpassword authentication failure). The changed Mosaic framework test task passed within that run.- GREEN:
pnpm --filter @mosaicstack/mosaic testpassed (81 Vitest files, 1,514 tests, plus the complete framework shell suite, including both queue-guard regressions). - GREEN:
pnpm format:checkpassed. - Note: an additional ad hoc Prettier command was not applicable to shell files because Prettier has no shell parser; the repository-wide format check passed using its configured file globs.
Review
- Independent Codex review of the six-file diff: approved, confidence 0.84, zero blockers/should-fix/suggestions.
- Review confirmed push queue-clear behavior, merge fail-closed behavior, and
--require-statuscoverage.
Risks and Blockers
- A source-only fix does not update
~/.config/mosaic/tools/git/ci-queue-wait.sh; local framework activation must use the reviewed installer path rather than a manual copy. - Full baseline test completion is blocked by the unrelated local PostgreSQL authentication/cleanup failure described above; CI has its own disposable PostgreSQL service.
- Existing
.mosaic/orchestrator/*working-tree changes are unrelated and must remain unstaged.