GeezerVison is showing github.com — follow-up(#3068 Phase 3 audit): parse-boundary shape checks the phases missed (sync-models, id/web, dispatch, projector, atlas-search, cold-store-reaper, mcpx, exporters, claimant) · Issue #7983 · developing-today/code
follow-up(#3068 Phase 3 audit): parse-boundary shape checks the phases missed (sync-models, id/web, dispatch, projector, atlas-search, cold-store-reaper, mcpx, exporters, claimant) #7983DescriptionFollow-up from the #3068 Phase 3 closing audit (evidence: doc/2026-11-09_audit_3068-phase3-closing.md, on PR for #3069). The audit inventoried every parse-then-dereference boundary in bin/, scripts/, pkgs/, and pm-stack's non-aggregator handlers. The sites below are boundaries the #3068 phases missed and the same rule covers — validate the shape you deref, at the boundary, before any side effect; absence is not emptiness. Each item is its own small fix; do them as separate small PRs, in roughly this risk order:
- bin/sync-models.mjs:127 — models.dev response read as
(await res.json()).response?.models || {}: absence-as-emptiness (corollary 3). A shape drift reads as "zero models" instead of an error.
- pkgs/id/web response casts: src/main.ts (8 .json() sites, several
as {…} casts), src/world.ts:433,566, src/home.ts:105 — first-party server responses dereferenced by cast with no shape parser (contrast image-browser.ts / image-upload.ts in the same package, which use named parsers — the compliant pattern).
- pm-stack/dispatch: src/github.ts casts ({id}, {token, expires_at}, {number, html_url}), src/queue.ts:119,136 TaskRow[] casts, src/auth.ts:109 response deref.
- pm-stack/projector/src/github.ts:191 — generic helper returns
(await res.json()) as T (contrast its own unknown-first sites in the same file); src/server.ts:252,346 inbound req.json() bodies.
- pkgs/atlas-search/worker: inbound casts src/index.ts:75, src/cache_do.ts:82; response casts src/index.ts:92,113.
- pkgs/cold-store-reaper/worker/src/index.js:108 inbound request.json() job deref; :159 resp.json() payload (dist/worker.js is the built copy).
- pkgs/mcpx/plugin/opencode/mcpx/daemon.ts:463,476,537 —
(await res.json()) as T / as Resolution on daemon responses.
- bin/codedb-bridge.mjs:250 response parse raced then dereferenced; bin/provider-catalog-sync.mjs:525 res.json() returned to dereferencing callers.
- Exporter scripts returning API responses unvalidated to dereferencing callers: pm-stack/meta-exporter (:195, :330), pm-stack/supabase-export, pm-stack/opencode-usage-export. (cloudflare-export's GraphQL errors shape is excluded — already fixed under cloudflare-export: GraphQL errors assumed to be an array of {message: string} — other shapes throw TypeErrors misclassified as fetch-failed, and a single-object errors is silently ignored #2608.)
- pm-stack/opencode-claimant (claimant.py, poll.py): queue-broker responses parsed and acted on (session launches) without a shape check. Loopback, token-authed, first-party — lowest risk in this list, same rule.
Acceptance: each numbered item either lands a boundary shape check in the surface's own error vocabulary, or is dispositioned on this issue with the one-line reason it is not a trust boundary. Reference the probe matrix from the contract statement (aggregator README, "Parsed-shape contract (#3068)"): null, array, scalar, {}, each relied-on field wrong-typed. Activitydeveloping-today commented on Nov 9, 2026 added kind/bugSomething isn't working (prefixed form of the classic bug label) effort/lLarge: multi-day or open-ended; expect staged check-ins task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests on Nov 17, 2026dezren39 commented on Nov 17, 2026
🤖 Agent note · triaged (inline triage — 10-item audit follow-up, routed as a chained packet series starting at task 20054)
- Agent: queue worker (repo-worker-code), lane any-c
- Session / ID: task 18559
- Found via: queue claim (bulk-intake triage packet, 2026-11-16)
Triage verdict (fresh, 2026-11-17, via gh):
- Issue follow-up(#3068 Phase 3 audit): parse-boundary shape checks the phases missed (sync-models, id/web, dispatch, projector, atlas-search, cold-store-reaper, mcpx, exporters, claimant) #7983 is OPEN and untouched (no comments beyond a Kaneo link). No hard-stop labels (
held, user/owned, do-not-merge, do-not-auto-edit).
- Work kind: small-fix ×10 (the issue's own instruction: each numbered item is its own small fix, separate small PRs, in the listed risk order). Priority: normal. Effort: l in aggregate (s per item). Labels applied this pass:
kind/bug, priority/normal, effort/l, task/small-fix.
- Evidence: the items come from the Design: parsed is not validated — one shape contract at every JSON trust boundary #3068 Phase 3 closing audit (
doc/2026-11-09_audit_3068-phase3-closing.md) with file:line sites for all 10 boundaries — the scope is precise and pre-verified; no re-audit is needed before item 1.
- Acceptance check (per item): a boundary shape check landed in the surface's own error vocabulary, proven against the contract probe matrix (null, array, scalar, {}, each relied-on field wrong-typed) — or the item dispositioned on this issue with the one-line reason it is not a trust boundary.
Routing — chained packets: the queue supports one live fix packet per issue under the standard dedupe key, so the 10 items run as a chain. Item 1 (bin/sync-models.mjs:127, absence-as-emptiness on the models.dev response) is queued now as task 20054; its packet carries the full remaining-item list and instructs each completing lane to enqueue the next item's packet under the same dedupe key, with the item-10 lane closing this issue.
Task 18559 completes as triaged naming follow-on task 20054. Issue #7983 stays open until the chain finishes. dezren39 commented on Nov 17, 2026 agent-note:v1 — picked up item 1 (bin/sync-models.mjs language-server catalog shape check) via openchamber scheduled lane code-i, task 20054. PR #11197 open. Item 2 packet enqueued (task 20727) under the same dedupe key. dezren39 commented on Nov 26, 2026 Lane 10: item 5 (atlas-search worker checks the query cache's answers before using them) landed in #15352. Worker tests 151/151 and the type-check passed remotely. Item 6 (cold-store-reaper job body) is next from this lane.
Generated by Claude Code dezren39 commented on Nov 26, 2026 Claimed by lane 10, 2026-11-26T03:10Z: item 8 (bin/provider-catalog-sync.mjs: models.dev catalog shape check before use; bin/codedb-bridge.mjs: the tree route's tree field must be a string).
Generated by Claude Code dezren39 commented on Nov 26, 2026 Lane 10: item 6 landed in #15366 (squash 0a8033b). The rehydrator's bundle Durable Object now checks the job body (sha256, bundle_id, drive_file_id, offset, frame_length) before any token exchange or Drive fetch; the token-exchange payload at the second .json() site was already shape-checked under #6989. Worker proof passed on GitHub with the new job-body checks. Release of cold-store-rehydrator from main dispatched.
Generated by Claude Code dezren39 commented on Nov 26, 2026 Claimed by lane 10, 2026-11-26T03:20Z: item 4 (pm-stack/projector: refuse a signed webhook body that is not a JSON object before applyEvent reads it; drop the unused generic ghJson<T> cast helper). The two req.json() sites named in the audit already go through readBoundedJson with field checks (#10635, #2974).
Generated by Claude Code dezren39 commented on Nov 26, 2026 Lane 10: item 8 landed in #15370. provider-catalog-sync now rejects a drifted models.dev catalog (reported as models_dev: unavailable (<reason>) instead of zero models), and codedb-bridge returns an MCP error when the tree route carries no string tree text. The race-then-dereference at codedb-bridge's JSON read was already guarded by the #6917 object check. 71/71 node tests passed on GitHub.
Generated by Claude Code dezren39 commented on Nov 26, 2026 Claimed by lane 10, 2026-11-26T03:55Z: item 9, meta-exporter part (CDP /json/list answers are checked as a target array before .find, so a broken endpoint is cdp-unavailable rather than a TypeError).
Item 3 looks already covered on main: pm-stack/dispatch/src/github.ts parses every GitHub answer through jsonBody/bodyObject/req* (#7101), queue.ts checks the broker envelope and each row with isTaskRow, and auth.ts runs the JWKS body through parseJwks. Lane 10 is not changing it.
Generated by Claude Code dezren39 commented on Nov 26, 2026 Claimed by lane 10, 2026-11-26T04:02Z: item 10, the one unguarded site (dispatch_batch.fetch_task_row iterated the broker's rows without a list check). poll._fetch_rows and the session reads in claimant.py are already shape-checked. It will ship with the item 9 meta-exporter change in one PR.
Generated by Claude Code dezren39 commented on Nov 26, 2026 Lane 10: item 4 landed in #15387. The projector's webhook route now answers a signed non-object body with 400 invalid_payload (audited like invalid JSON) before applyEvent reads it, and the unused ghJson<T> cast helper is gone. Projector tests: 182/182 passed on GitHub.
Generated by Claude Code dezren39 commented on Nov 26, 2026 Lane 10: items 9 (meta-exporter) and 10 (claimant batch dispatch) landed in #15416. Meta exporter 37/37 node tests and dispatch_batch 14/14 unittests passed on GitHub.
With that, every item on this list is done or was already covered on main:
Closing as completed.
Generated by Claude Code
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|