GeezerVison is showing github.com — test(usage-hub): contract tests for /api/quota.json saas/payg schema · Issue #1119 · developing-today/code
test(usage-hub): contract tests for /api/quota.json saas/payg schema #1119DescriptionPart of epic #1047. Design: hub-v2-v3-design-2026-10-26.md §6.
Add contract tests pinning the /api/quota.json schema for the hub sections — saas, payg, charges, attention, subscriptions — in the aggregator test suite. Consumers (quota-guidance, the measurement gate, the render layer) depend on these shapes; the v2 collector work (#1048-#1052, Modal/Bitwarden) will change producers, and a silent schema drift would surface as wrong quota guidance, not an error.
Tests: fixture-fed schema assertions per section (required fields, unit enums incl. the CNY case from the DeepSeek issue, null-used semantics: null means unmeasured, never 0), plus a live-feed smoke shape check that can run in CI without secrets.
Acceptance: suite green; a deliberate schema break in a scratch branch fails the new tests. Activitydeveloping-today commented on Oct 27, 2026 dezren39 commented on Oct 29, 2026 🤖 Agent note · done (triage verdict: CONFIRMED — routed to follow-up task 3015)
- Agent: queue worker (repo-worker-code), Lane C shift
- Session / ID: queue task 2405 (triage)
- Found via: queue claim
- Task: Triage test(usage-hub): contract tests for /api/quota.json saas/payg schema #1119 against current main and route it.
- Verdict — CONFIRMED:
/api/quota.json (pm-stack/aggregator/src/server.ts:650) does emit all the hub sections — saas, payg, charges, attention, domains, subscriptions over the pools shape — but the only test assertion on the endpoint in the whole suite is test/boot.test.ts:137-138: quota.pools.length > 0. Code search finds no per-section schema assertions, no unit-enum pinning, and no null-used semantics anywhere in pm-stack/aggregator/test/. The risk named in the issue is real and current: the v2 collector work (feat(usage-hub): v2 Cloudflare live collector — hourly analytics feed + billing scope #1048–feat(usage-hub): DeepSeek daily balance check + CNY unit in snapshot store #1052) changes producers, and the unit enum is already a live question — src/quota-gather-map.ts notes "the CNY balance case is feat(usage-hub): DeepSeek daily balance check + CNY unit in snapshot store #1052's unit work" while scripts/backfill-usage-snapshots.ts records the current enum (pct|usd|count|gb|tokens) has no CNY. Without a contract test, that change drifts silently; with one, it breaks loudly and deliberately.
- Route: follow-up task 3015 enqueued (dedupe key
repo-health:v1:fix:developing-today/code:issue:1119): fixture-fed per-section schema assertions (required fields, pinned current unit enum with the feat(usage-hub): DeepSeek daily balance check + CNY unit in snapshot store #1052 CNY break named in a comment, null = unmeasured ≠ 0), a secrets-free boot smoke shape check, and the issue's own acceptance — a deliberate schema break on a scratch branch must fail the new tests, recorded here.
- Links: epic epic(usage-hub): SaaS/cloud services completion — v2 live collectors, daily console reads, v3 reconciliation #1047 ·
pm-stack/aggregator/src/server.ts · pm-stack/aggregator/test/boot.test.ts
dezren39 commented on Oct 29, 2026 🤖 Agent note · parked
- Agent: queue worker (repo-worker-code), openchamber scheduled lane
- Session / ID: queue task 3015 (openchamber-scheduled-lane, 2026-10-29 run)
- Found via: queue claim (fresh task)
- Task: Started the test(usage-hub): contract tests for /api/quota.json saas/payg schema #1119 contract-test work but the ~30-minute scheduled-lane budget ended before implementation. What exists: branch
queue/3015-1119-quota-contract-tests pushed at 5a34fa70 (empty, cut from origin/main) and worktree ~/git/fleet/3015-1119-quota-contract-tests; /api/quota.json confirmed to emit {...quota, saas, payg, charges, attention, domains, subscriptions} at pm-stack/aggregator/src/server.ts ~L650-660. The exact next step (test file contents, unit-enum pin naming feat(usage-hub): DeepSeek daily balance check + CNY unit in snapshot store #1052, null-used semantics, fixture-fed smoke) is recorded in the task checkpoint. Parked 15 min.
- Expectation: done =
pm-stack/aggregator/test/quota-contract.test.ts green locally, PR open, deliberate-break check recorded here, task completed.
- Links: branch https://github.com/developing-today/code/tree/queue/3015-1119-quota-contract-tests
dezren39 commented on Oct 29, 2026
🤖 Agent note · contract tests written; blocked only on the repo-wide merge-queue freeze (#2403)
-
Agent: queue worker repo-worker-code, OpenChamber scheduled lane. Task 3015 (resume of the parked task).
-
PR test(usage-hub): contract tests for /api/quota.json hub sections (#1119) #2393 — queue/3015-1119-quota-contract-tests, OPEN / CLEAN / MERGEABLE at dc27adc0, basic: proxy port fallbacks SUCCESS, CodeRabbit neutral. One file: pm-stack/aggregator/test/quota-contract.test.ts — fixture-fed schema assertions per hub section (saas, payg, charges, attention, domains, subscriptions) on top of the existing pools.length > 0 check, so a producer change from the feat(usage-hub): v2 Cloudflare live collector — hourly analytics feed + billing scope #1048–feat(usage-hub): DeepSeek daily balance check + CNY unit in snapshot store #1052 v2 collectors cannot drift /api/quota.json silently.
-
Why it is not merged: ci: merge queue ejects every PR — no merge since #2233 (10:57Z), entries dropped 2-6 min into AWAITING_CHECKS #2403 — main frozen at 5a34fa70 since 10:57:51Z; every merge-queue entry is ejected with reason=branch_protection_failure. Full config enumeration and the exact reversible fix are in my note on ci: merge queue ejects every PR — no merge since #2233 (10:57Z), entries dropped 2-6 min into AWAITING_CHECKS #2403 (posted 22:12Z): the one unverified protection is the classic push restrictions allowlist.
-
Resume condition: main advances → re-enqueue test(usage-hub): contract tests for /api/quota.json hub sections (#1119) #2393, merge, close this issue. Task 3015 is blocked (escalated-to-user), not parked.
-
Links: PR test(usage-hub): contract tests for /api/quota.json hub sections (#1119) #2393 · ci: merge queue ejects every PR — no merge since #2233 (10:57Z), entries dropped 2-6 min into AWAITING_CHECKS #2403 · task 3015
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|