Skip to content

Report bounded catalog reconciliation failure details - #71

Merged
FlyOverCoderKY merged 3 commits into
mainfrom
codex/catalog-failure-diagnostics-20261114
Nov 14, 2026
Merged

FlyOverCoderKY merged 3 commits into
mainfrom
codex/catalog-failure-diagnostics-20261114

Conversation

@FlyOverCoderKY

@FlyOverCoderKY FlyOverCoderKY commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Scheduled release reconciliation currently reports only aggregate failure counts, so an operator cannot distinguish a rejected GitHub request, an invalid response, or a projection failure. Extend the existing partial-failure summary with bounded public repository, phase, failure-class, status and response-byte metadata. No raw errors, response content, headers or credentials are logged.

Each normal scheduled invocation selects one repository, so its failure detail is retained in full. Explicit full passes retain at most four details and report how many were omitted. Successful summaries, returned counters, progress semantics, fetch/Store call counts, response limits and package pins remain unchanged.

Validation on current head 1754344685074b2a821d12cbfd486e8cde91aad6:

  • Actual Node 22.18 and 24.18: type checks, all 2,921 ordinary tests, production build and 44 focused regressions passed on each.
  • Current-head GitHub CI passed frozen installation, checks, 2,921 ordinary tests, 256 Native tests, two benchmark tests and production build.
  • Configured OpenRouter follow-up review is clean, with both review lanes healthy and no open findings.

Regressions exercise the real production logger adapters; 200/304/404 and null-body responses; exact and exceeded response-byte limits; fault stages; Store-call preservation; bounded full-pass details; the final scheduled catalog slot; and exclusion of raw response data.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-14T01:39:49.735985Z fa6ec24 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

OpenRouter review posted (clean). #71 (review)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenRouter pull-request review

Verdict: issues
Scope: full-pr (full-pr)
Mode: initial
Commit: fa6ec24d7e02ec9c49f644773034728dd128dcb4
Judge: openai/gpt-5.6-luna (repaired(canonical+1): source coverage preserved before publication cap)
Cost: $0.1866 (lanes $0.1851 + judge $0.0015)

Lanes

  • openai/gpt-6.1-sol: ok (0 finding(s), 32.8s, 114777+972 tokens (76537 cached), 4 tool round(s), via Azure, $0.12)
  • z-ai/glm-5.3-flash: ok (3 finding(s), 479.8s, 1027867+46441 tokens (855040 cached), 19 tool round(s), via River, $0.0608)

Findings

🟠 Issue 1 — failureDetails is the first nested-array log field and the production sink adapters are unverified

worker/src/release-reconciliation.ts:438 · risk · identified by z-ai/glm-5.3-flash

If createCloudflareLogger() (the primary sink in worker/src/logger.ts) serializes or flattens attribute values rather than passing arbitrary JSON through, the new failureDetails array of objects — the core deliverable of this PR — arrives at Cloudflare Workers Logs as a mangled string (e.g. [object Object],[object Object]) or is dropped, and operators lose exactly the diagnostics this change ships for, while the Datadog sink (which provably JSON-serializes attributes in shipDatadogLog) still shows them, making the degradation easy to miss.

Evidence: failureDetails (a ReleaseFailureDetail[]) is added at worker/src/release-reconciliation.ts:438 as a log field on release_reconciliation.partial_failure. I grepped all logger.log(...) calls under worker/src: every existing call passes only flat primitive values, so this is the first nested-array field. The new tests assert against a plain vi.fn logger, so no test can catch sink-side serialization behavior.

Proof gap: @​pegma/logger-cloudflare and @​pegma/logger-tee are external pinned packages and node_modules is not present in the checkout, so I could not read their serialization behavior. The Datadog path is verified safe; only the Cloudflare/tee paths are unverified. A one-line confirmation (or a nested-fields test against createCloudflareLogger) would settle it.

