## Public Exports

### `index.ts`
`State`, `Backend`, `BackendResolutionSource`, `WorkerBackendResolutionSource`, `BACKENDS`, `ExitReason`, `ALL_EXITS`, `isFailedExit`, `isFailureExit`, `Step`, `ALL_STEPS`, `VALID_STEPS`, `TicketTier`, `TicketTierBudget`, `TICKET_TIER_BUDGETS`, `FALSE_EPIC_THRESHOLD`, `VALID_ACTIVITY_EVENTS`, `ActivityEventType`, `ActivityEvent`, `ActivityLogEntry`, `ActivityEventSource`, `ActivityGatePayload`, `PromiseTokens`, `PROMISE_TOKEN_STRINGS`, `hasToken`, `wrapToken`, `StateError`, `LockError`, `TransactionError`, `SchemaVersionMismatchError`, `InvalidActivityEventError`, `SchemaVersionDeployDriftError`, `VALID_EFFORTS`, `ReasoningEffort`, `ARTIFACT_PREFIXES`, `WorkerRole`, `hasLifecycleArtifact`, `ALL_TICKET_STATUSES`, `TicketStatus`, `StateFlags`, `ReadinessState`, `ReadinessCycleHistoryEntry`, `PhasePersona`, `ProjectContext`, `CourseCorrectionRecord`, `ChangeProposal`, `ErrorRecord`, `DebateRound`, `Defaults`, `STATE_MANAGER_DEFAULTS`, `LATEST_SCHEMA_VERSION`, `StateErrorCode`, `HookInput`, `PostToolUseFailureInput`, `LastToolErrorState`, `PipelineRunnerExitCode`, `IterationExitType`, `IterationExitResult`, `IterationOutcome`, `RateLimitInfo`, `RateLimitAction`, `SessionMapEntry`, `UpdateCheckCache`, `ReleaseAsset`, `ReleaseInfo`, `UpdateSettings`, `PickleSettings`, `UpdateStatus`, `UpdateResult`, `UpgradeResult`, `MicroverseExitReason`, `MICROVERSE_FATAL_REASONS`, `MicroverseFatalReason`, `STATE_SCHEMA_VERSION_AHEAD_EXIT_REASON`, `StateSchemaVersionAheadExitReason`, `isMicroverseFailureExit`, `MicroverseMetric`, `FailureClass`, `StallCategory`, `StallRecoveryAction`, `StallClassification`, `ClassifiedFailure`, `MicroverseHistoryEntry`, `ViolationLedger`, `Violation`, `JudgeResult`, `MicroverseSessionState`, `GateFailure`, `GateMode`, `GateResult`, `GateBaselineFile`, `RemediationResult`, `CreateMicroverseOpts`, `BuildErrorCode`, `Diagnostic`, `ValidationResult`, `BuildError`, `MicroverseOpts`, `WorkspaceOpts`, `StylesheetOverride`, `StylesheetConfig`, `ConvergenceSpec`, `PhaseSpec`, `DefenseMatrix`, `BuildResult`, `BuilderSpec`, `StateManagerOptions`.

### `attractor-schema.fallback.ts`
`AttrScope`, `AttrType`, `AttrDef`, `FallbackSchema`, `ATTRACTOR_SCHEMA_FALLBACK`, `ALL_ATTRS`, `lookupAttr`, `validateAttrType`, `AttrValidation`, `validateAttrs`.

### `engine-keys-registry.ts`
`EngineKeysRegistry`.

### `plumbus-frame-analyzer.ts`
`ContextKeyRow`, `DiamondRoutingRow`, `CycleRow`, `AnalyzerOutput`, `Node`, `Edge`, `Graph`.

## Trap Doors

