Repository navigation
test: add isolated whole-checker CPU qualification harness - #76
Conversation
|
OpenRouter review posted ( |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
OpenRouter pull-request review
Verdict: issues
Scope: full-pr (full-pr)
Mode: initial
Commit: 382d5dd1d0ba01987dd7230f3f0a0b00ff08e65a
Judge: openai/gpt-5.6-luna
Cost: $0.2888 (lanes $0.2848 + judge $0.0040)
Lanes
openai/gpt-6.1-sol: ok (2 finding(s), 59.5s, 223547+2348 tokens (181446 cached), 6 tool round(s), via Azure, $0.16)z-ai/glm-5.3-flash: ok (7 finding(s), 510.6s, 2524419+53714 tokens (2316160 cached), 35 tool round(s), via Cohere, $0.12)
Findings
🟠 Issue 1 — Standalone bundle omitted from automated qualification
worker/wrangler.checker-cpu-stage.jsonc:4 · risk · identified by openai/gpt-6.1-sol
A subsequent SDK, tokenizer or Wrangler change can break this isolated Worker's bundle while the normal CI gate remains green. This fixture has its own entry point and manifest, but neither is bundled by pnpm run check.
package.json runs dry runs only for worker/wrangler.jsonc and worker/wrangler.assistant-stage.jsonc. The new manifest test uses TypeScript's JSONC parser, which verifies JSON syntax and selected values, not Wrangler configuration acceptance or the standalone dependency bundle. Add a binding-free dry-run check for this manifest to the normal qualification path, without adding deployment or resource creation.
I checked package.json, .github/workflows/ci.yml, .github/workflows/deploy.yml, and worker/src/support-checker-cpu-stage.test.ts. The reported manual standalone dry run provides current qualification, but no checked-in gate repeats it after future changes.
🔵 Issue 2 — Unqualified duplicate-refusal claim
docs/SUPPORT_CHECKER_CPU_STAGE.md:68 · nit · identified by openai/gpt-6.1-sol
Publishing the same first-use selector again after Cloudflare replaces the isolate performs another complete checker invocation rather than refusing it. The guide currently says duplicate deliveries refuse model work without limiting that guarantee to the same entry/isolate.
createCheckerCpuStage stores seen only in an entry-local Set. A new isolate starts with an empty set, and a newly published duplicate has attempts === 1, so both admission guards accept it. Qualify the duplicate-refusal statement as isolate-local and distinguish it from rejection of broker redeliveries through message.attempts.
I checked the entry implementation, the four-delivery and refusal tests, and the guide's isolate-reuse caveat. The latter correctly limits warm pairing, but does not qualify duplicate refusal. Durable global deduplication would conflict with the stated binding-free boundary; a documentation correction is sufficient.
🟠 Issue 3 — New stage manifest has no automated Wrangler validation gate, unlike both existing manifests
worker/wrangler.checker-cpu-stage.jsonc:1 · risk · identified by z-ai/glm-5.3-flash
A future edit to worker/wrangler.checker-cpu-stage.jsonc that Wrangler's schema would reject — for example a near-miss key like "d1_database": [...] (singular) or "var": {...} instead of vars — passes the entire CI pipeline, and the operator then discovers the problem only when executing the manual deployment step this fixture exists for. The binding-free guarantee the doc and test advertise is enforced only against the exact plural key names, so a misspelled binding block slips past expect(config).not.toHaveProperty('d1_databases') while CI stays green.
The repo already mechanizes manifest validation for the other two manifests: pnpm run check runs check:worker and check:assistant-stage (both wrangler deploy --dry-run runs, per package.json), and src/worker-config.test.ts reads worker/wrangler.jsonc through Wrangler's real unstable_readConfig parser. The new manifest is instead validated only by parseConfigFileTextToJson in worker/src/support-checker-cpu-stage.test.ts:225, which is a generic JSONC parser — it checks syntax plus a handful of asserted keys and cannot catch unknown keys, wrong types in unasserted fields, or bundling/schema errors. deploy.yml deploys only wrangler.jsonc, so nothing else exercises this manifest.
What I checked: package.json scripts, .github/workflows/ci.yml and deploy.yml, src/worker-config.test.ts, and the new test's parsing approach. The PR body's one-time manual dry-run is not a repo gate for future changes.
🔵 Issue 4 — Doc claim "Compatibility matches the current host" is not pinned by the manifest test
worker/src/support-checker-cpu-stage.test.ts:225 · nit · identified by z-ai/glm-5.3-flash
If a later edit drifts compatibility_date away from 2026-07-28 or drops nodejs_compat, CI stays green while the doc's "Compatibility matches the current host" (docs/SUPPORT_CHECKER_CPU_STAGE.md:40) silently becomes false. That claim is load-bearing for this fixture's purpose: CPU measurements from this worker are only comparable to the production checker's CPU when both run under the same runtime compatibility settings.
The manifest test (worker/src/support-checker-cpu-stage.test.ts:225) asserts main, workers_dev, preview_urls, routes, crons, the consumer shape, binding absence and invocation_logs, but never asserts config.compatibility_date === '2026-07-28' or config.compatibility_flags containing nodejs_compat, even though both match worker/wrangler.jsonc today. I checked the test block and the production manifest for the expected values; the assertion gap is the only missing piece.
🔵 Issue 5 — counterEntryUse label is set before the run, so held records can claim a tokenizer request that never happened
worker/src/support-checker-cpu-stage-entry.ts:105 · nit · identified by z-ai/glm-5.3-flash
A delivery whose fixture run fails before any token-count call — e.g. the expired-evidence path, where model.resolve() returns null before the counter is ever invoked — still logs counterEntryUse: 'first-request-by-entry' (or, for a later delivery, 'previous-request-by-entry') in its held record, and every subsequent delivery's label is permanently shifted even though zero tokenizer requests occurred. The field exists precisely to let an operator "distinguish per-input first-use from the optional counter module's first request by this entry" (doc line 85-86), so the label is unreliable exactly in the failure cases where the operator is diagnosing why samples mismatched.
The mechanism: counterEntryRequested = true is set unconditionally at worker/src/support-checker-cpu-stage-entry.ts:105, immediately after building the sample and before runCheckerCpuFixture runs; it is not derived from actual counter activity. In success paths the label is accurate (the counter is always called), so tests pass; only no-count failure paths produce a false label. I checked all failure orderings in runCheckerCpuFixture: expired/disabled/digest-mismatch resolve() failures are the only reachable no-count paths.
🔵 Issue 6 — Held outcomes log no failure reason, making inconclusive runs indistinguishable
worker/src/support-checker-cpu-stage-entry.ts:122 · nit · identified by z-ai/glm-5.3-flash
When a sample fails, the terminal record is always the identical { event: 'finish', outcome: 'held' } shape: the catch block at worker/src/support-checker-cpu-stage-entry.ts:119-122 discards the error entirely, with no bounded reason code. An operator whose first-use delivery ends held cannot tell from the invocation record whether the fixture expired (the 2027-01-01 fictional qualification), the transport fence fired, the wire check failed, or the budget refused — the expired-evidence test itself (support-checker-cpu-stage.test.ts:205-225) demonstrates the uninformative record. The protocol then says missing/mismatched samples are "inconclusive", which the operator cannot resolve without re-running locally.
Every error in this fixture is fixture-generated or a classifier-safe SDK error (no request content reaches an error message: the scripted response never fails parsing, and the counter's TypeError carries no text), so a bounded reason (e.g. error name/message prefix, matching the repo's existing log-classification style in logger.ts) would be safe to log. I checked each reachable throw site in runCheckerCpuFixture for content leakage before concluding a reason field is safe; none carries untrusted content in the exercised paths.
🔵 Issue 7 — Doc says the scripted response "uses uncertain verdicts only", but publicReproduction is not_applicable
docs/SUPPORT_CHECKER_CPU_STAGE.md:18 · nit · identified by z-ai/glm-5.3-flash
A reader auditing docs/SUPPORT_CHECKER_CPU_STAGE.md:18 ("the local scripted response uses uncertain verdicts only") against scriptedVerdict in worker/src/support-checker-cpu-stage.ts:123-131 finds a seventh verdict field, publicReproduction: 'not_applicable', which is neither uncertain nor covered by the sentence. The claim is otherwise accurate for the five dimensions that are uncertain; the fix is a one-word doc correction (e.g. "uncertain/not_applicable verdicts only"). I verified the scripted verdict object and the parser-facing response construction; no other verdict value appears.
🔵 Issue 8 — New manifest omits account_id, unlike the sibling stage manifest, adding deploy friction outside the documented protocol
worker/wrangler.checker-cpu-stage.jsonc:2 · nit · identified by z-ai/glm-5.3-flash
An operator following the doc's deployment step (wrangler deploy -c worker/wrangler.checker-cpu-stage.jsonc) in a non-interactive shell without CLOUDFLARE_ACCOUNT_ID exported gets a Wrangler account-resolution failure, while the same flow works for worker/wrangler.assistant-stage.jsonc because that manifest pins account_id: ef243694ddbe86b2d5e2a68e857ee28c. The doc's operator protocol (lines 71-74) says to bind "source/tree, lockfile, Worker version, queue, effective plan and deployed consumer settings" but never mentions the account binding.
I compared the two stage manifests field by field; account_id is the only structural difference besides the intentional vars/D1 differences. The impact is deploy friction rather than breakage (the env var or an interactive wrangler login session resolves it), which is why this is a nit.
🔵 Issue 9 — New CPU-stage doc is orphaned — no inbound links from the composition or checker-upgrade docs
docs/SUPPORT_CHECKER_CPU_STAGE.md:1 · nit · identified by z-ai/glm-5.3-flash
docs/SUPPORT_CHECKER_CPU_STAGE.md is referenced by nothing in the repo: docs/SUPPORT_COMPOSITION.md links only SUPPORT_ASSISTANT_STAGE.md and SUPPORT_CHECKER_UPGRADE.md, and docs/SUPPORT_CHECKER_UPGRADE.md — which mandates exactly "a separate current-build cold/warm CPU measurement and quota acceptance gate" (its final sections) — links no harness. An operator working from the composition or checker-upgrade docs, the two places that talk about the Free CPU acceptance gate, has no path to the fixture that implements it.
I grepped the whole repo for SUPPORT_CHECKER_CPU_STAGE, checker-cpu and CHECKER_CPU: the only references are the doc's own outbound links and the new source files themselves. Cost is discoverability only; no build or test references the doc.
There was a problem hiding this comment.
OpenRouter pull-request review
Verdict: clean
Scope: latest-commit (commit-range)
Mode: verify
Commit: 7d08b7f261c6399cadec0bee4f953b1de774b214
Judge: openai/gpt-5.6-luna
Cost: $0.0950 (lanes $0.0948 + judge $0.0001)
Lanes
openai/gpt-6.1-sol: ok (0 finding(s), 17.2s, 62308+720 tokens (39338 cached), 3 tool round(s), via Azure, $0.0754)z-ai/glm-5.3-flash: ok (0 finding(s), 217.0s, 246845+19767 tokens (204544 cached), 7 tool round(s), via InferenceNet, $0.0194)
Round 2 resolution
- ✅
r1-1fixed correctly — Standalone bundle omitted from automated qualification:package.jsonnow includescheck:checker-cpu-stageinpnpm run check. That script runs Wrangler's standalone deployment dry run againstworker/wrangler.checker-cpu-stage.jsonc, bundling its separate entry point into a dedicated output directory. Both CI and the deployment workflow invoke the normal check gate; the dry run does not deploy the fixture. - ✅
r1-3fixed correctly — New stage manifest has no automated Wrangler validation gate, unlike both existing manifests: The normal qualification gate now invokes Wrangler against the checker CPU manifest, matching the existing manifests' dry-run validation approach. The manifest test additionally asserts the exact top-level key inventory, rejecting misspelled or additional binding/configuration blocks, and verifies compatibility settings against the production manifest. The Node test suite includes this test, and C… - 7 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).
Adds a separate queue-only fixture for measuring the complete published Support Desk 0.2.12 independent checker with the actual GPT-5.4 token counter. Four declared deliveries exercise two unchanged fictional inputs on first use and warm reuse; the provider and credential stay in-process. The protocol requires actual platform invocation CPU and correlation evidence before drawing a result.
The production manifests, package pins, customer settings and existing resources are unchanged. This PR creates no cloud resources and establishes no deployed CPU or model-quality result.
Validation:
pnpm run checkpassed after rebasing onto current main.The effective Workers Free queue-consumer CPU allowance remains a platform qualification item; the fixture does not assume the generic HTTP allowance applies.