Skip to content

feat: typed errors, fault-injection upstream, dev deploy canaries, PR template - #2368

Merged
Th0rgal merged 6 commits into
masterfrom
claude/upbeat-mestorf-87de8d
Nov 30, 2026
Merged

Th0rgal merged 6 commits into
masterfrom
claude/upbeat-mestorf-87de8d

Conversation

@Th0rgal

@Th0rgal Th0rgal commented Nov 30, 2026

Copy link
Copy Markdown
Owner

What and why

Five bugs on 30 Nov passed CI and were found by Thomas using the app (#2352, #2354, #2355, #2358, and an outdated desktop build). This PR adds the Core and ops guards against that class of bug. Sibling PRs: launch admission matrix #2366; client state lint and version-skew notice #2362.

  • Typed errors (docs/specs/typed-errors.md). Orb.ErrorCode is now the one registry of error codes. Each code is either transient (with a reason) or permanent. OrbCore.ErrorClass.classifyText? classifies a harness's error text from three sources only: [orb:<code>] tags, the error JSON's code fields, and the HTTP status (503/504/529). It never matches phrases.

  • Fault-injection upstream (docs/specs/fault-upstream.md). Core serves /__fault/v1/* only when ORB_FAULT_UPSTREAM_KEY is set (dev and tests) and the caller presents that key.

    • It speaks Chat Completions, Responses and Anthropic Messages, streamed or not.
    • Models: fault-ok, fault-503, fault-503x<n>, fault-cut, fault-stall-<ms>, fault-late429-<ms>.
  • Deploy canaries (docs/operations/deploy-canaries.md). orb-deploy runs scripts/ops/orb-deploy-canary on dev and promotes prod only if it passes. The canary:

    • restarts dev and launches the moment /api/health answers;
    • runs one mission per harness × placement (Core host; remote node uruk) on the fault upstream, each to a real first turn;
    • checks that a Pi mission on fault-503x1 recovers;
    • probes the proxy with a cut stream, a stalled first byte, a late 429 and a 503;
    • checks that Mythos with no marked account gets 403 no_cyber_access_account;
    • retries each create with the same idempotency key and checks no ghost mission appears.

    It reports PASS or FAIL to the Orb monitor (new orb-monitor --report). ORB_DEPLOY_CANARY=warn|skip overrides the gate. orb-deploy creates /etc/orb/fault-upstream.env and adds it to the dev unit only.

  • PR template: the "Not verified live" section is now a checklist. Each box must be closed by a named canary check or a linked follow-up.

How it was tested

Built on ashur with scripts/build_orb_bins.sh --only orb-core-test --only orb-spec-runner: build OK. orb-spec-runner --fixtures shared/orb-spec/fixtures: 6 passed (includes the new error-classes replay).

New tests in orb-core-test:

  • ProxyRoutingTests.faultUpstreamFixture: every mode and protocol, the key gate, and the 503 status classification.
  • The real proxy path (dispatchCoreRequest) returns [orb:model_not_found] in the message, and that classifies as permanent.
  • The Infistar recovery vectors were updated to the tagged format, and a vector was added showing that a phrase with no status is not transient.

orb-core-test itself ran on ashur, but SSH to the fleet dropped (YubiKey agent) before I could read its result, so CI is the source of truth for it.

Not verified live

  • The canary script has never run against a real dev Core: it needs this build on dev. Close by running orb-deploy-canary --no-restart on dev after the dev deploy, before the first prod promotion with the gate on (ORB_DEPLOY_CANARY=warn for that first run if needed).
  • Each harness reaches a first turn on the fault upstream (Claude Code via Messages, Codex via Responses, OpenCode/Pi via Chat Completions): closed by canary <harness>@core / <harness>@remote.
  • Antigravity uses its own Google login, so its canary only requires a clean outcome (all its accounts are ToS-disabled since 14 Nov).
  • Client/locald placement is not scriptable from the Core host: follow-up needed (a desktop-side canary).
  • Remote nodes pick up the tagged Pi exit message only after their automatic sandboxed-node update. Until then, a Pi exit on an old node is no longer classified transient.

Notes

  • Dropped the old [done]data: glued-frame match: the proxy now sends a tagged stream_incomplete frame instead.
  • Moved handleFaultUpstream? and tagProxyErrorResponse out of dispatchCoreRequestRaw, which is at its heartbeat budget.

… deploy canaries, PR template

Bugs from 30 Nov passed CI and were found by using the app. This adds the
guards that catch that class before users do.

- Typed errors: `Orb.ErrorCode` is the one registry of error codes
  (transient reason or permanent); `OrbCore.ErrorClass` reads a harness's
  error text by `[orb:<code>]` tags, error JSON code fields and the HTTP
  status, never phrases. The proxy tags every error message whose body
  names a registered code, stream-cut frames carry their tag, and the Pi
  driver's exit error carries `harness_exited`. Replaces the substring
  classifier. Shared vectors: shared/orb-spec/fixtures/error-classes.json,
  replayed by orb-spec-runner.
- Fault-injection upstream: `/__fault/v1/*` in Core, on only when
  ORB_FAULT_UPSTREAM_KEY is set (dev, tests), speaking Chat Completions,
  Responses and Anthropic Messages; models fault-ok, fault-503,
  fault-503x<n>, fault-cut, fault-stall-<ms>, fault-late429-<ms>.
- Deploy canaries: scripts/ops/orb-deploy-canary, run by orb-deploy
  before prod promotion: restart dev and launch at once, harness x
  placement missions on the fault upstream to a real first turn, Pi 503
  recovery, proxy cut/stall/late-429 probes, Mythos 403
  no_cyber_access_account, no ghost missions. Reports via
  `orb-monitor --report`. ORB_DEPLOY_CANARY=warn|skip overrides.
- PR template: "Not verified live" is a checklist closed by a named
  canary or follow-up.
…storf-87de8d

# Conflicts:
#	AGENTS.md
#	scripts/ops/orb-deploy
…ds the message so the 1000-char cut keeps it
@Th0rgal
Th0rgal merged commit 0764f43 into master Nov 30, 2026
33 checks passed
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