# CI delivery web data

audience: AI coding agents first.

status: DONE
task IDs: #22, #29, #32
source request: Implement typed `/ci` delivery data plumbing in `apps/web/src/lib/ci-delivery-data.ts`, `ci-delivery-data.test.ts`, `ci-delivery-query.ts`, and `ci-delivery-query.test.ts`, per `docs/specs/2026-08-12-ci-live-delivery-status-design.md`. Missing, malformed, or incomplete collector data MUST remain explicit unknown/incomplete. Review correction: current non-stale `deploy-status` data MUST return `fresh`; `unknown` applies only when freshness cannot be determined. No UI markup, primitive, route, dependency, or fabricated state. Commit only owned files.

## Outcome

Stable typed parser and read-only collector query seam expose `deploy-status` without changing visual `/ci` code or queue behavior.

## Acceptance criteria

- Parser models `idle`, `queued`, `running`, `stalled`, and `unknown`.
- Types preserve completeness, freshness, request identity, observed timestamp, queue depth, oldest age, current operation/holder, latest event/progress, and malformed/unavailable reason.
- Missing, malformed, or incomplete source data remains explicit unknown/incomplete.
- Query requests only collector `deploy-status` data and has focused tests.
- Current, non-stale panel freshness returns `fresh`; stale returns `stale`; missing or indeterminate freshness returns `unknown`.
- Focused Vitest files, web typecheck, and web build pass with no warnings.
- Commit contains only four assigned source/test files. Registry documentation is operational metadata and remains uncommitted for this worker handoff.

## Preserved WIP

Worktree `ci-status-web-data` began clean. No foreign changes touched.

## Constraints

- Read-only. NEVER mutate queue, locks, events, controller, factory, or routes.
- NEVER fabricate status, entries, timestamps, age, source revision, artifact, or deployment claims.
- Collector code may not yet exist locally; tests pin wire contract independently.
- Do not change visual `/ci` or deck-ui files.

## Execution steps

1. Inspect existing collector client/query conventions and design contract.
2. Add strict parser/types and test complete, missing, malformed, and incomplete payload states.
3. Add collector query seam and request/error behavior tests.
4. Run focused tests and `pnpm --filter web typecheck`.
5. Commit only assigned files; record exact receipt.

## Current receipt

Candidate `da7b312ba16b3ef92cd5f3e928404ca23a3a94ec` touches only assigned query and test files. Defined non-stale freshness maps to `fresh`; stale evidence maps to `stale`; absent/indeterminate evidence maps to `unknown`. Regression coverage asserts current queued `deploy-status` is fresh. Acceptance passed: web test 43 files/411 tests; web typecheck 0 errors/warnings/hints; web build 0 warnings. Independent Sol/low review APPROVED with no blocking findings and confirmed no fabricated state or out-of-scope source changes.

Installed receipt 2026-08-13: web candidate is on `origin/main`; collector candidate `4abdc6c03cf2785847cfd2647f6e1f52de7ca020` landed through guarded merge `08a0b449c196d0c381dad4f494cc38cb86587113`. Ship wrapper candidate typecheck/test gates passed and `packaging/deploy-local.sh` deployed merge `08a0b449`; `/ci` returned HTTP 200 from `127.0.0.1:31337` and rendered explicit `Unknown` freshness when authoritative status was unavailable. Collector deploy-status adapter passed 10/10 focused tests, including absent/malformed lock handling, live-holder handling, and authoritative queued identity/freshness. Installed web and collector services are active. Immutable deployment hardening remained untouched.

## Next executable action

No next action. Delivery is landed, deployed, and installed proof is recorded.