- `activity-events.schema.json` (R-SJET-3/R-SJET-4 optional gate_payload fields on `judge_measurement_attempted`) — The `gate_payload` object for `judge_measurement_attempted` accepts three OPTIONAL fields added by R-SJET-3 and R-SJET-4; these are NOT in `required` and will be absent on older emitter versions: `nested_claude_detected` (boolean — whether `isNestedClaude()` returned true at spawn time; from R-SJET-3 env-isolation detection), `pre_spawn_env_key_names` (string[] — sorted list of env-var key names present in the sanitized judge env after `buildJudgeSpawnEnv()` stripping, never values; from R-SJET-3), `judge_backend_used` (string — actual resolved backend ('claude'|'codex') selected by `resolveJudgeBackend()` at spawn time, reflects sticky fallback; from R-SJET-4). Emitter: `microverse-runner.ts:measureLlmMetricAttempt`. Schema definition: `extension/src/types/activity-events.schema.json` definitions/judge_measurement_attempted. See `docs/judge-spawn-troubleshooting.md` for operator context. BREAKS: adding these to `required` silently invalidates every existing `judge_measurement_attempted` emission that predates R-SJET-3/R-SJET-4. ENFORCE: extension/tests/activity-event-payload.test.js.
- `activity-events.schema.json` — INVARIANT: prompt catalogs must list every schema-required payload key. BREAKS: analyst ACs cite invalid event contracts. ENFORCE: `spawn-refinement-team` prompt test. PATTERN_SHAPE: docs table row for schema-backed events; INVARIANT: schema event definitions must equal `writeActivityEntry` fields. BREAKS: validators and contract tests bless wrong telemetry. ENFORCE: payload and spawn-path regression tests. PATTERN_SHAPE: emitter fields differ from event definition; INVARIANT: `worker_gate_failed.gate_phase` enum must cover every `runWorkerGate` phase, including `test:integration`. BREAKS: full-tier worker failures emit telemetry the canonical schema rejects. ENFORCE: `extension/tests/spawn-morty-worker-gate.test.js`, `extension/tests/activity-event-payload.test.js`. PATTERN_SHAPE: `worker_gate_failed` schema enum vs `type WorkerGatePhase = 'lint' | 'tsc' | 'test:fast' | 'test:integration'`.
- `activity-events.schema.json` (R-PDD-oneOf) — INVARIANT: every event-type entry under `definitions` (excluding shared enums `backendEnum`, `backendResolutionSourceEnum`, `workerBackendResolutionSourceEnum`) MUST also be referenced from the top-level `oneOf` array via `{ "$ref": "#/definitions/<event>" }`. Definition without oneOf-membership means schema-walking consumers (Ajv `compile(schema)` + validate) reject every emission because no oneOf branch matches; per-definition `validate(payload, defName)` tests still pass, masking the drift. Same regression class as iter-7 (ticket_audit_failed missing schema entirely). All known siblings now guarded at iter-13 HEAD: phantom_done_detected (iter-11), cap_check_skipped_stale_cache (iter-12), standup_session_dropped (iter-13) — pattern grep emits zero lines. BREAKS: a future event added by `definitions[]` without oneOf-update (commit a70db8f0 phantom-Done pattern) silently fails downstream schema validation. ENFORCE: extension/tests/phantom-done-detected-schema-conformance.test.js, extension/tests/cap-check-skipped-stale-cache-schema-conformance.test.js, extension/tests/standup-session-dropped-schema-conformance.test.js (per-event, including the R-PDD-oneOf invariant assertion); extension/tests/ticket-audit-failed-schema-conformance.test.js, extension/tests/time-cap-disabled-default-schema-conformance.test.js, extension/tests/worker-partial-lifecycle-exit-schema-conformance.test.js, extension/tests/install-pkgjson-version-trace.test.js. PATTERN_SHAPE: `node -e "const s=require('./extension/src/types/activity-events.schema.json'); const refs=new Set(s.oneOf.map(o=>o.\$ref.replace('#/definitions/',''))); const SHARED=new Set(['backendEnum','backendResolutionSourceEnum','workerBackendResolutionSourceEnum']); for (const k of Object.keys(s.definitions)) if (!SHARED.has(k) && !refs.has(k)) console.log(k);"` MUST emit zero lines.
- `index.ts` — INVARIANT: `State.effort` values must stay aligned with setup CLI and codex spawn unions, including `xhigh`. BREAKS: persisted effort overrides are rejected or dropped before codex argv emission. ENFORCE: setup/backend-spawn/spawn-morty effort regression tests. PATTERN_SHAPE: `'low' | 'medium' | 'high'` union guarding `state.effort` or `VALID_EFFORTS`.
- `index.ts` (R-PSSS empty-scope events) — INVARIANT: `VALID_ACTIVITY_EVENTS` must include `anatomy_park_empty_scope_skip` and `szechuan_sauce_empty_scope_skip`; both events also need matching `definitions/*` + top-level `oneOf` `$ref` entries in `activity-events.schema.json` and a registration row in the source TS array + compiled `extension/types/index.js` mirror. The emitters live in `src/bin/pipeline-runner.ts:resolveAnatomySubsystems` and `shouldSkipSzechuanForEmptyScope` and write `gate_payload.in_scope_paths` (+ `gate_payload.discovered_subsystems` for anatomy). BREAKS: dropping either event from the registry makes the empty-scope skip silent again — the operator-visible WARN (R-PSSS-1/2 trap door in `src/bin/CLAUDE.md`) loses its activity-log counterpart. ENFORCE: `extension/tests/pipeline-empty-scope-skip-schema-conformance.test.js`, `extension/tests/activity-event-payload.test.js`. PATTERN_SHAPE: `anatomy_park_empty_scope_skip|szechuan_sauce_empty_scope_skip`.
- `index.ts` (R-PSSS-3 PhaseSetupResult) — INVARIANT: `PhaseSetupResult = true | { skipReason: PhaseSkipReason }` and `PhaseSkipReason = 'empty_scope' | 'no_subsystems' | 'setup_error'` are exported from `pipeline-runner.ts` (the per-phase skip contract); `PipelineStatus` carries an additive optional `phase_skips?: Record<string, PhaseSkipReason>` map. Older `pipeline-status.json` files without `phase_skips` MUST still parse. BREAKS: collapsing `PhaseSetupResult` back to `boolean` loses the per-phase skip disposition and the final summary line. ENFORCE: `extension/tests/anatomy-park-scope.test.js`, `extension/tests/szechuan-scope.test.js`. PATTERN_SHAPE: `PhaseSetupResult|PhaseSkipReason|phase_skips`.
- `src/types/index.ts` (VALID_ACTIVITY_EVENTS) — INVARIANT: every new activity event type must be added to `VALID_ACTIVITY_EVENTS` before `log-activity.js` will accept it; runtime callers validate against this set, and schema conformance tests assert the array round-trips into the JSON schema. BREAKS: new event types are silently rejected by the logger or produce schema-non-conformant emissions. ENFORCE: extension/tests/activity-event-payload.test.js.
- `src/types/index.ts` (ExitReason / isFailureExit) — INVARIANT: `isFailureExit` and `isFailedExit` are the canonical predicates for classifying exit_reason values; inline string comparisons against the `ExitReason` union are forbidden. BREAKS: new exit reasons added to `ExitReason` but not to `isFailureExit` make `auto-resume.sh` R-CNAR-4(c) misclassify terminal exits and loop on non-failure cases. ENFORCE: extension/tests/auto-resume-stop-conditions.test.js.
