Skip to content

ci: hermetic real-image billing e2e lane (#1843 follow-up, pins the #1857 verification) - #1925

Merged
ranxianglei merged 1 commit into
masterfrom
2026-10-02_image-e2e-lane
Oct 2, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-10-02_image-e2e-lane

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

What

A dedicated CI lane for image billing — the hermetic, permanently-runnable twin of the manual real-image verification that cleared PR #1857 for merge.

tests/e2e/e2e-image-billing.test.ts synthesizes a corpus of structurally real images in pure Node (seeded PRNG, no PIL/ImageMagick, no network, zero tokens):

file shape
shot-1080p.png 1920×1080 PNG, incompressible ~2MB noise body
shot-4k.png 3840×2160 PNG
photo-4032.jpg 4.7MB 4032×3024 JPEG (COM-padded, SOF up front like a camera file)
webp-720.webp 1280×720 VP8L
icon-64 / favicon-16 tiny PNGs
huge-6000x4000.png dims-only PNG
anim-800x600.gif GIF89a
exif-orient6.jpg EXIF orientation 6
truncated.png 1080p cut at 60%
garbage.png PNG magic + 20KB random

Pins the three #1857 failure classes

  1. Parser truth — decodeImageDims recovers every written dimension for all 10 well-formed containers; garbage dims stay inside the tile model's [765, 2805] band; resolveImageBilling(auto) → pixels.
  2. Poison ratio — the 4.7MB photo on a bytes route bills ≥700× its real vision-encoder cost (measured, not assumed — the assertion prints the actual ratio).
  3. Learned rescue e2e — two 4.7MB photos (~12.6MB body) on an explicit imageBilling: "bytes" route: arbitrated forward → usage report teaches the per-image cost (asserted within 1k of the Qwen2-VL truth 15,551) → a stamped stale-high usage baseline no longer bricks the session (forwards clean) → baseline regresses to real billing. Second leg: default auto→pixels route with 2 photos + garbage blob + stale baseline → clean forward, learned under pixels:0, no crash.

CI wiring

  • npm run test:e2e:image (ungated — needs nothing external, ~1.2s locally)
  • .github/workflows/ci-image.yml: ubuntu, node 22, npm ci + typecheck + suite, artifacts (the corpus) on failure; auto-runs on PRs touching src/image-*.ts, src/preflight.ts, src/server.ts, src/cache-ledger.ts, the suite itself, the workflow, or the kernel pin — plus workflow_dispatch
  • AGENTS.md documents the lane next to the other hermetic e2e lanes

Follow-up to #1843 / #1848 (fixed by #1857). No production code touched.

…1857 verification)

tests/e2e/e2e-image-billing.test.ts synthesizes a corpus of structurally
real images in pure Node (valid PNG/JPEG/WebP/GIF containers, real dims,
4.7MB 4032x3024 photo, EXIF orientation, truncated + garbage blobs) and
drives it through the real billing pipeline against a mock upstream billing
the Qwen2-VL formula. Pins the three #1857 failure classes: parser truth,
the >=700x bytes-prior poison ratio, and the learned-cost rescue (12.6MB
arbitrated forward -> usage teaches per-image cost -> stale-high usage
baseline no longer bricks the session -> baseline regresses to real
billing) plus the default auto->pixels route riding a malformed blob.

Runs ungated (~1s, zero network, zero tokens): npm run test:e2e:image.
CI: .github/workflows/ci-image.yml auto-runs on PRs touching image/window
-gate surfaces (src/image-*.ts, preflight, server, cache-ledger, kernel pin).
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-02_image-e2e-lane (1f1a291)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.1921-pr.1925.da8e745

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr1925.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

先合并 后续清理agents.md

@ranxianglei
ranxianglei merged commit c690e5c into master Oct 2, 2026
15 checks passed
@ranxianglei
ranxianglei deleted the 2026-10-02_image-e2e-lane branch October 15, 2026 05:32
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