Skip to content

Runtime: observe only past Free's live-fix limit (the collector's x-genclass-observe reply); first-load limits +0.3 KB - #226

Open
MeharPro wants to merge 2 commits into
mainfrom
feat/runtime-plan-observe-2
Open

MeharPro wants to merge 2 commits into
mainfrom
feat/runtime-plan-observe-2

Conversation

@MeharPro

Copy link
Copy Markdown
Contributor

Owner requests, 2026-11-12: usage limits on errors fixed live, then GenClass strictly observes (plans per project, #224, deployed); and "Yes, raise it" for the first-load budget.

What it does

  • src/telemetry/transport.ts: the fetch transport hands back the collector's x-genclass-observe reply header ({ observe }, null when absent).
  • src/telemetry/client.ts planReply: the header caps the runtime at observe and is remembered per app in localStorage["genclass:observe"] ("<token> <end of the UTC month ms>"), so the next page starts capped; a reply without it lifts the cap and clears the key. A reply the page cannot read (beacon, custom transport) changes nothing.
  • src/runtime.ts capToObserve: one more cap in sessionMode (effectiveMode = min(mode, sample, breaker, plan, route)); one console warning. It only ever lowers the mode.

Rules

  • Rule 1: observe changes nothing, so a correct app is never made worse.
  • Rule 8: a dated exception (AGENTS.md, CONTRACT.md §17): the reply may lower the mode; nothing more is sent; with telemetry off there is no reply and no cap. TELEMETRY.md, both READMEs and the CHANGELOG say so.
  • Rule 3: no model-visible text changes. Rule 5: the month's end comes from the injected Clock.

First load

Growth over main at e4f2eaa (Node 22.23, test/first-load-size.mjs): /auto 108.939 → 109.239 KB (0.300 KB), the main entry 100.672 → 100.964 KB (0.292 KB). test/bundle.test.ts limits raised by 0.3 KB each (109.3 / 101.0 KB), owner OK 2026-11-12; RESULTS.md §14 row added.

Tests

Runtime: typecheck clean, build, 1273 passed / 14 skipped (model parity) with --exclude test/browser/** --exclude test/review-perf.test.ts; two new tests in test/telemetry.test.ts. No review test edited.

Not in this PR: a runtime release (version bump and the v* tag) and a genclass CLI release that installs it; both wait for the owner.

🤖 Generated with Claude Code

MeharPro and others added 2 commits November 12, 2026 17:19
…s live fixes for the month

The telemetry transport hands back the collector's x-genclass-observe header; the client caps the runtime at observe
(only ever lowering the mode), remembers it for the app's key until the UTC month ends so the next page starts
there, and lifts it on a reply without the header. One console line says why. Adds about 0.3 KB to /auto, past its
first-load limit: raising the limit needs the owner's OK (test/bundle.test.ts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed by 0.3 KB (owner OK 2026-11-12); CONTRACT §17, AGENTS rule 8 exception, TELEMETRY, READMEs, CHANGELOG, RESULTS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@genclass-dev

genclass-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown

GenClass runtime review

2 findings in this pull request's tests at 47028aa · 2 reproducible · 5 tests read

# Status Finding Test Seen
1 New Witness, overwrote-newer · GET /api/search [chromium] search.spec.ts > search > buggy page: results of the last query 2 of 2 seeds, reproducible
2 New Witness, overwrote-newer · GET /api/search search.spec.ts > search > buggy page: results of the last query 5 of 5 seeds, reproducible

Reply @genclass-dev replay 1 for the steps to reproduce a finding, or @genclass-dev fix 1 for a brief a coding agent can work from.

The race report, test by test

Race report

2 signatures in 2 tests, 2 reproducible (flagged in 2 or more seeds of the same test) · 19 files read · mode observe

signatures reproducible
Duplicate submits 0 0
Stale responses 0 0
Failing endpoints 0 0
Other detections 0 0
Witnesses (facts measured without the model) 2 2
[chromium] search.spec.ts > search > buggy page: results of the last query

2 seeds (1, 2) · 1 signature · chaos: latency 0–600 ms, reorder

Witnesses (facts measured without the model)

  • Reproducible: 2 of 2 seeds (1, 2) · GET /api/search · witness:overwrote-newer

    The response of GET /api/search#​1 wrote search.results over what newer GET /api/search#​2, started 0.08s after GET /api/search#​1, had written (2 items ["re one", "re two"] → 2 items ["r one", "r two"]).

search.spec.ts > search > buggy page: results of the last query

5 seeds (1, 2, 3, 4, 5) · 1 signature · chaos: latency 0–600 ms, reorder

Witnesses (facts measured without the model)

  • Reproducible: 5 of 5 seeds (1, 2, 3, 4, 5) · GET /api/search · witness:overwrote-newer

    The response of GET /api/search#​1 wrote search.results over what newer GET /api/search#​4, started 0.25s after GET /api/search#​1, had written (2 items ["reac one", "reac two"] → 2 items ["r one", "r two"]).

3 tests with nothing flagged
  • [chromium] search.spec.ts > search > fixed page: results of the last query (2 seeds: 1, 2)
  • search.spec.ts > search > fixed page: results of the last query (5 seeds: 1, 2, 3, 4, 5)
  • search.spec.ts > search > latency only > buggy page, latency only: results of the last query (5 seeds: 1, 2, 3, 4, 5)

Lines under "Witnesses (facts measured without the model)" are happens-before facts the runtime measured in the page without the model, one per signature (witness kind, operation): overwrote-newer, a response wrote a field over what a newer request or the user had written since the request started; identical-in-flight, two identical requests in flight together from separate user actions. They carry no confidence: a fact is listed when it happened. Reproducible: seen in 2 or more seeds of the same test. Whether a fact is a bug is for you to decide (some overwrites are intended; many are repaired a moment later).


genclass-dev[bot] read 19 race files from the artifacts genclass-races-unmodified, genclass-races of this pull request's workflow run, never your source code. What the lines mean · Setup and settings · reply @genclass-dev help

This branch has not been deployed

No deployments
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