🔵 Issue 2 — bodyBytesSource reports 'streamed' for a 2xx body that was never streamed

worker/src/release-reconciliation.ts:150 · nit · identified by z-ai/glm-5.3-flash

When GitHub (or a proxy) returns a 2xx with a null body, the recorded failure detail claims bytes were consumed from a stream: readBoundedJson sets failure.bodyBytes = 0; failure.bodyBytesSource = 'streamed' (worker/src/release-reconciliation.ts:149-150) before the response.body?.getReader() check, and with a null body it returns { ok: true, value: null } without touching any reader. The run then fails as invalid_release at phase facts with bodyBytes: 0, bodyBytesSource: 'streamed', telling an operator a stream was read when no stream existed — a small accuracy defect in a feature whose purpose is precise triage, and it also makes the interface comment ("source distinguishes a declared oversized length from actual bytes consumed from the stream") slightly overclaim.

What I checked: neither reconciliation test file exercises a 2xx response with a null body (new Response(null, ...) in release-reconciliation.test.ts is only used for 304/404/503, and the diagnostics file never does it either), so the mislabeled path is unpinned. A 'none' source (or setting the fields only once the reader exists) would fix it.

🔵 Issue 3 — Bounded details always record the same first four catalog slots on repeated multi-repo failures

worker/src/release-reconciliation.ts:369 · nit · identified by z-ai/glm-5.3-flash

If several repositories persistently fail, only the first four in RELEASE_CATALOG order are ever reported: failureDetails.push is capped at MAX_FAILURE_DETAILS = 4 (worker/src/release-reconciliation.ts:369) and iteration order is fixed catalog order. Concrete cost: a chronically failing tail repository (e.g. identity or pegma.dev) never appears in any partial_failure log; operators only see failureDetailsOmitted: 9 and must re-run with a narrowed GITHUB_ALLOWED_REPOSITORY_IDS to see its detail.

This looks intentional ("up to four sanitized failure records", omitted counter present) and is documented in the interface comment, so flagging it only so the truncation policy is consciously accepted; a rotating window (or per-repository detail keyed on a follow-up query) would remove the blind spot.

Workflow run

Comment thread worker/src/release-reconciliation.ts Resolved
Comment thread worker/src/release-reconciliation.ts Resolved
Comment thread worker/src/release-reconciliation.ts Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenRouter pull-request review

Verdict: clean
Scope: latest-commit (commit-range)
Mode: verify
Commit: 1754344685074b2a821d12cbfd486e8cde91aad6
Judge: openai/gpt-5.6-luna
Cost: $0.0962 (lanes $0.0961 + judge $0.0001)

Lanes

  • openai/gpt-6.1-sol: ok (0 finding(s), 16.5s, 59394+552 tokens (36167 cached), 3 tool round(s), via Azure, $0.0739)
  • z-ai/glm-5.3-flash: ok (0 finding(s), 192.2s, 419919+24972 tokens (359947 cached), 16 tool round(s), via OpenInference, $0.0221)

Round 2 resolution

  • ✅ r1-1 fixed correctly — failureDetails is the first nested-array log field and the production sink adapters are unverified: The new regression invokes runReleaseReconciliation with the real createAppLogger, exercising the production tee and Cloudflare adapters without mocking them. It asserts that console.error receives the complete structured record, including the nested failureDetails array, and verifies JSON round-trip preservation and exclusion of the body canary.

vitest.config.ts includes this test, and…

  • 2 nit finding(s) from earlier rounds retired (severity floor for follow-up rounds is risk).
  • Open findings after this round: 0 (0 bug-severity).

No structured findings from the successful lane(s).

Workflow run

@FlyOverCoderKY
FlyOverCoderKY merged commit ab16da5 into main Nov 14, 2026
2 checks passed
@FlyOverCoderKY
FlyOverCoderKY deleted the codex/catalog-failure-diagnostics-20261114 branch November 14, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant