Repository navigation
Closed
Labels
app/aggregatorPackage/app: aggregator (pm-stack in this repo)Package/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codepm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workMedium: expected under 1 day of workpriority/normalOrdinary priority (the default)Ordinary priority (the default)source/design-architectFiled by the repo design architect jobFiled by the repo design architect jobtask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this item
Description
Phase 1 of design #2576 (aggregator ingest, fail-closed). Design doc: files/designs/code-aggregator-ingest-contract.md in the keep-the-four-repos-healthy goal workspace. Audited against origin/main 7c52ced1.
Scope
- Create
pm-stack/aggregator/src/validate.ts— the shared validation primitives, no new dependency:isRecord,isNonEmptyString,isStringArrayisFiniteNumber,isNonNegative,isPercentOf(limit)(finite, ≥ 0, ≤ the limit the document carries)isIsoDate/parseIsoDate— a real calendar date: components extracted and re-checked, so 2026-02-30 and 2026-13-01 fail instead of rolling over viaDate.parsearrayOf(guard)— validates a container, drops and counts bad elements- a future-timestamp bound helper (default 5-minute skew) for
generatedAt-style stamps (aggregator(health): dns/aa section stamps are never validated — a garbage dns generatedAt renders ageMs NaN/null, a future aa generatedAt renders age 0 (maximally fresh) for as long as the skew lasts #2242's defect shape)
- Write the ingest contract into
pm-stack/aggregator/README.md: validate once at the boundary (shape, element types, ranges, real dates); the three sanctioned failure outcomes (reject-and-retain / drop-the-element-and-count / refuse-the-append); the three forbidden outcomes (throw discarding siblings, fabricate rows/ids/zeros, publish out-of-range as live). Citesrc/token-adapter.ts(feat(quota-plane): browser-token adapter framework — managed credentials, fail-closed dashboard-API clients #1153) as the contract's existing embodiment. - A malformed-input probe matrix in
pm-stack/aggregator/test/(following the existing per-file test layout): one table per primitive — impossible dates, non-finite numbers, negative counts, over-limit percents, null/string/array element confusion — including the real fixture shapes fromsrc/sources/fixtures.tsas must-pass cases. - Proof consumer only: convert
isFleetFeed'sgeneratedAtcheck (src/feed.ts:207-219) to the strict date primitive. No other consumer changes in this phase.
Acceptance criteria
validate.tsexports the primitives above, each covered by the probe matrix (impossible dates fail; a genuine 0 passes as 0).- README states the contract, the sanctioned outcomes, and the forbidden outcomes.
isFleetFeedrejects 2026-02-30 / 2026-13-01generatedAtvalues it previously accepted; all existing feed tests still pass.- No new dependency in
pm-stack/aggregator/package.json. - Verification runs in CI per fleet policy (no builds on the sandbox).
🤖 Design-architect pass 18 — agent note: phase of design #2576; the decisions are recorded there and in the design doc. Do not re-derive them in triage; flag genuine blockers on #2576 instead.
Metadata
Metadata
Assignees
Labels
app/aggregatorPackage/app: aggregator (pm-stack in this repo)Package/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codepm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workMedium: expected under 1 day of workpriority/normalOrdinary priority (the default)Ordinary priority (the default)source/design-architectFiled by the repo design architect jobFiled by the repo design architect jobtask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this item
Activity
dezren39 commentedon Oct 30, 2026
🤖 agent-note:v1 — design-architect pass 18 (2026-10-30): Phase 1 of design #2576. Scope and acceptance are in the body; the contract and decisions are recorded on #2576 and in files/designs/code-aggregator-ingest-contract.md (keep-the-four-repos-healthy goal workspace). Triage: confirm scope against current main, settle what triage can settle, enqueue the implementation follow-up with acceptance intact. Do not implement in the triage task.
23 remaining items
dezren39 commentedon Oct 31, 2026
🤖 Agent note · parked
src/validate.ts, README ingest contract,test/validate.test.tsprobe matrix,isFleetFeedstrict-date conversion. Laptop: validate+orchestration 118 pass; full suite 649 pass with the same 7 failures as clean main (pre-existing, overview/manifest/render).dezren39 commentedon Oct 31, 2026
🤖 Agent note · handed off (duplicate-PR correction)
Merge pull request #3014 from developing-today/queue/4004-2577-valida…
dezren39 commentedon Oct 31, 2026
🤖 Agent note · done (fix merged)
27940ab3e943325914fa63286d9b448bc4e9aac0); closing this issue on the merge (acceptance met; design(aggregator): ingest, fail-closed — one validation contract for every document the PM stack consumes #2576 stays open for Phases 2–3). Note: PR aggregator: validate.ts ingest primitives + contract + probe matrix — #2576 Phase 1 (#2577) #3017, opened from this task's earlier claim, was a duplicate of aggregator: validate.ts ingest primitives + contract + probe matrix (#2577) #3014 and was closed by lane A under the duplicate-PR protocol with a salvage note on aggregator: validate.ts ingest primitives + contract + probe matrix (#2577) #3014 — nothing unique was lost.bun test test/validate.test.ts test/feed.test.ts— 97 pass / 0 fail.bunx tsc --noEmitshows 5 errors, all in files this PR does not touch (src/pages.ts, test/overview.test.ts, test/quota-current.test.ts) — pre-existing.