rig-review 2.6.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/REVIEW_PACKAGE.md +48 -10
- package/docs/STABILITY.md +232 -15
- package/package.json +1 -1
- package/src/job-act.ts +316 -8
- package/src/job-api.ts +821 -8
- package/src/job-contract.ts +299 -0
- package/src/job-front.ts +763 -23
- package/src/job-host.ts +9 -1
- package/src/job-hub.ts +11 -6
- package/src/job-session.ts +68 -9
- package/src/job-source.ts +787 -7
- package/src/job-store.ts +114 -8
- package/src/job-worker.ts +5 -1
package/docs/REVIEW_PACKAGE.md
CHANGED
|
@@ -1058,21 +1058,34 @@ agent, UI and read-only writer requests. The reviewer binding records trusted
|
|
|
1058
1058
|
bootstrap provenance. Supplied sources stay immutable, and agents never create
|
|
1059
1059
|
internal Review state, act files or writer binding files.
|
|
1060
1060
|
|
|
1061
|
+
Each `startJobHub` listener start mints one shared canonical lowercase UUIDv4
|
|
1062
|
+
`listenerIncarnation` across all jobs registered on that hub. Opening additional
|
|
1063
|
+
jobs preserves that incarnation, and stopping and restarting the hub rotates
|
|
1064
|
+
`listenerIncarnation` alongside the hub capability and `workspace` query. Each
|
|
1065
|
+
`hub.openJob` call returns a required non-null detached deeply frozen
|
|
1066
|
+
`job.attachment: JobHostReuseExpectation` derived directly from the owning hub
|
|
1067
|
+
context, including when a compact on-disk `job-ui/<jobId>.json` descriptor omits
|
|
1068
|
+
`listenerIncarnation` at the 65,536-byte limit. Passing a runtime
|
|
1069
|
+
`reuseOnly` property to `hub.openJob` rejects with `JOB_REQUEST_INVALID`
|
|
1070
|
+
(`JobHubJobOptions = Omit<JobHostOptions, 'stateDir' | 'port' | 'reviewer' | 'reuseOnly'>`).
|
|
1071
|
+
|
|
1061
1072
|
Closing one job revokes its writer grant while other jobs and the shared owner
|
|
1062
1073
|
continue. `await hub.stop()` stops transport and disposes sessions while
|
|
1063
1074
|
preserving active durable jobs and their grants. Restart re-registers the
|
|
1064
1075
|
required callbacks and refreshes writer origins. Active job identity and grants
|
|
1065
|
-
persist, while the hub capability and `workspace`
|
|
1076
|
+
persist, while the hub capability, `listenerIncarnation` and `workspace`
|
|
1077
|
+
incarnation query rotate and invalidate prior strict `reuseOnly` expectations.
|
|
1066
1078
|
Closed retained entries count toward the current hub's 32-entry application
|
|
1067
1079
|
bound. The bound provides no hardware performance guarantee.
|
|
1068
1080
|
|
|
1069
|
-
Compatible same-job
|
|
1070
|
-
|
|
1071
|
-
`
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1081
|
+
Compatible same-job `startJobHost` attachment remains supported via both
|
|
1082
|
+
ordinary authenticated reuse and strict `reuseOnly: {expected}` attachment,
|
|
1083
|
+
which skips `installWriterBinding` during strict bootstrap. Hub registration
|
|
1084
|
+
refuses an active external standalone owner with `JOB_HUB_EXTERNAL_HOST` and a
|
|
1085
|
+
live unresponsive owner with `JOB_HUB_HOST_UNRESPONSIVE`. General cross-process
|
|
1086
|
+
callback registration remains deferred. External consumer-owned adoption remains
|
|
1087
|
+
pending in [Review #512](https://github.com/rig-c/review/issues/512). Public
|
|
1088
|
+
signatures and the host-owned integration example are in
|
|
1076
1089
|
[Public API stability](STABILITY.md#embedded-semantic-job-hub) and
|
|
1077
1090
|
[Embedded semantic jobs](WORKFLOWS.md#embedded-semantic-jobs).
|
|
1078
1091
|
|
|
@@ -1088,12 +1101,16 @@ the host-owned integration example are in
|
|
|
1088
1101
|
- Consumer only, `rig-review session fetch-act <job-url> --act <actId> --consumer-capability-stdin [--still-out <existing-directory>]`. The trusted consumer pipes its existing grant on stdin. New rig acts require `--still-out`.
|
|
1089
1102
|
Agent verbs authenticate with `RIG_REVIEW_JOB_AGENT_CAPABILITY` (`Authorization: Bearer …`) against `http://127.0.0.1:<port>/jobs/<jobId>` and refuse `fetch-act` (`JOB_AUTHORITY_REFUSED`). See [Standing live job workflow](WORKFLOWS.md#standing-live-job-workflow) for an ordinary-package launch, bootstrap and explicit close example.
|
|
1090
1103
|
- **Bootstrap-declared reviewer.** `JobReviewerBinding` (`id` and `role` as `'owner'` or `'delegate'` inside `JobHumanAuthority`) is declared by trusted host bootstrap when opening the window. The browser UI cannot type, edit or override this binding. It records bootstrap-declared provenance rather than keyboard-user authentication. Create maps `role` to its existing `by` authority and preserves the declared reviewer identity.
|
|
1091
|
-
- **Trusted host ports and public managed-host startup seam.** `JobHostPorts` separates `handleJobApi` (which accepts agent verbs and consumer `fetch-act` only) from closed same-origin UI routes (`readPublication`, `commitUIAct`, `ackDisplayed`, `jobLiveness`, `subscribeJob`, mounted by `createJobFront` under `/jobs/<jobId>/…` with sealed retained publication routes; the standalone owner HTML root accepts the default or literal `?lang=en` or `?lang=ko` only) that remain unavailable to agent tokens. Raw `Request` objects preserve real `Origin`, capability, body size and abort context. A TypeScript value is never authentication evidence. In the public managed-host startup seam (`startJobHost(options: JobHostOptions): Promise<JobOwnerHost>` from `@rig-c/review/job-host`, where `JobHostOptions extends JobWorkerOptions` adds `readerId?: string`, `bindingId?: string` and `
|
|
1104
|
+
- **Trusted host ports and public managed-host startup seam.** `JobHostPorts` separates `handleJobApi` (which accepts agent verbs and consumer `fetch-act` only) from closed same-origin UI routes (`readPublication`, `commitUIAct`, `ackDisplayed`, `jobLiveness`, `subscribeJob`, mounted by `createJobFront` under `/jobs/<jobId>/…` with sealed retained publication routes; the standalone owner HTML root accepts the default or literal `?lang=en` or `?lang=ko` only) that remain unavailable to agent tokens. Raw `Request` objects preserve real `Origin`, capability, body size and abort context. A TypeScript value is never authentication evidence. In the public managed-host startup seam (`startJobHost(options: JobHostOptions): Promise<JobOwnerHost>` from `@rig-c/review/job-host`, where `JobHostOptions extends JobWorkerOptions` adds `readerId?: string`, `bindingId?: string`, `partsEnumeratorId?: string` and `reuseOnly?: {readonly expected: JobHostReuseExpectation}`, and `JobOwnerHost` includes `attachment: JobHostReuseExpectation | null`, frozen in [Public API stability](STABILITY.md#managed-owner-host)), each present hook (`readPublished`, `installWriterBinding`, `partsEnumerator`) requires a nonempty declared ID and a missing hook requires its ID to be absent (`JOB_HOST_OPTION_ID_INVALID`). Equal declared IDs, API/act schemas and actual enumerator versions permit authenticated active-listener reuse across processes and newly allocated function objects via `/jobs/<jobId>/host` (`schema: 'rig-review-job-host/1'`). Differing IDs, hook presence differences and unrecorded older listener IDs fail by name (`JOB_HOST_REUSE_MISMATCH`) with the option name and both IDs while preserving the existing listener. No function hashes are used. `installWriterBinding` receives `{jobId, origin, fetchCapability}` after reuse validation and runs on a matching new or ordinary reused host.
|
|
1105
|
+
|
|
1106
|
+
`@rig-c/review/job-host` exports `JobHostListenerIncarnation`, `JobHostReuseBinding`, `JobHostReuseExpectation`, `JobHostAttachField` and `JobHostAttachFailure` as types while preserving the twelve runtime exports. Each standalone or hub listener start mints a fresh canonical lowercase UUIDv4 `listenerIncarnation` (`^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$`) via `randomUUID()` that rotates on listener stop and restart. `GET /jobs/<jobId>/host` retains its exact legacy `JobHostRecord` projection, key order and raw bytes without `listenerIncarnation` or `attachment`. Complete live binding attestation uses the internal authenticated `POST /jobs/<jobId>/host` route (`X-Review-Capability` UI grant and exact normalized `Origin`, with no public helper export) exchanging `{expected, observed: {root, stateDir, store, record}}` (safe nonnegative `{dev, ino}` integers for `root`, `stateDir`, `jobs.sqlite` and `job-ui/<jobId>.json`) for `{ok: true, attachment, pid}`. Each `job-ui/<jobId>.json` descriptor, each `POST /jobs/<jobId>/host` request and each `POST /jobs/<jobId>/host` response has a 65,536-byte (`WORKSPACE_BODY_LIMIT`) ceiling. When adding `listenerIncarnation` would exceed 65,536 bytes, `job-ui/<jobId>.json` omits `listenerIncarnation` so ordinary start and reuse still succeed with `attachment: null` while strict `reuseOnly` refuses `JOB_HOST_ATTACH_REFUSED` with `reason: 'incarnation-missing'` and `phase: 'record'`. Opaque hook IDs and fingerprints are bounded by each 65,536-byte descriptor, request and response envelope without separate 1,024-byte or 4,096-byte field caps.
|
|
1107
|
+
|
|
1108
|
+
`startJobHost` inspects the `reuseOnly` property descriptor before invoking getters, rejecting a `reuseOnly` getter or accessor immediately with `JOB_REQUEST_INVALID` without invoking the getter. When `reuseOnly` is absent or `undefined`, `startJobHost` uses the ordinary `{...options}` startup path and preserves existing ordinary getter, prototype and callback behavior. When `reuseOnly: {expected}` is provided, `startJobHost` snapshots own data properties (including non-enumerable declared fields) of `options`, `reviewer`, `partsEnumerator` and `reuseOnly.expected` (`binding` and `binding.reviewer`) via `Reflect.ownKeys` and property descriptors before the first `await` or session allocation, retaining callbacks by reference and rejecting non-plain objects, symbol keys, unknown keys, or getters and accessors with `JOB_REQUEST_INVALID` without invoking getters. Strict `reuseOnly: {expected}` bootstrap invokes zero callbacks and performs zero allocations or writes, leaving an empty bootstrap write set on both success and refusal. It resolves existing `stateDir` without creating directories, refuses symlinks, hardlinks and SQLite `-wal`, `-shm` or `-journal` sidecars without recovery, inspects existing `jobs.sqlite` in read-only mode without creating files (`SQLITE_OPEN_READONLY | SQLITE_OPEN_NOFOLLOW`, `PRAGMA query_only=ON`), and stages `JobSession.openReadOnly` before the single final `POST /jobs/<jobId>/host` probe (refusing drift after staging with `JOB_HOST_ATTACH_REFUSED`, `reason: 'race'` and `phase: 'adoption'`). It preserves literal `http://127.0.0.1:<decimal-port>` in `origin` (`1..65535`, including explicit port 80 while comparing `Origin` against normalized `new URL(origin).origin`), enforces a 1,500 ms client total deadline and `redirect: 'error'` alongside a 10,000 ms server body deadline, and orders owner acceptance inside a synchronous deferred SQLite read transaction against `sealClose` (`BEGIN IMMEDIATE`, HTTP 409 with `reason: 'closed'` and `phase: 'acceptance'`) and stop flags (HTTP 503 with `reason: 'stopped'` and `phase: 'acceptance'`). Later semantic writes lazily reopen the same existing `jobs.sqlite` file with `SQLITE_OPEN_READWRITE | SQLITE_OPEN_NOFOLLOW`. `JobHostAttachFailure` is the closed union of `{code: 'JOB_HOST_ATTACH_REFUSED', reason, phase}` (`reason` in `'missing' | 'closed' | 'incarnation-missing' | 'replaced' | 'read' | 'probe' | 'stopped' | 'race'` and `phase` in `'input' | 'state' | 'record' | 'probe' | 'adoption' | 'acceptance'`) and `{code: 'JOB_HOST_REUSE_MISMATCH', field, expected, actual}` (`field` as `JobHostAttachField`, `expected` and `actual` as `string | null`).
|
|
1092
1109
|
- **Standing window and visual gate.** Every owner visual, question, choice, correction and verdict goes through one standing Review window/link plus one what-to-look-at line (a job survives zero open owner tabs and reuses the same active job/link on later `session open` until explicit `close`). Internal agent and HQ media stay internal. Each `JobPublication` reports `visual` with `status` set to `'available'` or `'unavailable'` with a named `code`. A missing required visual is an immediate stop plus a Create-filed on-path Review card, never a chat fallback.
|
|
1093
1110
|
|
|
1094
1111
|
### Publication, producer-held freeze and generation CAS
|
|
1095
1112
|
|
|
1096
|
-
- **Mutating requests and CAS.** Agent mutations (`publish`, `ask`, `close` in `JobMutation`) require `expectedGeneration` (a nonnegative safe integer) and `idempotencyKey` alongside `schema` (`rig-review/job-api@2`), `jobId` and `requestId`. Stale generations refuse with `JOB_GENERATION_STALE` and conflicting idempotency payloads refuse with `JOB_IDEMPOTENCY_CONFLICT`.
|
|
1113
|
+
- **Mutating requests and CAS.** Agent mutations (`publish`, `ask`, `close` in `JobMutation`) require `expectedGeneration` (a nonnegative safe integer) and `idempotencyKey` alongside `schema` (`rig-review/job-api@2`), `jobId` and `requestId`. Stale generations refuse with `JOB_GENERATION_STALE` and conflicting idempotency payloads refuse with `JOB_IDEMPOTENCY_CONFLICT`. When `handleJobApi` (`POST /jobs/<jobId>/api`) catches a thrown refusal, the failure envelope `generation: number` reports `session.lastObservedGeneration`, which is the last durable generation this session observed successfully in storage and is carried in memory without rereading failing storage inside `catch`. That value reports the last observed session generation while preserving the original named refusal code and message (such as `JOB_STORAGE_FAILED` when SQLite files are removed or replaced) and keeping the numeric `generation: number` response type unchanged. A failed session constructor exposes no API ports when its initial storage read fails. Success responses continue to report current `session.status().generation`.
|
|
1097
1114
|
- **Explicit producer-held freeze.** `JobPublishRequest` designates a root-relative `result` (`path` and nullable `selector`, never a command) and requires `freeze` with `kind` set to `'producer-held'`, `holdId` and `record` (`JobFileIdentity` for the exact record used for selection, or `null` for a declared non-Create root) held until acknowledgment. Review validates retained bytes, detects a moved or incomplete record (`JOB_FREEZE_REQUIRED`, `JOB_RECORD_INCOMPLETE`, `JOB_RECORD_MOVED`, `JOB_SOURCE_MISMATCH`, `JOB_SOURCE_UNRETAINABLE`, `JOB_ROOT_REPLACED`) and commits local CAS. The freeze assertion is a caller obligation on the publishing producer or agent, not a lock Review can impose on independent writers.
|
|
1098
1115
|
- **Managed-state privacy boundary.** Managed state stays behind the host ports. The canonical work root and configured managed-state directory must be disjoint. A root equal to, inside or containing that state directory refuses `JOB_SOURCE_UNRETAINABLE` before job admission, including directory aliases resolved through symlink ancestors. Existing root identity failures, including a directly symlinked source root, retain `JOB_ROOT_REPLACED`. Trusted publication handles follow the origin job's lifetime, and publishing callers must maintain their producer-held freeze.
|
|
1099
1116
|
- **Explicit close lifecycle.** Review offers no watched-root or automatic-close guarantee. Only an explicit `close` request (`JobCloseRequest` with `reason`) ends an active job (`status` transitions from `'active'` to `'closed'`, and subsequent mutations or fetches refuse with `JOB_CLOSED`).
|
|
@@ -1170,3 +1187,24 @@ The manifest and complete retained image rows enter the composite source hash. L
|
|
|
1170
1187
|
- **Agent isolation and capability lifecycle.** The consumer writer reads its own sibling binding directly. Agents never construct, parse or carry Review session, picks, verdict, applied-record or sibling-binding files. Actual separate-UID isolation remains required for Review's distinct state unreadability test (`JOB_AGENT_ISOLATION_HOLE`), and no same-user forger-resistance claim is made. The random per-job bearer capability grants finalized act fetch (`fetch-act`) only, via exact loopback routes and `Authorization`. Neither `next` nor `status` returns it, and human metadata alone never authenticates a fetch. The capability dies at explicit `close`, old project history cannot restore it, each new job incarnation receives a new grant, invalid grants refuse with `JOB_CAPABILITY_REQUIRED` or `JOB_AUTHORITY_REFUSED` and closed-job fetches refuse with `JOB_CLOSED`. No self-service grant API exists.
|
|
1171
1188
|
- **Consumer deduplication and future in-process mesh consumption.** Consumer writers deduplicate `actId` before current-source checks, then validate each new source and atomically commit the writer result plus replay identity. Replaying an applied `actId` returns the existing record, while a new stale act refuses before mutation. Verdict, signoff and stage transition remain three separate consumer writes. Once `mesh-edit` is jointly frozen with [Parts #1159](https://github.com/rig-c/parts/issues/1159), Create will fetch a finalized mesh act and pass its typed value in process to Parts' public exported API owned by [Parts #1159](https://github.com/rig-c/parts/issues/1159), with Parts reading neither Review nor Create storage and taking no Create-project argument, while standalone `--delta` remains legacy outside this cycle.
|
|
1172
1189
|
- **Error codes.** `JOB_ERROR_CODES` enumerates the closed refusal set (`JOB_REQUEST_INVALID`, `JOB_BODY_LIMIT`, `JOB_LOOPBACK_REQUIRED`, `JOB_SAME_ORIGIN_REQUIRED`, `JOB_CAPABILITY_REQUIRED`, `JOB_AUTHORITY_REFUSED`, `JOB_UNKNOWN`, `JOB_CLOSED`, `JOB_GENERATION_STALE`, `JOB_IDEMPOTENCY_CONFLICT`, `JOB_FREEZE_REQUIRED`, `JOB_RECORD_INCOMPLETE`, `JOB_RECORD_MOVED`, `JOB_SOURCE_MISMATCH`, `JOB_SOURCE_UNRETAINABLE`, `JOB_ROOT_REPLACED`, `JOB_PUBLICATION_UNKNOWN`, `JOB_SNAPSHOT_RECLAIMED`, `JOB_IMAGE_SET_UNSUPPORTED`, `JOB_IMAGE_SET_INVALID`, `JOB_IMAGE_SET_DUPLICATE_NAME`, `JOB_IMAGE_SET_DUPLICATE_PATH`, `JOB_IMAGE_SET_ROLE_INVALID`, `JOB_IMAGE_SET_PATH_REFUSED`, `JOB_ASK_INVALID`, `JOB_ASK_SUPERSEDED`, `JOB_ACT_UNKNOWN`, `JOB_ACT_INVALID`, `JOB_ACT_KIND_DISABLED`, `JOB_ACT_SOURCE_STALE`, `JOB_DISPLAY_MISMATCH`, `JOB_CURSOR_INVALID`, `JOB_STORAGE_FAILED`, `JOB_AGENT_ISOLATION_HOLE`), each returning bounded safe detail with no arbitrary worker text or private paths.
|
|
1190
|
+
|
|
1191
|
+
### Preparatory model-free record contract and source seam
|
|
1192
|
+
|
|
1193
|
+
`src/job-contract.ts`, `src/job-api.ts`, `src/job-source.ts` and `src/job-act.ts` define the preparatory implementation-stage contract, validators, snapshot retention and act-preparation seam for Review #561. Create #277 owns the landed public `readRecordPublished` export and `JOB_RECORD_READER_ID` (`rig-create/publication-reader/2`), while complete closure, path and `parts` conformance remains open in Create #286. [Review #561](https://github.com/rig-c/review/issues/561), [Create #277](https://github.com/rig-c/create/issues/277), [Create #286](https://github.com/rig-c/create/issues/286).
|
|
1194
|
+
|
|
1195
|
+
`JOB_API_SCHEMA` (`rig-review/job-api@2`), `JOB_ACT_SCHEMA` (`rig-review/act@2`), `JOB_CAPABILITIES` (`{imageSetVerdict: true}`) and the `@rig-c/review/job-host` facade exports keep their existing package-only default behavior. The normal host (`createJobHostPorts` and `JobSession`) parses `rig-review/job-api@2` requests and rejects `rig-review/job-api@3` or tagged record publish requests with HTTP 400 (`JOB_REQUEST_INVALID` / `JOB_API_SCHEMA_MISMATCH`), leaving generation and committed head unchanged. Runtime activation of the opted-in record mode remains gated on Review #563 shared store, session and front paths, Create #286 closure, path and `parts` conformance, Create #278 writer consumer fetch, ingest and freeze integration, and Review's actual fixture proof against the producer-landed Create #279 fixtures. [Review #563](https://github.com/rig-c/review/issues/563), [Create #286](https://github.com/rig-c/create/issues/286), [Create #278](https://github.com/rig-c/create/issues/278), [Create #279](https://github.com/rig-c/create/issues/279).
|
|
1196
|
+
|
|
1197
|
+
| Surface | Exact keys or closed values |
|
|
1198
|
+
| --- | --- |
|
|
1199
|
+
| `PublishResultV3` | `{kind, path, selector}` (`package`), `{kind, questionId, setId}` (`option-set`), `{kind}` (`plan`) |
|
|
1200
|
+
| `RecordFreeze` | `{kind: 'producer-held', holdId, record: {path: 'project.json', sha256}}` |
|
|
1201
|
+
| `RecordSubject` | `{kind: 'interview-picks', questionId, setId}`, `{kind: 'checkpoint', checkpointId}`, `{kind: 'signoff', stage}` (`plan-approved`, `rigging-interview`, `post-interview`) |
|
|
1202
|
+
| `RecordPublishedContext` | `['label', 'parts', 'inputs', 'files', 'plan', 'subjects']` |
|
|
1203
|
+
| `RecordPartsIdentity` | `['name', 'version', 'integrity']` |
|
|
1204
|
+
| `RecordSource` | `['sourceHash', 'projectHash', 'record', 'inputs', 'files', 'subject', 'selection', 'optionSet', 'optionSetFile', 'plan', 'subjects']` |
|
|
1205
|
+
| `rig-review-job-record-source/1` | `['schema', 'record', 'selection', 'inputs', 'optionSet', 'optionSetFile', 'plan', 'subjects', 'files']` |
|
|
1206
|
+
| `rig-review-job-record-instance/1` | `['schema', 'fingerprint', 'sourceHash']` |
|
|
1207
|
+
|
|
1208
|
+
The read-only official reader returns the six-key `RecordPublishedContext` with producer-sealed `parts`. `prepareJobRecordSource` runs `phase: 'inventory'` on the immutable source root and retains the sorted, duplicate-free `inventory.files` closure into an owned snapshot (`project.json` within 8 MiB, at most 4,096 regular non-symlink files, 64 MiB per file and 256 MiB total bytes). It then calls `phase: 'retained'` on the snapshot root with `parts: inventory.parts` forwarded unchanged and requires `assertEqualRecordContexts(inventory, retainedContext)`. Before ask or finalize, `verifyJobRecordSourceFresh` re-runs `phase: 'inventory'`, rejects any `inventory.parts` drift against the originally sealed `retained.context.parts` (`JOB_SOURCE_MISMATCH` on ask and `JOB_ACT_SOURCE_STALE` on finalize) before invoking `phase: 'retained'`, and forwards the sealed `retained.context.parts` unchanged when equal. Missing reader or contract tokens (`CREATE_PUBLICATION_CONTRACT_UNAVAILABLE`, `CREATE_PLAN_PUBLICATION_CONTRACT_UNAVAILABLE`) refuse with `JOB_SOURCE_UNRETAINABLE`, while named producer tokens (`JOB_RECORD_CLOSURE_INCOMPLETE`, `JOB_RECORD_PARTS_MISMATCH`, `JOB_RECORD_PARTS_LOCK_MISSING`) map to `JOB_RECORD_INCOMPLETE` on publish or ask and `JOB_ACT_SOURCE_STALE` on finalize.
|
|
1209
|
+
|
|
1210
|
+
`interview-picks` records carry `plan: null` and remain valid for source preparation, ask binding and `rig-review/act@4` preparation. An inspection-only plan record with `plan: {steps: []}` and `subjects: []` is valid for source preparation and freshness checks, while plan `checkpoint` and `signoff` ask binding and `rig-review/act@4` preparation require non-empty `plan.steps` and declared subjects (`JOB_ASK_INVALID` / `JOB_ACT_INVALID`). Focused unit tests use synthetic reader doubles and remain distinct from actual Create conformance.
|
package/docs/STABILITY.md
CHANGED
|
@@ -18,12 +18,58 @@ C4 changes `JobPartsManifestPath`, `JobPartImagePath`, `JobPartsIdentity` and th
|
|
|
18
18
|
import {startJobHost} from '@rig-c/review/job-host';
|
|
19
19
|
import type {
|
|
20
20
|
JobHostOptions, JobOwnerHost, JobHostPorts,
|
|
21
|
+
JobHostListenerIncarnation, JobHostReuseBinding, JobHostReuseExpectation,
|
|
22
|
+
JobHostAttachField, JobHostAttachFailure,
|
|
21
23
|
JobSessionOptions, JobSession, JobWorkerOptions,
|
|
22
24
|
JobPublicationReader, JobPublishedContext,
|
|
23
25
|
} from '@rig-c/review/job-host';
|
|
24
26
|
|
|
25
27
|
function startJobHost(options: JobHostOptions): Promise<JobOwnerHost>;
|
|
26
28
|
|
|
29
|
+
type JobHostListenerIncarnation = string;
|
|
30
|
+
|
|
31
|
+
interface JobHostReuseBinding {
|
|
32
|
+
readonly root: string;
|
|
33
|
+
readonly stateDir: string;
|
|
34
|
+
readonly fingerprint: string;
|
|
35
|
+
readonly reviewer: JobReviewerBinding;
|
|
36
|
+
readonly readerId: string | null;
|
|
37
|
+
readonly bindingId: string | null;
|
|
38
|
+
readonly partsEnumeratorId: string | null;
|
|
39
|
+
readonly partsEnumeratorVersion: string | null;
|
|
40
|
+
readonly apiSchema: typeof JOB_API_SCHEMA;
|
|
41
|
+
readonly actSchema: typeof JOB_ACT_SCHEMA;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface JobHostReuseExpectation {
|
|
45
|
+
readonly jobId: JobId;
|
|
46
|
+
readonly origin: string;
|
|
47
|
+
readonly listenerIncarnation: JobHostListenerIncarnation;
|
|
48
|
+
readonly binding: JobHostReuseBinding;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
type JobHostAttachField =
|
|
52
|
+
| 'jobId' | 'origin' | 'listenerIncarnation'
|
|
53
|
+
| 'root' | 'stateDir' | 'fingerprint'
|
|
54
|
+
| 'reviewer.id' | 'reviewer.role'
|
|
55
|
+
| 'readerId' | 'bindingId' | 'partsEnumeratorId'
|
|
56
|
+
| 'partsEnumeratorVersion' | 'apiSchema' | 'actSchema' | 'port';
|
|
57
|
+
|
|
58
|
+
type JobHostAttachFailure =
|
|
59
|
+
| {
|
|
60
|
+
readonly code: 'JOB_HOST_ATTACH_REFUSED';
|
|
61
|
+
readonly reason: 'missing' | 'closed' | 'incarnation-missing'
|
|
62
|
+
| 'replaced' | 'read' | 'probe' | 'stopped' | 'race';
|
|
63
|
+
readonly phase: 'input' | 'state' | 'record'
|
|
64
|
+
| 'probe' | 'adoption' | 'acceptance';
|
|
65
|
+
}
|
|
66
|
+
| {
|
|
67
|
+
readonly code: 'JOB_HOST_REUSE_MISMATCH';
|
|
68
|
+
readonly field: JobHostAttachField;
|
|
69
|
+
readonly expected: string | null;
|
|
70
|
+
readonly actual: string | null;
|
|
71
|
+
};
|
|
72
|
+
|
|
27
73
|
interface JobSessionOptions {
|
|
28
74
|
readonly root: string;
|
|
29
75
|
readonly stateDir: string;
|
|
@@ -48,6 +94,9 @@ interface JobHostOptions extends JobWorkerOptions {
|
|
|
48
94
|
readonly readerId?: string;
|
|
49
95
|
readonly bindingId?: string;
|
|
50
96
|
readonly partsEnumeratorId?: string;
|
|
97
|
+
readonly reuseOnly?: {
|
|
98
|
+
readonly expected: JobHostReuseExpectation;
|
|
99
|
+
};
|
|
51
100
|
}
|
|
52
101
|
|
|
53
102
|
type JobPublicationReader = (input: {
|
|
@@ -92,6 +141,7 @@ interface JobOwnerHost {
|
|
|
92
141
|
readonly origin: string;
|
|
93
142
|
readonly ownerUrl: string;
|
|
94
143
|
readonly reused: boolean;
|
|
144
|
+
readonly attachment: JobHostReuseExpectation | null;
|
|
95
145
|
stop(): void;
|
|
96
146
|
}
|
|
97
147
|
|
|
@@ -110,6 +160,27 @@ interface JobHostPorts {
|
|
|
110
160
|
readonly busy: boolean;
|
|
111
161
|
}>>;
|
|
112
162
|
}
|
|
163
|
+
|
|
164
|
+
const attached = await startJobHost({
|
|
165
|
+
...options,
|
|
166
|
+
reuseOnly: {expected},
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
interface InternalJobHostAttachRequest {
|
|
170
|
+
readonly expected: JobHostReuseExpectation;
|
|
171
|
+
readonly observed: {
|
|
172
|
+
readonly root: {readonly dev: number; readonly ino: number};
|
|
173
|
+
readonly stateDir: {readonly dev: number; readonly ino: number};
|
|
174
|
+
readonly store: {readonly dev: number; readonly ino: number};
|
|
175
|
+
readonly record: {readonly dev: number; readonly ino: number};
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
interface InternalJobHostAttachResponse {
|
|
180
|
+
readonly ok: true;
|
|
181
|
+
readonly attachment: JobHostReuseExpectation;
|
|
182
|
+
readonly pid: number;
|
|
183
|
+
}
|
|
113
184
|
```
|
|
114
185
|
|
|
115
186
|
`root` designates the producer work root. `stateDir` must be outside that root.
|
|
@@ -141,17 +212,137 @@ never migrated, relabelled or rebound to new approvals.
|
|
|
141
212
|
|
|
142
213
|
`readPublished` supplies the producer's published semantic context for the exact
|
|
143
214
|
frozen record. `installWriterBinding` receives the private finalized-act fetch
|
|
144
|
-
grant after reuse validation on each successful new or reused startup. The trusted
|
|
215
|
+
grant after reuse validation on each successful new or ordinary reused startup. The trusted
|
|
145
216
|
writer adapter owns its private binding and storage. A callback failure rejects
|
|
146
217
|
startup with `JOB_AUTHORITY_REFUSED`. `afterSnapshot` and `afterDirectorySync` are
|
|
147
218
|
optional disposable-test boundary hooks inherited from the existing seam.
|
|
148
219
|
|
|
220
|
+
Each standalone `startJobHost` and internal `startJobWorker` listener start mints a
|
|
221
|
+
fresh canonical lowercase UUIDv4 `listenerIncarnation` via `randomUUID()`. The format
|
|
222
|
+
matches `^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$` in
|
|
223
|
+
exact lowercase with version `4`, variant `8|9|a|b` and zero leading or trailing
|
|
224
|
+
whitespace. Stopping and restarting a listener on the same port, `jobId`, PID and
|
|
225
|
+
durable grants rotates `listenerIncarnation`.
|
|
226
|
+
|
|
227
|
+
`GET /jobs/<jobId>/host` preserves its exact legacy `JobHostRecord` projection, key
|
|
228
|
+
order and raw bytes without `listenerIncarnation` or `attachment`. Complete live
|
|
229
|
+
binding attestation uses the internal authenticated `POST /jobs/<jobId>/host` route
|
|
230
|
+
with the `X-Review-Capability` UI grant and exact normalized `Origin`. That internal
|
|
231
|
+
route has no public helper or wire-type export. It accepts
|
|
232
|
+
`{expected, observed: {root, stateDir, store, record}}` with safe nonnegative
|
|
233
|
+
`{dev, ino}` integers for `root`, `stateDir`, `jobs.sqlite` and
|
|
234
|
+
`job-ui/<jobId>.json`, and returns `{ok: true, attachment, pid}` on HTTP 200.
|
|
235
|
+
|
|
236
|
+
On a newly started standalone host (`reused === false`) or an ordinary reused host
|
|
237
|
+
whose descriptor carries `listenerIncarnation` and whose POST attestation succeeds,
|
|
238
|
+
`host.attachment` is a detached deeply frozen `JobHostReuseExpectation`. Ordinary
|
|
239
|
+
compatible reuse (`reuseOnly` omitted) keeps its `GET /jobs/<jobId>/host`
|
|
240
|
+
compatibility decision, `installWriterBinding` invocation timing and `ownerUrl`.
|
|
241
|
+
Ordinary reuse returns `attachment: null` when `listenerIncarnation` or the
|
|
242
|
+
additional POST attestation is unavailable.
|
|
243
|
+
|
|
244
|
+
Each `job-ui/<jobId>.json` descriptor, each `POST /jobs/<jobId>/host` request and
|
|
245
|
+
each `POST /jobs/<jobId>/host` response has a 65,536-byte (`WORKSPACE_BODY_LIMIT`)
|
|
246
|
+
ceiling. When adding `listenerIncarnation` to `job-ui/<jobId>.json` would exceed
|
|
247
|
+
65,536 UTF-8 bytes, the writer omits `listenerIncarnation` and writes the compact
|
|
248
|
+
legacy descriptor. Ordinary start and reuse still succeed with `attachment: null`,
|
|
249
|
+
while strict `reuseOnly` refuses `JOB_HOST_ATTACH_REFUSED` with
|
|
250
|
+
`reason: 'incarnation-missing'` and `phase: 'record'`. Opaque hook IDs and
|
|
251
|
+
fingerprints are bounded by each 65,536-byte descriptor, request and response
|
|
252
|
+
envelope without separate 1,024-byte or 4,096-byte field caps.
|
|
253
|
+
|
|
254
|
+
`startJobHost` inspects the `reuseOnly` property descriptor before invoking getters.
|
|
255
|
+
A `reuseOnly` getter or accessor rejects immediately with `JOB_REQUEST_INVALID`
|
|
256
|
+
without invoking the getter. When `reuseOnly` is absent or `undefined`,
|
|
257
|
+
`startJobHost` uses the ordinary `{...options}` startup path and preserves existing
|
|
258
|
+
ordinary getter, prototype and callback behavior. When `reuseOnly: {expected}` is
|
|
259
|
+
provided, `startJobHost` snapshots own data properties (including non-enumerable
|
|
260
|
+
declared fields) of `options`, `reviewer`, `partsEnumerator` and
|
|
261
|
+
`reuseOnly.expected` (`binding` and `binding.reviewer`) via `Reflect.ownKeys` and
|
|
262
|
+
property descriptors before the first `await` or session allocation, retaining
|
|
263
|
+
function callbacks by reference. In that strict branch, non-plain objects, symbol
|
|
264
|
+
keys, unknown keys and getters or accessors reject immediately with
|
|
265
|
+
`JOB_REQUEST_INVALID` without invoking getters.
|
|
266
|
+
|
|
267
|
+
When `reuseOnly: {expected}` is provided, `startJobHost` validates `expected` against
|
|
268
|
+
the snapped caller options (`root`, `stateDir`, `fingerprint`, `reviewer.id`,
|
|
269
|
+
`reviewer.role`, `readerId`, `bindingId`, `partsEnumeratorId`,
|
|
270
|
+
`partsEnumeratorVersion`, `apiSchema`, `actSchema`, literal
|
|
271
|
+
`http://127.0.0.1:<decimal-port>` `origin` in `1..65535` including explicit
|
|
272
|
+
`http://127.0.0.1:80`, optional `port` matching the origin port, `jobId` and
|
|
273
|
+
canonical lowercase UUIDv4 `listenerIncarnation`). Option, schema, hook presence or
|
|
274
|
+
value mismatches reject with `JOB_REQUEST_INVALID`, `JOB_STORED_SCHEMA_MISMATCH`,
|
|
275
|
+
`PARTS_ENUMERATOR_VERSION_MISMATCH`, `JOB_HOST_OPTION_ID_INVALID` or
|
|
276
|
+
`JOB_HOST_REUSE_MISMATCH` (`field`, `expected` and `actual`). This includes cases
|
|
277
|
+
where `expected.binding` has an explicit `null` for an omitted hook ID while the
|
|
278
|
+
caller supplies that callback or enumerator, or the reverse.
|
|
279
|
+
|
|
280
|
+
Strict `reuseOnly: {expected}` bootstrap invokes zero callbacks (`installWriterBinding`,
|
|
281
|
+
`readPublished`, `partsEnumerator.enumerate`, `afterSnapshot`, `afterDirectorySync`)
|
|
282
|
+
and performs zero job allocations (`JobStore.open`), DDL, `chmod` or journal-mode
|
|
283
|
+
changes. Its bootstrap write set is empty on both success and refusal. It resolves
|
|
284
|
+
existing `stateDir` without creating directories (`destinationDirectory(..., false)`),
|
|
285
|
+
requires private owned entries without symlinks or hardlinks, and refuses SQLite
|
|
286
|
+
`-wal`, `-shm` or `-journal` sidecars without running recovery. It inspects existing
|
|
287
|
+
`jobs.sqlite` in read-only mode without creating files (`SQLITE_OPEN_READONLY | SQLITE_OPEN_NOFOLLOW`,
|
|
288
|
+
`PRAGMA query_only=ON`), validates `job-ui/<jobId>.json` and PID liveness before
|
|
289
|
+
sending credentials, and stages a read-only session for that exact job
|
|
290
|
+
(`JobSession.openReadOnly`) before the single final `POST /jobs/<jobId>/host` probe.
|
|
291
|
+
After staging, it rechecks `root`, `stateDir`, `store`, `record`, `job-ui`,
|
|
292
|
+
descriptor bytes, revision, UI capability and full binding. Any drift refuses
|
|
293
|
+
`JOB_HOST_ATTACH_REFUSED` with `reason: 'race'` and `phase: 'adoption'`.
|
|
294
|
+
|
|
295
|
+
Literal `http://127.0.0.1:<decimal-port>` is preserved in `expected.origin` and
|
|
296
|
+
`attachment.origin` including explicit port 80, while the HTTP `Origin` header check
|
|
297
|
+
compares against normalized `new URL(origin).origin` (`http://127.0.0.1` for port 80).
|
|
298
|
+
The client probe enforces a 1,500 ms total deadline across headers and body
|
|
299
|
+
(`AbortSignal.timeout(1500)` plus a bounded body read up to 65,536 bytes within the
|
|
300
|
+
remaining time) and `redirect: 'error'` so redirects are refused without following.
|
|
301
|
+
Failed or aborted reads cancel and release their readers. The server enforces a
|
|
302
|
+
10,000 ms body deadline (`jobBody(request, 65536)`).
|
|
303
|
+
|
|
304
|
+
After body parsing, the owner executes a synchronous acceptance section inside a
|
|
305
|
+
deferred SQLite read transaction (`db.transaction(...).deferred()`). It checks
|
|
306
|
+
published, stopped and accepting flags (including standalone `stopped` and hub
|
|
307
|
+
`closing`) and request abort, verifies UI capability, active job status and full
|
|
308
|
+
binding, checks `listenerIncarnation` and captured, current and observed `{dev, ino}`
|
|
309
|
+
identities (`root`, `stateDir`, `store`, `record`) plus exact descriptor bytes,
|
|
310
|
+
rechecks accepting and abort flags, freezes `{ok: true, attachment, pid}` and
|
|
311
|
+
finishes the read transaction. Because the deferred read transaction holds a SQLite
|
|
312
|
+
read snapshot while `sealClose` commits with `BEGIN IMMEDIATE`, acceptance and close
|
|
313
|
+
execute in a single serial order. A prior committed close returns HTTP 409 with
|
|
314
|
+
`reason: 'closed'` and `phase: 'acceptance'`. A concurrent close waits for the read
|
|
315
|
+
snapshot, and a close or stop after acceptance is an ordinary subsequent lifecycle
|
|
316
|
+
event. Standalone or hub stop initiated before or during body parsing returns HTTP
|
|
317
|
+
503 with `reason: 'stopped'` and `phase: 'acceptance'`. `JobHostAttachFailure` is a
|
|
318
|
+
closed two-member union of `{code: 'JOB_HOST_ATTACH_REFUSED', reason, phase}`
|
|
319
|
+
(`reason` in `'missing' | 'closed' | 'incarnation-missing' | 'replaced' | 'read' | 'probe' | 'stopped' | 'race'`
|
|
320
|
+
and `phase` in `'input' | 'state' | 'record' | 'probe' | 'adoption' | 'acceptance'`)
|
|
321
|
+
and `{code: 'JOB_HOST_REUSE_MISMATCH', field, expected, actual}` (`field` as
|
|
322
|
+
`JobHostAttachField`, `expected` and `actual` as `string | null`).
|
|
323
|
+
|
|
149
324
|
`session` retains its existing trusted-host `JobSession` type, including
|
|
150
325
|
`jobId`, `hostCredentials()` and `status()` for bootstrap and inspection.
|
|
151
326
|
`JobSession` is exported as a type for `host.session`. The host separates agent, owner UI and writer
|
|
152
327
|
credentials through their respective channels. Only explicit semantic `close`
|
|
153
328
|
ends a job and revokes its writer grant. `stop()` disposes this host handle and
|
|
154
|
-
stops its owned listener. A reused handle
|
|
329
|
+
stops its owned listener. A reused handle (including strict `reuseOnly` with
|
|
330
|
+
`reused === true` and non-null `attachment`) disposes only its local session and leaves
|
|
331
|
+
the owner listener running. On a strict attached handle, reads use the read-only
|
|
332
|
+
SQLite connection. A later semantic write (`publish`, `ask`, `close`, `ackDisplayed`,
|
|
333
|
+
`commitUIAct`) lazily reopens the same existing `jobs.sqlite` file with
|
|
334
|
+
`SQLITE_OPEN_READWRITE | SQLITE_OPEN_NOFOLLOW` (omitting `SQLITE_OPEN_CREATE`) and
|
|
335
|
+
rechecks storage and exact job identity in the first `IMMEDIATE` transaction.
|
|
336
|
+
|
|
337
|
+
When `handleJobApi` (`POST /jobs/<jobId>/api`) catches a thrown refusal, the failure
|
|
338
|
+
envelope `generation: number` reports `session.lastObservedGeneration`. That value is
|
|
339
|
+
the last durable generation this session observed successfully in storage, carried in
|
|
340
|
+
memory without rereading failing storage inside `catch`. It represents the last
|
|
341
|
+
observed session value while preserving the original named refusal code and message
|
|
342
|
+
(such as `JOB_STORAGE_FAILED` when SQLite files are removed or replaced) and keeping
|
|
343
|
+
the numeric `generation: number` response type unchanged. A failed session
|
|
344
|
+
constructor exposes no API ports when its initial storage read fails. Success
|
|
345
|
+
responses continue to report current `session.status().generation`.
|
|
155
346
|
|
|
156
347
|
Managed state is private storage accessed through the host ports. The canonical
|
|
157
348
|
work root and configured managed-state directory must be disjoint. Before job
|
|
@@ -196,6 +387,7 @@ use `rig-review/job-api@2` and `rig-review/act@2`.
|
|
|
196
387
|
import {startJobHub} from '@rig-c/review/job-host';
|
|
197
388
|
import type {
|
|
198
389
|
JobHubOptions, JobHubJobOptions, JobHubJob, JobOwnerHub,
|
|
390
|
+
JobHostReuseExpectation,
|
|
199
391
|
} from '@rig-c/review/job-host';
|
|
200
392
|
|
|
201
393
|
function startJobHub(options: JobHubOptions): Promise<JobOwnerHub>;
|
|
@@ -206,7 +398,7 @@ interface JobHubOptions {
|
|
|
206
398
|
readonly port?: number;
|
|
207
399
|
}
|
|
208
400
|
|
|
209
|
-
type JobHubJobOptions = Omit<JobHostOptions, 'stateDir' | 'port' | 'reviewer'>;
|
|
401
|
+
type JobHubJobOptions = Omit<JobHostOptions, 'stateDir' | 'port' | 'reviewer' | 'reuseOnly'>;
|
|
210
402
|
|
|
211
403
|
interface JobHubJob {
|
|
212
404
|
readonly session: JobSession;
|
|
@@ -214,6 +406,7 @@ interface JobHubJob {
|
|
|
214
406
|
readonly origin: string;
|
|
215
407
|
readonly jobUrl: string;
|
|
216
408
|
readonly reused: boolean;
|
|
409
|
+
readonly attachment: JobHostReuseExpectation;
|
|
217
410
|
}
|
|
218
411
|
|
|
219
412
|
interface JobOwnerHub {
|
|
@@ -233,6 +426,15 @@ active job with a different reviewer refuses `JOB_AUTHORITY_REFUSED`.
|
|
|
233
426
|
The human receives the hub owner URL once. Agents receive their own per-job
|
|
234
427
|
bootstrap credentials privately and address `/jobs/<jobId>/api`.
|
|
235
428
|
|
|
429
|
+
Each `startJobHub` listener start mints one canonical lowercase UUIDv4
|
|
430
|
+
`listenerIncarnation` shared across all jobs registered on that hub. Opening
|
|
431
|
+
additional jobs on the same hub preserves that incarnation. Each `openJob` call
|
|
432
|
+
returns a required non-null detached deeply frozen `job.attachment: JobHostReuseExpectation`
|
|
433
|
+
derived directly from the owning hub context, including when a compact on-disk
|
|
434
|
+
`job-ui/<jobId>.json` descriptor omits `listenerIncarnation` at the 65,536-byte
|
|
435
|
+
limit. Passing a runtime `reuseOnly` property to `hub.openJob` rejects with
|
|
436
|
+
`JOB_REQUEST_INVALID`.
|
|
437
|
+
|
|
236
438
|
Each job keeps its own identity, source bindings, generation CAS, idempotency
|
|
237
439
|
keys, cursors, asks, acts, display receipts and agent/UI/writer grants. Hook IDs
|
|
238
440
|
follow the existing `JobHostOptions` rules. Reopening an active root and
|
|
@@ -242,8 +444,10 @@ cross-process callback registration is deferred. The hub refuses an active
|
|
|
242
444
|
standalone owner with `JOB_HUB_EXTERNAL_HOST`, and a live unresponsive owner
|
|
243
445
|
with `JOB_HUB_HOST_UNRESPONSIVE`, preserving that owner. A second live hub for
|
|
244
446
|
the state directory refuses `JOB_HUB_ALREADY_RUNNING`. Existing `startJobHost`
|
|
245
|
-
callers can still attach to a compatible hub-owned job by authenticated
|
|
246
|
-
|
|
447
|
+
callers can still attach to a compatible hub-owned job by ordinary authenticated
|
|
448
|
+
reuse or strict `reuseOnly: {expected}` attachment (which skips
|
|
449
|
+
`installWriterBinding` during strict bootstrap). Such attachment keeps the
|
|
450
|
+
registered process-local hooks under hub ownership.
|
|
247
451
|
|
|
248
452
|
Semantic `close` ends only the addressed job and revokes its writer grant.
|
|
249
453
|
Closed entries remain in the current hub list. `await hub.stop()` drains work,
|
|
@@ -251,9 +455,10 @@ stops the shared transport and disposes local sessions. Active jobs retain their
|
|
|
251
455
|
durable identity, grants, publications, asks, acts and replay history across
|
|
252
456
|
that transport stop. Restart requires `startJobHub` and `openJob` for each
|
|
253
457
|
required job, registering callbacks again and refreshing the writer adapter's
|
|
254
|
-
origin. The hub capability and incarnation
|
|
255
|
-
|
|
256
|
-
|
|
458
|
+
origin. The hub capability, `listenerIncarnation` and `workspace` incarnation
|
|
459
|
+
query rotate, forcing a fresh owner document and invalidating prior strict
|
|
460
|
+
`reuseOnly` expectations. Obtain the new owner URL and `job.attachment` from the
|
|
461
|
+
new handle. The retained active job's grants keep their identity until
|
|
257
462
|
semantic close. A later new job receives new grants.
|
|
258
463
|
|
|
259
464
|
Admission is an application bound of 32 registered entries, including closed
|
|
@@ -353,7 +558,7 @@ model binding nor a valid image-set binding uses `JOB_ASK_INVALID`.
|
|
|
353
558
|
|
|
354
559
|
## Named export inventory
|
|
355
560
|
|
|
356
|
-
The backend rig-still extension retains the twelve runtime exports and `JOB_ACT_SCHEMA` at act@2. `JobAct` additionally includes `JobRigReviewAct` at act@3 with top-level `JobRigStill`. The facade adds type-only `JobLegacyAct`, `JobRigReviewAct`, `JobRigStill` and `JobRigCapture` exports. Existing API/store/reuse markers and ordinary/historical acts retain @2. The rig revision constant
|
|
561
|
+
The backend rig-still extension retains the twelve runtime exports and `JOB_ACT_SCHEMA` at act@2. `JobAct` additionally includes `JobRigReviewAct` at act@3 with top-level `JobRigStill`. The facade adds type-only `JobLegacyAct`, `JobRigReviewAct`, `JobRigStill` and `JobRigCapture` exports, and Review #563 adds five type-only exports (`JobHostListenerIncarnation`, `JobHostReuseBinding`, `JobHostReuseExpectation`, `JobHostAttachField` and `JobHostAttachFailure`) while keeping the twelve runtime exports unchanged. Existing API/store/reuse markers and ordinary/historical acts retain @2. The rig revision constant, transport limits and the internal `POST /jobs/<jobId>/host` helper remain internal to their modules. Consumer checks distinguish these act revisions as described in [Rig verdict still backend](REVIEW_PACKAGE.md#rig-verdict-still-backend).
|
|
357
562
|
|
|
358
563
|
The exact runtime exports are listed below. Constants preserve their literal
|
|
359
564
|
values from the frozen semantic contract.
|
|
@@ -382,6 +587,11 @@ without aliases or copied wire shapes.
|
|
|
382
587
|
- `JobOwnerHub`
|
|
383
588
|
- `JobHostOptions`
|
|
384
589
|
- `JobOwnerHost`
|
|
590
|
+
- `JobHostListenerIncarnation`
|
|
591
|
+
- `JobHostReuseBinding`
|
|
592
|
+
- `JobHostReuseExpectation`
|
|
593
|
+
- `JobHostAttachField`
|
|
594
|
+
- `JobHostAttachFailure`
|
|
385
595
|
- `JobSessionOptions`
|
|
386
596
|
- `JobSession`
|
|
387
597
|
- `JobWorkerOptions`
|
|
@@ -458,12 +668,19 @@ Rows are capped at 4096, roles at 128 UTF-16 code units and literal paths at 409
|
|
|
458
668
|
## Installed acceptance
|
|
459
669
|
|
|
460
670
|
`bun run smoke` packs the package and installs that tarball into an empty project.
|
|
461
|
-
A consumer imports the runtime and every listed type
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
671
|
+
A consumer imports the twelve runtime exports and every listed type, including
|
|
672
|
+
`JobHostListenerIncarnation`, `JobHostReuseBinding`, `JobHostReuseExpectation`,
|
|
673
|
+
`JobHostAttachField` and `JobHostAttachFailure`, through `@rig-c/review/job-host`.
|
|
674
|
+
TypeScript checks the installed consumer and the runtime checks the full owner
|
|
675
|
+
resources, retained publication, semantic ports, declared hooks, enumerator
|
|
676
|
+
version/row carriage, ordinary reuse, strict `reuseOnly: {expected}` attachment
|
|
677
|
+
(including `JOB_HOST_REUSE_MISMATCH` on a rotated `listenerIncarnation` and
|
|
678
|
+
`JOB_HOST_ATTACH_REFUSED` on unavailable attachment), and explicit-close grant
|
|
679
|
+
lifetime using synthetic host data. Offline synthetic tarball or linked dependency
|
|
680
|
+
consumer probes remain separate from the fresh `bun run smoke` install executed in
|
|
681
|
+
hosted PR CI. This installed control uses an explicitly synthetic injected
|
|
682
|
+
enumerator. Production Create integration and official-import evidence have their
|
|
683
|
+
separate acceptance gates.
|
|
467
684
|
|
|
468
685
|
The declared export-removal control deletes only `./job-host` from the disposable
|
|
469
686
|
installed manifest and requires the public import to fail for that missing
|