diff --git a/crates/registry-breg-client-node/README.md b/crates/registry-breg-client-node/README.md index 333500f3e1..430260b0d0 100644 --- a/crates/registry-breg-client-node/README.md +++ b/crates/registry-breg-client-node/README.md @@ -153,7 +153,10 @@ temporal parameters and continuations distinct. Snapshot continuations bind the returned snapshot and optional `validAt` identity. Relationship lists bind the root record and relationship path. `getRecordRevision` returns one validated retained record as inert bytes, while `recordRevisions` returns the -bounded revision collection. Every specialized object read has an exact `...Json` +bounded revision collection. A revision written by an applied Proposal may +carry an optional `proposal` member (`actionId`, `proposalId`, +`submissionVersion`), present only when the profile can read that Proposal. +The bytes pass through unchanged. Every specialized object read has an exact `...Json` variant when record or GeoJSON values may cross JavaScript's integer boundary. Standalone Proposals use `getProposal` or one explicit `listProposals` page. @@ -290,6 +293,23 @@ Downloads follow the promoted link and return bounded bytes with their stored content type. Keep the returned Proposal for subsequent operations; do not substitute a Registry Record ETag or construct an attachment route. +## Record attachments + +A record attachment slot holds a file that an immediate Action wrote or an +applied Proposal promoted. Read that file with +`downloadRecordAttachment(recordRoute, recordIdentifier, slot, accessProfile?)`. +The method checks the route, record identifier and slot before I/O. It returns +the bytes only when they match the service's `Repr-Digest`. A slot can hold up +to 16 MiB, but the client reads at most 8 MiB by default. Raise +`maximumResponseBytes` to download larger files. The client cannot yet send +request files, so an immediate Action that declares attachments is not +invocable from it. + +```js +const file = await client.downloadRecordAttachment('applications', recordId, + 'evidence', 'auditor'); +``` + ## Explicit OAuth token exchange `breg.PrivateKeyJwt` wraps the shared Rust OAuth provider. Construct it with the diff --git a/crates/registry-breg-client-node/__test__/facade.test-d.ts b/crates/registry-breg-client-node/__test__/facade.test-d.ts index 4e44260e59..05346b4a2a 100644 --- a/crates/registry-breg-client-node/__test__/facade.test-d.ts +++ b/crates/registry-breg-client-node/__test__/facade.test-d.ts @@ -153,6 +153,12 @@ client.patchRecord(patch, '9f6973f9-10b3-4c58-b41b-494cba26796f', '"breg-1"', [ { op: 'replace', field: 'name', value: 'Grace' }, ], 'patch-person-1') client.recordRevisions('people', '9f6973f9-10b3-4c58-b41b-494cba26796f', 'auditor') +client.downloadRecordAttachment('people', '9f6973f9-10b3-4c58-b41b-494cba26796f', 'photo', 'auditor').then(outcome => { + const digest: string | undefined = outcome.reprDigest + void digest +}) +// @ts-expect-error The slot is required. +client.downloadRecordAttachment('people', '9f6973f9-10b3-4c58-b41b-494cba26796f') client.getRecordRevision('people', '9f6973f9-10b3-4c58-b41b-494cba26796f', 2) client.getGeoJsonRecord('people', '9f6973f9-10b3-4c58-b41b-494cba26796f') client.getGeoJsonRecordJson('people', '9f6973f9-10b3-4c58-b41b-494cba26796f') diff --git a/crates/registry-breg-client-node/__test__/record-attachments.test.js b/crates/registry-breg-client-node/__test__/record-attachments.test.js new file mode 100644 index 0000000000..a3fd78cfd0 --- /dev/null +++ b/crates/registry-breg-client-node/__test__/record-attachments.test.js @@ -0,0 +1,137 @@ +'use strict'; +const assert = require('node:assert/strict'); +const http = require('node:http'); +const { test } = require('node:test'); +const { createHash } = require('node:crypto'); +const { BaseRegistryClient } = process.env.BREG_CLIENT_PACKAGE + ? require(process.env.BREG_CLIENT_PACKAGE).breg : require('..'); + +const id = '00000000-0000-4000-8000-000000000001'; +const slot = 'evidence'; +const bytes = Buffer.from('%PDF-1.7 promoted record file'); +const traceparent = '00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01'; +const profileLink = '; rel="profile", ; rel="describedby"'; +const meta = { registryIdentifier: 'registry', datasetIdentifier: 'dataset', recordTypeIdentifier: 'application' }; +const proposal = { actionId: 'amend', proposalId: '00000000-0000-4000-8000-0000000000aa', submissionVersion: 1 }; +const revision = { recordIdentifier: id, revisionIdentifier: '2', domainData: { name: 'one' }, proposal }; + +function digest(body) { + return `sha-256=:${createHash('sha256').update(body).digest('base64')}:`; +} + +async function serve(t, digestHeader) { + const requests = []; + const server = http.createServer((request, response) => { + requests.push({ url: request.url, accept: request.headers.accept }); + response.setHeader('traceparent', traceparent); + response.setHeader('cache-control', 'no-store'); + const path = request.url.split('?')[0]; + if (path.includes('/attachments/')) { + response.setHeader('content-type', 'application/pdf'); + response.setHeader('content-disposition', 'attachment'); + response.setHeader('x-content-type-options', 'nosniff'); + response.setHeader('vary', 'authorization'); + if (digestHeader !== undefined) response.setHeader('repr-digest', digestHeader); + return response.end(bytes); + } + response.setHeader('content-type', 'application/json'); + response.setHeader('link', profileLink); + const document = path.endsWith('/revisions') + ? { items: [revision], pageInfo: { hasNextPage: false } } + : { data: revision, meta }; + response.end(JSON.stringify(document)); + }); + await new Promise(resolve => server.listen(0, '127.0.0.1', resolve)); + t.after(() => new Promise(resolve => server.close(resolve))); + return { client: new BaseRegistryClient({ baseUrl: `http://127.0.0.1:${server.address().port}` }), requests }; +} + +test('a record attachment download uses the slot route and returns the verified digest', async t => { + const { client, requests } = await serve(t, digest(bytes)); + const downloaded = await client.downloadRecordAttachment('applications', id, slot, 'auditor'); + assert.deepEqual(downloaded.body, bytes); + assert.equal(downloaded.mediaType, 'application/pdf'); + assert.equal(downloaded.reprDigest, digest(bytes)); + assert.equal(requests[0].url, `/v1/records/applications/${id}/attachments/${slot}?accessProfile=auditor`); + assert.equal(requests[0].accept, '*/*'); +}); + +test('a record attachment whose bytes miss the stated digest is a protocol refusal', async t => { + for (const header of [digest(Buffer.from('other bytes')), undefined]) { + const { client } = await serve(t, header); + await assert.rejects( + client.downloadRecordAttachment('applications', id, slot), + error => error.kind === 'protocol', + ); + } +}); + +async function serveDownload(t, answer, options = {}) { + const server = http.createServer((request, response) => { + response.setHeader('traceparent', traceparent); + response.setHeader('cache-control', 'no-store'); + answer(response); + }); + await new Promise(resolve => server.listen(0, '127.0.0.1', resolve)); + t.after(() => new Promise(resolve => server.close(resolve))); + return new BaseRegistryClient({ baseUrl: `http://127.0.0.1:${server.address().port}`, ...options }); +} + +test('a concealed record attachment surfaces the service Problem', async t => { + const client = await serveDownload(t, response => { + response.statusCode = 404; + response.setHeader('content-type', 'application/problem+json'); + response.end(JSON.stringify({ + type: 'https://id.registrystack.org/problems/registry-breg/resource/not_found', + title: 'Not Found', + status: 404, + detail: 'The requested resource was not found.', + code: 'resource.not_found', + traceId: '4bf92f3577b34da6a3ce929d0e0e4736', + })); + }); + await assert.rejects( + client.downloadRecordAttachment('applications', id, slot), + error => error.kind === 'not-found' && error.status === 404 + && error.code === 'resource.not_found' && error.traceId === '4bf92f3577b34da6a3ce929d0e0e4736', + ); +}); + +test('a record attachment larger than the response bound is refused unread', async t => { + const client = await serveDownload(t, response => { + response.setHeader('content-type', 'application/pdf'); + response.setHeader('content-disposition', 'attachment'); + response.setHeader('x-content-type-options', 'nosniff'); + response.setHeader('vary', 'authorization'); + response.setHeader('repr-digest', digest(bytes)); + response.end(bytes); + }, { maximumResponseBytes: bytes.length - 1 }); + await assert.rejects( + client.downloadRecordAttachment('applications', id, slot), + error => error.kind === 'transport' && error.transportKind === 'response-too-large', + ); +}); + +test('invalid record attachment selectors never reach HTTP', async t => { + const { client, requests } = await serve(t, digest(bytes)); + for (const [route, record, name] of [ + ['applications', 'not-a-record', slot], + ['applications', id, '../evidence'], + ['applications', id, 'Evidence'], + ['applications/other', id, slot], + ]) { + await assert.rejects( + client.downloadRecordAttachment(route, record, name), + error => error.kind === 'invalid-request', + ); + } + assert.equal(requests.length, 0); +}); + +test('revision reads keep the Proposal link the server sent', async t => { + const { client } = await serve(t, digest(bytes)); + const history = JSON.parse((await client.recordRevisions('applications', id, 'auditor')).body); + assert.deepEqual(history.items[0].proposal, proposal); + const single = JSON.parse((await client.getRecordRevision('applications', id, 2, { accessProfile: 'auditor' })).body); + assert.deepEqual(single.data.proposal, proposal); +}); diff --git a/crates/registry-breg-client-node/client.d.ts b/crates/registry-breg-client-node/client.d.ts index da5e091a9a..4c283e7481 100644 --- a/crates/registry-breg-client-node/client.d.ts +++ b/crates/registry-breg-client-node/client.d.ts @@ -953,6 +953,8 @@ export declare class BaseRegistryClient { registryContract(accessProfile?: string | null, request?: ReadRequestOptions): Promise recordSchema(recordTypeIdentifier: string, accessProfile?: string | null, request?: ReadRequestOptions): Promise recordRevisions(recordRoute: string, recordIdentifier: string, accessProfile?: string | null, request?: ReadRequestOptions): Promise + /** Download one record attachment slot. The bytes are returned only when they match the service's `Repr-Digest`. */ + downloadRecordAttachment(recordRoute: string, recordIdentifier: string, slot: string, accessProfile?: string | null): Promise getRecordRevision(recordRoute: string, recordIdentifier: string, revision: SafeInteger, options?: RecordProjectionOptions | null, request?: ReadRequestOptions): Promise getRecord(recordRoute: string, recordIdentifier: string, options?: RecordOptions | null, request?: ReadRequestOptions): Promise> listRecords(recordRoute: string, options?: ListOptions | null, request?: ReadRequestOptions): Promise diff --git a/crates/registry-breg-client-node/client.js b/crates/registry-breg-client-node/client.js index 3de127454f..c5af4483ca 100644 --- a/crates/registry-breg-client-node/client.js +++ b/crates/registry-breg-client-node/client.js @@ -294,6 +294,7 @@ for (const [method, jsonIndexes, requiredIndexes] of [ ['patchRecord', [3], [3]], ['batchRecords', [1], [1]], ['tombstoneRecord'], ['startProposal', [1], [1]], ['readProposal'], ['readProposalSubmission'], ['getProposal'], ['listProposals', [1], [1]], ['executeProposal'], ['listProposalsJson'], ['downloadProposalAttachment'], ['uploadProposalAttachment'], ['deleteProposalAttachment'], + ['downloadRecordAttachment'], ['readProposalReviewStatus'], ['readProposalReviewStatusWithProgress'], ['readProposalReviewContext'], ['readProposalReviewContextBatch', [1], [1]], ['readProposalReviewById'], ['downloadProposalReviewDocument', [1], [1]], diff --git a/crates/registry-breg-client-node/index.d.ts b/crates/registry-breg-client-node/index.d.ts index f425ae0a94..6c98dcc795 100644 --- a/crates/registry-breg-client-node/index.d.ts +++ b/crates/registry-breg-client-node/index.d.ts @@ -28,6 +28,11 @@ export declare class BaseRegistryClient { recordSchema(recordTypeIdentifier: string, accessProfile?: string | undefined | null, cancellation?: ReadCancellation | undefined | null): Promise /** Retrieve one bounded first page of record revisions as inert JSON. */ recordRevisions(recordRoute: string, recordIdentifier: string, accessProfile?: string | undefined | null, cancellation?: ReadCancellation | undefined | null): Promise + /** + * Download the file in one record attachment slot. The bytes are + * returned only when they match the service's `Repr-Digest`. + */ + downloadRecordAttachment(recordRoute: string, recordIdentifier: string, slot: string, accessProfile?: string | undefined | null): Promise /** Retrieve one exact retained revision as validated inert record JSON. */ getRecordRevision(recordRoute: string, recordIdentifier: string, revision: number, options?: any | undefined | null, cancellation?: ReadCancellation | undefined | null): Promise /** diff --git a/crates/registry-breg-client-node/src/lib.rs b/crates/registry-breg-client-node/src/lib.rs index 4dedbb6c5a..52c945065b 100644 --- a/crates/registry-breg-client-node/src/lib.rs +++ b/crates/registry-breg-client-node/src/lib.rs @@ -2969,6 +2969,28 @@ impl BaseRegistryClient { .await } + /// Download the file in one record attachment slot. The bytes are + /// returned only when they match the service's `Repr-Digest`. + #[napi] + pub async fn download_record_attachment( + &self, + record_route: String, + record_identifier: String, + slot: String, + access_profile: Option, + ) -> Result { + self.inner + .download_record_attachment( + &record_route, + &record_identifier, + &slot, + access_profile.as_deref(), + ) + .await + .map(raw_value) + .map_err(client_error) + } + /// Retrieve one exact retained revision as validated inert record JSON. #[napi] pub async fn get_record_revision( diff --git a/crates/registry-breg-client-py/README.md b/crates/registry-breg-client-py/README.md index 7140d889b9..b39f69f4c8 100644 --- a/crates/registry-breg-client-py/README.md +++ b/crates/registry-breg-client-py/README.md @@ -52,6 +52,10 @@ page. Application result references grant no target read authority. Read the target through an ordinary authorized `get_record`; the retained result revision records application provenance, not a current ETag or write precondition. +A revision written by an applied Proposal may carry an optional `proposal` +member (`actionId`, `proposalId`, `submissionVersion`) when the profile can +read that Proposal. Both revision reads return it as the server sent it. + ## Hook verification `verify_hook_delivery(method=..., path=..., headers=..., body=..., key=...)` @@ -288,6 +292,22 @@ read with `read_proposal_review_by_id(binding, proposal_id)`, then call document field. This does not require or grant ordinary Proposal Get authority. The server rechecks the full context's current disclosure before releasing bytes. +## Record attachments + +A record attachment slot holds a file that an immediate Action wrote or an +applied Proposal promoted. Read that file with +`download_record_attachment(record_route, record_identifier, slot, access_profile=None)`. +The method checks the route, record identifier and slot before I/O. It returns +the bytes only when they match the service's `Repr-Digest`. A slot can hold up +to 16 MiB, but the client reads at most 8 MiB by default. Raise +`maximum_response_bytes` to download larger files. The client cannot yet send +request files, so an immediate Action that declares attachments is not +invocable from it. + +```python +stored = client.download_record_attachment("applications", record_id, "evidence", "auditor") +``` + ## Explicit OAuth token exchange For automatic context-bound authorization, construct `BaseRegistryClient` with diff --git a/crates/registry-breg-client-py/python/registry_breg_client/__init__.pyi b/crates/registry-breg-client-py/python/registry_breg_client/__init__.pyi index 1195fb273f..83cfbcb19d 100644 --- a/crates/registry-breg-client-py/python/registry_breg_client/__init__.pyi +++ b/crates/registry-breg-client-py/python/registry_breg_client/__init__.pyi @@ -505,6 +505,13 @@ class BaseRegistryClient: record_identifier: str, access_profile: str | None = None, ) -> dict[str, Any]: ... + def download_record_attachment( + self, + record_route: str, + record_identifier: str, + slot: str, + access_profile: str | None = None, + ) -> dict[str, Any]: ... def get_record_revision( self, record_route: str, diff --git a/crates/registry-breg-client-py/src/lib.rs b/crates/registry-breg-client-py/src/lib.rs index 6f761d9f40..b2e0958ea4 100644 --- a/crates/registry-breg-client-py/src/lib.rs +++ b/crates/registry-breg-client-py/src/lib.rs @@ -2243,6 +2243,30 @@ impl BaseRegistryClient { raw_value(py, &value.value, &value.metadata) } + /// Download the file in one record attachment slot. The bytes are + /// returned only when they match the service's `Repr-Digest`. + #[pyo3(signature = (record_route, record_identifier, slot, access_profile=None))] + fn download_record_attachment<'py>( + &self, + py: Python<'py>, + record_route: &str, + record_identifier: &str, + slot: &str, + access_profile: Option<&str>, + ) -> PyResult> { + let value = py + .detach(|| { + self.runtime.block_on(self.inner.download_record_attachment( + record_route, + record_identifier, + slot, + access_profile, + )) + }) + .map_err(|error| sdk_error(py, error))?; + raw_value(py, &value.value, &value.metadata) + } + #[pyo3(signature = (record_route, record_identifier, revision, *, select=None, access_profile=None, format="json"))] #[allow(clippy::too_many_arguments)] fn get_record_revision<'py>( diff --git a/crates/registry-breg-client-py/tests/python/test_record_attachments.py b/crates/registry-breg-client-py/tests/python/test_record_attachments.py new file mode 100644 index 0000000000..480f8a4994 --- /dev/null +++ b/crates/registry-breg-client-py/tests/python/test_record_attachments.py @@ -0,0 +1,191 @@ +"""Record attachment downloads and revision Proposal links through the Python binding.""" + +import base64 +import hashlib +import json +import threading +import unittest +from http.server import BaseHTTPRequestHandler, HTTPServer + +from bootstrap import ensure_built + +ensure_built() + +from registry_breg_client import ( # noqa: E402 + BaseRegistryClient, + BaseRegistryClientError, +) + +RECORD_ID = "00000000-0000-4000-8000-000000000001" +SLOT = "evidence" +CONTENT = b"%PDF-1.7 promoted record file" +TRACEPARENT = "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01" +PROFILE_LINK = ( + '; rel="profile", ' + '; rel="describedby"' +) +META = { + "registryIdentifier": "registry", + "datasetIdentifier": "dataset", + "recordTypeIdentifier": "application", +} +PROPOSAL = { + "actionId": "amend", + "proposalId": "00000000-0000-4000-8000-0000000000aa", + "submissionVersion": 1, +} +REVISION = { + "recordIdentifier": RECORD_ID, + "revisionIdentifier": "2", + "domainData": {"name": "one"}, + "proposal": PROPOSAL, +} + + +TRACE_ID = "4bf92f3577b34da6a3ce929d0e0e4736" +NOT_FOUND = { + "type": "https://id.registrystack.org/problems/registry-breg/resource/not_found", + "title": "Not Found", + "status": 404, + "detail": "The requested resource was not found.", + "code": "resource.not_found", + "traceId": TRACE_ID, +} + + +def digest(body: bytes) -> str: + return "sha-256=:" + base64.b64encode(hashlib.sha256(body).digest()).decode() + ":" + + +class RecordAttachmentTests(unittest.TestCase): + def setUp(self) -> None: + self.requests = [] + self.digest_header = digest(CONTENT) + self.concealed = False + owner = self + + class Handler(BaseHTTPRequestHandler): + def do_GET(self) -> None: + owner.requests.append((self.path, self.headers.get("accept"))) + path = self.path.split("?")[0] + attachment = "/attachments/" in path + if attachment and owner.concealed: + problem = json.dumps(NOT_FOUND).encode() + self.send_response(404) + self.send_header("traceparent", TRACEPARENT) + self.send_header("cache-control", "no-store") + self.send_header("content-type", "application/problem+json") + self.send_header("content-length", str(len(problem))) + self.end_headers() + self.wfile.write(problem) + return + if attachment: + payload = CONTENT + elif path.endswith("/revisions"): + payload = json.dumps( + {"items": [REVISION], "pageInfo": {"hasNextPage": False}} + ).encode() + else: + payload = json.dumps({"data": REVISION, "meta": META}).encode() + self.send_response(200) + self.send_header("traceparent", TRACEPARENT) + self.send_header("cache-control", "no-store") + self.send_header("content-length", str(len(payload))) + if attachment: + self.send_header("content-type", "application/pdf") + self.send_header("content-disposition", "attachment") + self.send_header("x-content-type-options", "nosniff") + self.send_header("vary", "authorization") + if owner.digest_header is not None: + self.send_header("repr-digest", owner.digest_header) + else: + self.send_header("content-type", "application/json") + self.send_header("link", PROFILE_LINK) + self.end_headers() + self.wfile.write(payload) + + def log_message(self, *args) -> None: + pass + + self.server = HTTPServer(("127.0.0.1", 0), Handler) + self.thread = threading.Thread(target=self.server.serve_forever, daemon=True) + self.thread.start() + self.client = BaseRegistryClient(f"http://127.0.0.1:{self.server.server_port}") + + def tearDown(self) -> None: + self.server.shutdown() + self.thread.join() + self.server.server_close() + + def test_download_uses_the_slot_route_and_returns_the_verified_digest(self) -> None: + downloaded = self.client.download_record_attachment( + "applications", RECORD_ID, SLOT, access_profile="auditor" + ) + self.assertEqual(downloaded["body"], CONTENT) + self.assertEqual(downloaded["media_type"], "application/pdf") + self.assertEqual(downloaded["repr_digest"], digest(CONTENT)) + self.assertEqual( + self.requests[0], + ( + f"/v1/records/applications/{RECORD_ID}/attachments/{SLOT}?accessProfile=auditor", + "*/*", + ), + ) + + def test_bytes_that_miss_the_stated_digest_are_a_protocol_refusal(self) -> None: + for header in (digest(b"other bytes"), None): + self.digest_header = header + with self.subTest(header=header): + with self.assertRaises(BaseRegistryClientError) as refused: + self.client.download_record_attachment( + "applications", RECORD_ID, SLOT + ) + self.assertEqual(refused.exception.kind, "protocol") + + def test_a_concealed_file_surfaces_the_service_problem(self) -> None: + self.concealed = True + with self.assertRaises(BaseRegistryClientError) as refused: + self.client.download_record_attachment("applications", RECORD_ID, SLOT) + self.assertEqual(refused.exception.kind, "not-found") + self.assertEqual(refused.exception.status, 404) + self.assertEqual(refused.exception.code, "resource.not_found") + self.assertEqual(refused.exception.trace_id, TRACE_ID) + + def test_a_file_larger_than_the_response_bound_is_refused_unread(self) -> None: + client = BaseRegistryClient( + f"http://127.0.0.1:{self.server.server_port}", + maximum_response_bytes=len(CONTENT) - 1, + ) + with self.assertRaises(BaseRegistryClientError) as refused: + client.download_record_attachment("applications", RECORD_ID, SLOT) + self.assertEqual(refused.exception.kind, "transport") + self.assertEqual(refused.exception.transport_kind, "response-too-large") + + def test_invalid_selectors_never_reach_http(self) -> None: + for route, record, slot in ( + ("applications", "not-a-record", SLOT), + ("applications", RECORD_ID, "../evidence"), + ("applications", RECORD_ID, "Evidence"), + ("applications/other", RECORD_ID, SLOT), + ): + with self.subTest(route=route, record=record, slot=slot): + with self.assertRaises(BaseRegistryClientError) as refused: + self.client.download_record_attachment(route, record, slot) + self.assertEqual(refused.exception.kind, "invalid-request") + self.assertEqual(self.requests, []) + + def test_revision_reads_keep_the_proposal_link_the_server_sent(self) -> None: + history = json.loads( + self.client.record_revisions("applications", RECORD_ID, "auditor")["body"] + ) + self.assertEqual(history["items"][0]["proposal"], PROPOSAL) + single = json.loads( + self.client.get_record_revision( + "applications", RECORD_ID, 2, access_profile="auditor" + )["body"] + ) + self.assertEqual(single["data"]["proposal"], PROPOSAL) + + +if __name__ == "__main__": + unittest.main() diff --git a/crates/registry-breg-client/README.md b/crates/registry-breg-client/README.md index 9e18bbd2f9..cb28897f69 100644 --- a/crates/registry-breg-client/README.md +++ b/crates/registry-breg-client/README.md @@ -145,6 +145,10 @@ context. Batch responses have a dedicated snapshot/results type. Tombstone returns a native revision envelope and removes the record from live lists while permitted retained history remains readable. +Revision reads return the server bytes unchanged. A revision written by an +applied Proposal may carry an optional `proposal` member (`actionId`, +`proposalId`, `submissionVersion`) when the profile can read that Proposal. + An immediate Action with reference inputs may advertise an optional `routes.availability` contract. Build `BRegActionAvailabilityRequest` from the selected opaque Action binding, one reference input's API name, and any supplied @@ -291,6 +295,14 @@ value. Get and readable-attachment grants are separate from write authority, so successful write may omit value metadata. An omitted value does not independently prove its stored content. An invalid receipt leaves the mutation outcome unknown; retain the original condition, bytes and key for same-command recovery. +`download_record_attachment(record_route, record_identifier, slot, +access_profile)` reads the file in a record slot, whether an immediate Action +wrote it or an applied Proposal promoted it. It checks the route, record +identifier and slot before I/O. It returns the bytes only when they match the +service's `Repr-Digest`. A slot can hold up to 16 MiB, but the client reads at +most 8 MiB by default. Raise the limit with `with_maximum_response_bytes` to +download larger files. The client cannot yet send request files, so an +immediate Action that declares attachments is not invocable from it. ## Response security diff --git a/crates/registry-breg-client/src/client.rs b/crates/registry-breg-client/src/client.rs index 97a6ea938c..1fe9cc7d2e 100644 --- a/crates/registry-breg-client/src/client.rs +++ b/crates/registry-breg-client/src/client.rs @@ -723,6 +723,71 @@ impl BaseRegistryClient { .await } + /// Download the file held in one record attachment slot. + /// + /// The service must send one `Repr-Digest` for the stored file, and the + /// client returns the bytes only when they match it. + pub async fn download_record_attachment( + &self, + record_route: &str, + record_identifier: &str, + slot: &str, + access_profile: Option<&str>, + ) -> Result, BaseRegistryClientError> { + validate_record_route(record_route)?; + validate_record_uuid(record_identifier)?; + validate_breg_identifier( + slot, + "the Base Registry Engine attachment slot identifier is invalid", + )?; + let pairs = access_profile_query(access_profile)?; + let url = self.url_with_query( + &[ + "v1", + "records", + record_route, + record_identifier, + "attachments", + slot, + ], + &pairs, + )?; + let builder = self + .authorize( + self.transport.http.get(url).header(ACCEPT, ANY_MEDIA_TYPE), + Credential::Optional, + ) + .await?; + let response = self.transport.send(builder).await?; + let status = response.status(); + let digest = if status == StatusCode::OK { + let trace_id = breg_trace_id(status, response.headers())?; + parse_representation_digest(status, response.headers(), &trace_id, true)? + } else { + None + }; + let complete = self + .attachment_wire_limit(response, MAX_BREG_ATTACHMENT_BYTES) + .await?; + match digest { + Some((value, expected)) + if expected == Sha256::digest(complete.value.as_bytes()).as_slice() => + { + Ok(BRegComplete { + value: complete + .value + .with_verified_digest(BRegRepresentationDigest::new(value)), + metadata: complete.metadata, + }) + } + _ => Err(BaseRegistryClientError::protocol( + status.as_u16(), + BRegProtocolFailure::RepresentationDigest, + Some(complete.metadata.trace_id().clone()), + )), + } + } + /// Retrieve one exact positive revision as a Registry Record single envelope. pub async fn get_record_revision( &self, diff --git a/crates/registry-breg-client/src/error.rs b/crates/registry-breg-client/src/error.rs index 5ac6e66235..72584118ec 100644 --- a/crates/registry-breg-client/src/error.rs +++ b/crates/registry-breg-client/src/error.rs @@ -142,6 +142,10 @@ pub enum BRegProblemCode { ActionGuardFailed, ActionHandlerFailed, ActionRefused, + AttachmentContentType, + AttachmentDigestMismatch, + AttachmentSlotWriteOnce, + AttachmentTooLarge, AuthenticationRefused, ExternalViewIncomplete, IdempotencyConflict, @@ -178,11 +182,15 @@ pub enum BRegProblemCode { } impl BRegProblemCode { - pub const ALL: [Self; 37] = [ + pub const ALL: [Self; 41] = [ Self::ActionEvidenceFailed, Self::ActionGuardFailed, Self::ActionHandlerFailed, Self::ActionRefused, + Self::AttachmentContentType, + Self::AttachmentDigestMismatch, + Self::AttachmentSlotWriteOnce, + Self::AttachmentTooLarge, Self::AuthenticationRefused, Self::ExternalViewIncomplete, Self::IdempotencyConflict, @@ -225,6 +233,10 @@ impl BRegProblemCode { Self::ActionGuardFailed => "action.guard_failed", Self::ActionHandlerFailed => "action.handler_failed", Self::ActionRefused => "action.refused", + Self::AttachmentContentType => "attachment.content-type", + Self::AttachmentDigestMismatch => "attachment.digest-mismatch", + Self::AttachmentSlotWriteOnce => "attachment.slot-write-once", + Self::AttachmentTooLarge => "attachment.too-large", Self::AuthenticationRefused => "authentication.refused", Self::ExternalViewIncomplete => "external_view.incomplete", Self::IdempotencyConflict => "idempotency.key-reused", @@ -274,7 +286,8 @@ impl BRegProblemCode { Self::AuthenticationRefused => 401, Self::LookupUnresolved | Self::ResourceNotFound => 404, Self::IngestionProfileMismatch | Self::WriteOutsideBoundary => 403, - Self::IdempotencyConflict + Self::AttachmentSlotWriteOnce + | Self::IdempotencyConflict | Self::IngestionChunkMismatch | Self::IngestionRunBlocked | Self::IngestionRunNotOpen @@ -288,8 +301,11 @@ impl BRegProblemCode { Self::ActionGuardFailed | Self::PreconditionFailed | Self::ProposalReviewResultMismatch => 412, - Self::UnsupportedMediaType => 415, - Self::ActionRefused | Self::StatisticalDatasetReleaseRefused => 422, + Self::AttachmentTooLarge => 413, + Self::AttachmentContentType | Self::UnsupportedMediaType => 415, + Self::ActionRefused + | Self::AttachmentDigestMismatch + | Self::StatisticalDatasetReleaseRefused => 422, Self::PreconditionRequired => 428, Self::StatisticalDatasetDomainViolation => 500, Self::ExternalViewIncomplete @@ -322,6 +338,7 @@ impl BRegProblemCode { 409 => "Conflict", 410 => "Gone", 412 => "Precondition Failed", + 413 => "Content Too Large", 415 => "Unsupported Media Type", 422 => "Unprocessable Entity", 428 => "Precondition Required", @@ -343,6 +360,16 @@ impl BRegProblemCode { // The published sentence for the code. A refusal carries its // package-declared label on the wire instead. Self::ActionRefused => "The action was refused by a declared business rule.", + Self::AttachmentContentType => { + "The file media type is not one the attachment slot accepts." + } + Self::AttachmentDigestMismatch => { + "The file content does not match its declared SHA-256 digest." + } + Self::AttachmentSlotWriteOnce => { + "The record attachment slot already holds a file and is write-once." + } + Self::AttachmentTooLarge => "The file is larger than the attachment slot accepts.", Self::AuthenticationRefused => "The bearer credential is missing or refused.", Self::ExternalViewIncomplete => { "The external view's indexed coverage is incomplete for this request." diff --git a/crates/registry-breg-client/src/response.rs b/crates/registry-breg-client/src/response.rs index 557f72a474..0a07c7915d 100644 --- a/crates/registry-breg-client/src/response.rs +++ b/crates/registry-breg-client/src/response.rs @@ -39,6 +39,13 @@ impl BRegRawDocument { } } + pub(crate) fn with_verified_digest(self, digest: BRegRepresentationDigest) -> Self { + Self { + representation_digest: Some(digest), + ..self + } + } + #[must_use] pub fn media_type(&self) -> &str { &self.media_type diff --git a/crates/registry-breg-client/tests/attachment_http_boundary.rs b/crates/registry-breg-client/tests/attachment_http_boundary.rs index 56d9c80d46..be35b8f655 100644 --- a/crates/registry-breg-client/tests/attachment_http_boundary.rs +++ b/crates/registry-breg-client/tests/attachment_http_boundary.rs @@ -903,3 +903,92 @@ async fn a_mutation_response_for_another_proposal_is_refused() { .await .is_err()); } + +fn repr_digest(bytes: &[u8]) -> String { + use base64::Engine as _; + format!( + "sha-256=:{}:", + base64::engine::general_purpose::STANDARD.encode(Sha256::digest(bytes)) + ) +} + +#[tokio::test] +async fn record_attachment_download_uses_the_slot_route_and_verifies_the_stored_digest() { + let fixture = test_client(vec![ + download_response().with_header("repr-digest", &repr_digest(PDF)), + download_response().with_header("repr-digest", &repr_digest(b"other bytes")), + download_response(), + download_response() + .with_header("repr-digest", &repr_digest(PDF)) + .with_header("repr-digest", &repr_digest(PDF)), + problem_response( + BRegProblemCode::ResourceNotFound, + "The requested resource was not found.", + ), + ]) + .await; + let downloaded = fixture + .client + .download_record_attachment("applications", RECORD_ID, SLOT, Some("auditor")) + .await + .unwrap() + .value; + assert_eq!(downloaded.as_bytes(), PDF); + assert_eq!(downloaded.media_type(), "application/pdf"); + assert_eq!( + downloaded.representation_digest().unwrap().as_str(), + repr_digest(PDF) + ); + for label in ["mismatched", "missing", "repeated"] { + let refusal = fixture + .client + .download_record_attachment("applications", RECORD_ID, SLOT, None) + .await + .expect_err(label); + let BaseRegistryClientError::Protocol { failure, .. } = refusal else { + panic!("a {label} digest must be a protocol refusal") + }; + assert_eq!( + failure, + BRegProtocolFailure::RepresentationDigest, + "{label}" + ); + } + assert!(matches!( + fixture + .client + .download_record_attachment("applications", RECORD_ID, SLOT, None) + .await, + Err(BaseRegistryClientError::Problem { .. }) + )); + for (route, record, slot) in [ + ("applications", "not-a-record", SLOT), + ("applications", RECORD_ID, "../evidence"), + ("applications", RECORD_ID, "Evidence"), + ("applications/other", RECORD_ID, SLOT), + ] { + assert!(matches!( + fixture + .client + .download_record_attachment(route, record, slot, None) + .await, + Err(BaseRegistryClientError::InvalidRequest { .. }) + )); + } + let requests = fixture.requests.lock().unwrap().clone(); + assert_eq!(requests.len(), 5, "invalid identifiers never reach HTTP"); + assert_eq!(requests[0].method, "GET"); + assert_eq!( + requests[0].uri, + format!("/tenant/base/v1/records/applications/{RECORD_ID}/attachments/{SLOT}?accessProfile=auditor") + ); + assert_eq!(requests[0].accept.as_deref(), Some("*/*")); + assert_eq!( + requests[0].authorization.as_deref(), + Some("Bearer attachment-boundary-token") + ); + assert_eq!( + requests[1].uri, + format!("/tenant/base/v1/records/applications/{RECORD_ID}/attachments/{SLOT}") + ); +} diff --git a/crates/registry-breg-client/tests/write_http_boundary.rs b/crates/registry-breg-client/tests/write_http_boundary.rs index eaae1e01cd..cc1f8cfc00 100644 --- a/crates/registry-breg-client/tests/write_http_boundary.rs +++ b/crates/registry-breg-client/tests/write_http_boundary.rs @@ -2115,6 +2115,7 @@ fn problem_title(status: u16) -> &'static str { 409 => "Conflict", 410 => "Gone", 412 => "Precondition Failed", + 413 => "Content Too Large", 415 => "Unsupported Media Type", 422 => "Unprocessable Entity", 428 => "Precondition Required", @@ -2133,6 +2134,16 @@ fn problem_detail(code: BRegProblemCode) -> &'static str { Code::ActionGuardFailed => "The action guard was not satisfied.", Code::ActionHandlerFailed => "The action handler could not produce an accepted result.", Code::ActionRefused => REFUSAL_LABEL, + Code::AttachmentContentType => { + "The file media type is not one the attachment slot accepts." + } + Code::AttachmentDigestMismatch => { + "The file content does not match its declared SHA-256 digest." + } + Code::AttachmentSlotWriteOnce => { + "The record attachment slot already holds a file and is write-once." + } + Code::AttachmentTooLarge => "The file is larger than the attachment slot accepts.", Code::AuthenticationRefused => "The bearer credential is missing or refused.", Code::ExternalViewIncomplete => { "The external view's indexed coverage is incomplete for this request." @@ -2950,6 +2961,31 @@ async fn record_revisions_uses_bounded_native_route_and_refuses_invalid_selector assert_eq!(fixture.requests.lock().unwrap().len(), 1); } +#[tokio::test] +async fn record_revisions_returns_the_proposal_member_as_the_server_sent_it() { + let linked = json!({ + "revisionIdentifier": "2", + "recordIdentifier": RECORD_ID, + "proposal": { + "actionId": "correct-name", + "proposalId": "00000000-0000-4000-8000-0000000000aa", + "submissionVersion": 1 + } + }); + let fixture = test_client(vec![MockResponse::json( + StatusCode::OK, + json!({"items": [linked.clone()], "pageInfo": {"hasNextPage": false}}), + )]) + .await; + let result = fixture + .client + .record_revisions("companies", RECORD_ID, Some("company-writer")) + .await + .unwrap(); + let body: Value = serde_json::from_slice(result.value.as_bytes()).unwrap(); + assert_eq!(body["items"][0]["proposal"], linked["proposal"]); +} + fn ingestion_response(status: StatusCode, body: Value) -> MockResponse { MockResponse::json(status, body) .with_header("cache-control", "no-store") diff --git a/crates/registry-breg/Cargo.toml b/crates/registry-breg/Cargo.toml index 09182aa36a..42da9de42b 100644 --- a/crates/registry-breg/Cargo.toml +++ b/crates/registry-breg/Cargo.toml @@ -426,6 +426,11 @@ name = "postgres_proposal" path = "tests/postgres_proposal.rs" required-features = ["postgres-test"] +[[test]] +name = "postgres_record_attachments" +path = "tests/postgres_record_attachments.rs" +required-features = ["postgres-test"] + [[test]] name = "postgres_proposal_task_authority" path = "tests/postgres_proposal_task_authority.rs" diff --git a/crates/registry-breg/src/api/actions.rs b/crates/registry-breg/src/api/actions.rs index d844e21264..f368f1317a 100644 --- a/crates/registry-breg/src/api/actions.rs +++ b/crates/registry-breg/src/api/actions.rs @@ -309,14 +309,21 @@ pub(super) async fn dispatch( } else { None }; - let Ok(body) = bounded_body_to(body, surface.action.maximum_snapshot_bytes as usize).await - else { - return refusal(invalid_request()).await; - }; + let body = + match read_action_body(body, maximum_action_body_bytes(surface.action, route.kind)).await { + Ok(body) => body, + // Files are what make a body on a route that takes them this large. + Err(ActionBodyError::TooLarge) if takes_files(surface.action, route.kind) => { + return refusal(fixed_problem(ProblemCode::AttachmentTooLarge)).await; + } + Err(_) => return refusal(invalid_request()).await, + }; let parsed = match parse_body(surface.action, route.kind, &body) { Ok(parsed) => parsed, Err(error) => return refusal(invalid_action_request(error)).await, }; + let body_bytes = body.len(); + drop(body); match route.kind { ActionRouteKind::Availability => { match availability::observe( @@ -344,6 +351,11 @@ pub(super) async fn dispatch( } } ActionRouteKind::Invoke => { + if let Err(error) = + crate::mutation::validate_action_attachments(surface.action, &parsed.attachments) + { + return refusal(mutation_problem(error)).await; + } // Retain the bounded validated inputs for a disclosure-safe re-read // only after a field guard has refused and the transaction rolled back. let observed_input = parsed.input.clone(); @@ -355,7 +367,8 @@ pub(super) async fn dispatch( context: &surface.context, input: parsed.input, preconditions: parsed.preconditions, - body_bytes: body.len(), + attachments: parsed.attachments, + body_bytes, correlation: &correlation, }) .await; @@ -460,6 +473,7 @@ struct ParsedActionBody { input: Map, preconditions: BTreeMap, target_input: Option, + attachments: Vec, } #[derive(Clone, Debug, Eq, PartialEq)] @@ -486,10 +500,12 @@ fn parse_body( ) -> Result { let value = parse_json_strict(bytes).map_err(|_| ParseActionError::at(""))?; let envelope = value.as_object().ok_or_else(|| ParseActionError::at(""))?; + let accepts_attachments = takes_files(action, kind); if envelope.keys().any(|name| { name != "input" && (name != "preconditions" || kind != ActionRouteKind::Invoke) && (name != "targetInput" || kind != ActionRouteKind::Availability) + && (name != "attachments" || !accepts_attachments) }) { return Err(ParseActionError::at("")); } @@ -644,13 +660,150 @@ fn parse_body( } else { None }; + let attachments = if accepts_attachments { + parse_attachments(action, envelope.get("attachments"))? + } else { + Vec::new() + }; Ok(ParsedActionBody { input, preconditions, target_input, + attachments, }) } +/// Parses the `attachments` member: exactly one file object per declared +/// Action attachment name, each with a media type, a lowercase sha256 and +/// canonical standard base64 content. Slot limits are checked afterwards so +/// they refuse with their own problem codes. +fn parse_attachments( + action: &CompiledAction, + value: Option<&Value>, +) -> Result, ParseActionError> { + use base64::Engine as _; + let members = value + .and_then(Value::as_object) + .ok_or_else(|| ParseActionError::at("/attachments"))?; + if members + .keys() + .any(|name| !action.attachments.contains_key(name)) + { + return Err(ParseActionError::at("/attachments")); + } + let mut attachments = Vec::with_capacity(action.attachments.len()); + for name in action.attachments.keys() { + let at = |member: &str| { + ParseActionError::at(if member.is_empty() { + json_pointer(["attachments", name.as_str()]) + } else { + json_pointer(["attachments", name.as_str(), member]) + }) + }; + let file = members + .get(name) + .and_then(Value::as_object) + .ok_or_else(|| at(""))?; + if file + .keys() + .any(|member| !matches!(member.as_str(), "contentType" | "sha256" | "content")) + { + return Err(at("")); + } + let content_type = file + .get("contentType") + .and_then(Value::as_str) + .filter(|value| !value.is_empty()) + .ok_or_else(|| at("contentType"))?; + let sha256 = file + .get("sha256") + .and_then(Value::as_str) + .filter(|value| valid_lowercase_sha256(value)) + .ok_or_else(|| at("sha256"))?; + let content = file + .get("content") + .and_then(Value::as_str) + .and_then(|text| base64::engine::general_purpose::STANDARD.decode(text).ok()) + .filter(|bytes| !bytes.is_empty()) + .ok_or_else(|| at("content"))?; + attachments.push(ActionRequestAttachment { + name: name.clone(), + content_type: content_type.to_owned(), + sha256: sha256.to_owned(), + content, + }); + } + Ok(attachments) +} + +fn valid_lowercase_sha256(value: &str) -> bool { + value.len() == 64 + && value + .bytes() + .all(|byte| matches!(byte, b'0'..=b'9' | b'a'..=b'f')) +} + +/// Whether a request on this route carries request files: only the invocation +/// of an Action that declares them does. +fn takes_files(action: &CompiledAction, kind: ActionRouteKind) -> bool { + kind == ActionRouteKind::Invoke && !action.attachments.is_empty() +} + +/// The largest request body an Action route accepts: its snapshot budget, +/// plus, on a route that takes files, room for each declared file at its slot +/// limit in base64 with its member framing. A larger body on a route that +/// takes files is refused as `attachment.too-large`, and on any other route as +/// an invalid request. +fn maximum_action_body_bytes(action: &CompiledAction, kind: ActionRouteKind) -> usize { + let snapshot = action.maximum_snapshot_bytes as usize; + if !takes_files(action, kind) { + return snapshot; + } + action + .attachments + .iter() + .fold(snapshot + 32, |total, (name, attachment)| { + let encoded = (attachment.maximum_bytes as usize).div_ceil(3) * 4; + total + encoded + name.len() + 512 + }) +} + +/// Why an Action request body was not read. +enum ActionBodyError { + /// The body is longer than the route reads. + TooLarge, + /// The body is empty or its stream failed. + Invalid, +} + +/// Reads at most `maximum_bytes` of an Action request body. Unlike a plain +/// bounded read, it tells a body that is too long apart from a broken one. +async fn read_action_body( + mut body: Body, + maximum_bytes: usize, +) -> Result, ActionBodyError> { + use axum::body::HttpBody as _; + + let mut bytes = Vec::new(); + while let Some(frame) = + std::future::poll_fn(|context| std::pin::Pin::new(&mut body).poll_frame(context)).await + { + let frame = frame.map_err(|_| ActionBodyError::Invalid)?; + // A trailers frame carries no body bytes. + let Ok(data) = frame.into_data() else { + continue; + }; + if data.len() > maximum_bytes - bytes.len() { + return Err(ActionBodyError::TooLarge); + } + bytes.extend_from_slice(&data); + } + if bytes.is_empty() { + return Err(ActionBodyError::Invalid); + } + Ok(bytes) +} + fn valid_action_condition(value: &str) -> bool { // The action protocol carries an opaque strong condition, not an ordinary // record GET validator. Its binding is checked under current action authority. diff --git a/crates/registry-breg/src/api/mod.rs b/crates/registry-breg/src/api/mod.rs index 6d76a1d1eb..f06dced295 100644 --- a/crates/registry-breg/src/api/mod.rs +++ b/crates/registry-breg/src/api/mod.rs @@ -12,6 +12,7 @@ mod gis; mod ingestion; mod metadata; pub(crate) mod proposals; +mod record_attachments; mod service; mod statistics; @@ -41,13 +42,14 @@ pub(crate) use service::{ cursor_query_reference_value, valid_text_search_term, CursorQueryReferenceInput, }; pub use service::{ - ActionTargetConditionsInput, BatchMutationInput, CompiledLookupSelector, CompiledReadQuery, - ConditionalMutationInput, CreateMutationInput, HeldReadResponse, HttpService, - ImmediateActionInput, LookupSelectorValue, ReadBboxQuery, ReadFilterExpr, ReadFilterOperator, - ReadFilterPredicate, ReadLogicalOp, ReadOrderClause, ReadProjectionField, ReadRuntimeIdentity, - ReadServiceError, ReadSpatialQuery, ReadinessProbe, RecordReadKind, RecordReadRefusal, - RecordReadRequest, RecordReadService, RevisionReadRefusal, RevisionReadRequest, - RevisionReadService, ServiceFuture, SnapshotReadRequest, SnapshotReadService, + ActionRequestAttachment, ActionTargetConditionsInput, BatchMutationInput, + CompiledLookupSelector, CompiledReadQuery, ConditionalMutationInput, CreateMutationInput, + HeldReadResponse, HeldRecordAttachment, HttpService, ImmediateActionInput, LookupSelectorValue, + ReadBboxQuery, ReadFilterExpr, ReadFilterOperator, ReadFilterPredicate, ReadLogicalOp, + ReadOrderClause, ReadProjectionField, ReadRuntimeIdentity, ReadServiceError, ReadSpatialQuery, + ReadinessProbe, RecordReadKind, RecordReadRefusal, RecordReadRequest, RecordReadService, + RevisionReadRefusal, RevisionReadRequest, RevisionReadService, ServiceFuture, + SnapshotReadRequest, SnapshotReadService, }; use crate::auth::{authenticate_request, RegistryAuthenticator}; @@ -78,7 +80,8 @@ use uuid::Uuid; use crate::artifacts::{ access_log_path, openapi_access_log_operation, openapi_access_log_response_schema, openapi_components, openapi_entity_input_schema, openapi_input_schema_id, openapi_operation, - OpenApiAccessProfiles, OpenApiOperationSpec, ACCESS_LOG_RESPONSE_SCHEMA_ID, + openapi_record_attachment_operation, record_attachment_path, OpenApiAccessProfiles, + OpenApiOperationSpec, ACCESS_LOG_RESPONSE_SCHEMA_ID, }; const MAX_MUTATION_BODY_BYTES: usize = 2 * 1024 * 1024; @@ -228,6 +231,7 @@ fn route_set(service: Arc) -> Router { app.merge(access_log::routes(&service)) .merge(attachments::routes(&service)) + .merge(record_attachments::routes(&service)) .merge(gis::routes()) .merge(statistics::routes(&service)) .merge(external_views::routes(&service.registry)) @@ -435,6 +439,11 @@ async fn openapi( }; let request_schema_ref = openapi_input_schema_id(&surface.entity.id, surface.route.operation); + // The same check a revision read runs decides whether this caller's + // document declares the Proposal link. + let proposal_links = surface.route.revision_kind.is_some() + && proposal_link_access(&service, &claims, surface.context.selected_profile()) + .is_some(); methods.insert( method_name(surface.route.method).to_owned(), openapi_operation(OpenApiOperationSpec { @@ -449,6 +458,7 @@ async fn openapi( access_profiles: OpenApiAccessProfiles::Selected( surface.context.selected_profile(), ), + proposal_links, }), ); if surface.route.operation == Operation::Get @@ -471,6 +481,34 @@ async fn openapi( ); has_access_log = true; } + if surface.route.operation == Operation::Get && surface.read_path.is_none() { + let granted = surface + .entity + .access_profiles + .get(surface.context.selected_profile()) + .map(|profile| &profile.readable_attachments); + for slot in surface + .entity + .attachments + .values() + .filter(|slot| granted.is_some_and(|granted| granted.contains(&slot.id))) + { + paths + .entry(record_attachment_path(surface.route, &slot.id)) + .or_insert_with(|| Value::Object(Map::new())) + .as_object_mut() + .expect("OpenAPI paths are objects") + .insert( + "get".to_owned(), + openapi_record_attachment_operation( + surface.route, + surface.entity, + slot, + OpenApiAccessProfiles::Selected(surface.context.selected_profile()), + ), + ); + } + } readable_by_entity .entry(surface.response_entity.id.clone()) .and_modify(|fields| { @@ -1326,6 +1364,44 @@ async fn lookup_dispatch( } } +/// The Proposal read authority this caller holds under the selected access +/// profile, for each Proposal Action. A task-grant caller is left out: a +/// revision never names a Proposal to a caller whose Proposal authority is a +/// bounded task grant. +fn proposal_link_access( + service: &HttpService, + claims: &VerifiedRequestClaims, + selected: &str, +) -> Option { + let mutations = service.mutations.as_ref()?; + let authorities = service + .registry + .actions() + .actions + .iter() + .filter_map(|action| { + let authority = proposals::authorize( + &service.registry, + action, + claims, + Some(selected), + crate::postgres::ProposalAuthorityOperation::Lifecycle( + crate::model::ProposalOperation::Get, + ), + None, + )?; + authority + .task_grant + .is_none() + .then(|| (action.id.clone(), authority)) + }) + .collect::>(); + (!authorities.is_empty()).then(|| service::ProposalLinkAccess { + mutations: Arc::clone(mutations), + authorities, + }) +} + async fn revision_dispatch( State(service): State>, Extension(route): Extension, @@ -1447,6 +1523,8 @@ async fn revision_dispatch( { return unavailable(); } + let proposal_links = + proposal_link_access(&service, &claims, surface.context.selected_profile()); let request = RevisionReadRequest { entity_id: route.entity_id.clone(), operation_id: route.id.clone(), @@ -1458,6 +1536,7 @@ async fn revision_dispatch( representation: negotiated_json_representation(&headers), maximum_records, correlation: correlation.clone(), + proposal_links, }; match route.revision_kind { Some(CompiledRevisionKind::List) => match revisions.list(request).await { @@ -5515,6 +5594,14 @@ fn mutation_problem(error: MutationError) -> Response { fixed_problem(ProblemCode::MutationConflict) } MutationError::ProposalRejected => fixed_problem(ProblemCode::ProposalRejected), + MutationError::AttachmentSlotWriteOnce => { + fixed_problem(ProblemCode::AttachmentSlotWriteOnce) + } + MutationError::AttachmentTooLarge => fixed_problem(ProblemCode::AttachmentTooLarge), + MutationError::AttachmentContentType => fixed_problem(ProblemCode::AttachmentContentType), + MutationError::AttachmentDigestMismatch => { + fixed_problem(ProblemCode::AttachmentDigestMismatch) + } MutationError::ProposalReviewResultMismatch => { fixed_problem(ProblemCode::ProposalReviewResultMismatch) } diff --git a/crates/registry-breg/src/api/record_attachments.rs b/crates/registry-breg/src/api/record_attachments.rs new file mode 100644 index 0000000000..528902a9c1 --- /dev/null +++ b/crates/registry-breg/src/api/record_attachments.rs @@ -0,0 +1,230 @@ +// SPDX-License-Identifier: Apache-2.0 + +//! Record attachment downloads. A slot is readable only through the record +//! type's own `get` authority and the selected profile's `readableAttachments` +//! grant. Every other case answers the same concealed refusal. +use super::*; +use base64::Engine as _; + +pub(super) fn routes(service: &HttpService) -> Router> { + let mut app = Router::new(); + for route in &service.registry.routes().routes { + if route.operation != Operation::Get || read_path_for_route(service, route).is_some() { + continue; + } + if service + .registry + .entities() + .get(&route.entity_id) + .is_some_and(|entity| !entity.attachments.is_empty()) + { + app = app.route( + &format!("{}/attachments/{{slot_id}}", route.path), + get(download).layer(Extension(route.clone())), + ); + } + } + app +} + +async fn download( + State(service): State>, + Extension(route): Extension, + Extension(correlation): Extension, + Authenticated(claims): Authenticated, + RawQuery(raw_query): RawQuery, + headers: HeaderMap, + Path(path): Path>, +) -> Response { + let record_id = path.get("record_id"); + let declared_slot = path.get("slot_id").and_then(|slot| { + service + .registry + .entities() + .get(&route.entity_id)? + .attachments + .get_key_value(slot) + .map(|(id, _)| id.as_str()) + }); + let mut audit_route = route.clone(); + audit_route.id = crate::attachment::record_attachment_operation_id(&route.id, declared_slot); + let options = match parse_options(raw_query.as_deref()) { + Ok(options) => options, + Err(()) => { + return audited_known_read_refusal( + &service, + &audit_route, + &claims, + record_id, + invalid_query(), + &correlation, + ) + .await; + } + }; + let mut surface = match super::authorize_route_with_reason(&service, &route, &claims, &options) + { + Ok(surface) => surface, + Err(reason) => { + return audited_read_concealment( + &service, + &audit_route, + &options, + &claims, + record_id, + &correlation, + reason, + ) + .await; + } + }; + if let Err(binding) = surface + .context + .bind_access_attribution(surface.response_entity, &headers) + { + return audited_read_refusal( + &service, + &audit_route, + &surface, + record_id, + access_binding_refusal(binding), + &correlation, + ) + .await; + } + let slot_id = path.get("slot_id"); + let granted = slot_id.is_some_and(|slot| { + surface.entity.attachments.contains_key(slot) + && surface + .entity + .access_profiles + .get(surface.context.selected_profile()) + .is_some_and(|profile| profile.readable_attachments.contains(slot)) + }); + // The attachment row-level policy needs a principal, so a principal-less + // caller is refused here rather than by an empty database answer. + if claims.principal().is_none() + || record_id.is_none_or(|id| !valid_canonical_record_uuid(id)) + || !granted + { + return audited_read_refusal( + &service, + &audit_route, + &surface, + record_id, + concealed(), + &correlation, + ) + .await; + } + let request = RecordReadRequest { + entity_id: route.entity_id.clone(), + operation_id: route.id.clone(), + method: route.method, + context: surface.context, + selected_fields: BTreeSet::new(), + representation: CursorRepresentation::Json, + adapter: CursorAdapter::Native, + adapter_origin: None, + geojson_next_link_prefix: None, + kind: RecordReadKind::Get { + id: record_id.expect("validated record id").clone(), + }, + maximum_records: 1, + correlation: correlation.clone(), + }; + match service + .records + .record_attachment(request, slot_id.expect("granted slot").clone()) + .await + { + Ok(Some(held)) => attachment_response(held), + Ok(None) => concealed(), + Err(_) => unavailable(), + } +} + +/// The stored bytes with the digest recorded when the file was attached. A +/// stored digest that is not a SHA-256 hex value fails closed. +fn attachment_response(held: HeldRecordAttachment) -> Response { + let Some(digest) = representation_digest(&held.sha256) else { + return unavailable(); + }; + Response::builder() + .status(StatusCode::OK) + .header(CONTENT_TYPE, held.response.content_type()) + .header("repr-digest", digest) + .header( + "content-disposition", + crate::attachment::DOWNLOAD_CONTENT_DISPOSITION, + ) + .header("x-content-type-options", "nosniff") + .header(CACHE_CONTROL, "no-store") + .header(VARY, "authorization") + .body(Body::from(held.response.body().to_vec())) + .unwrap_or_else(|_| unavailable()) +} + +/// RFC 9530 `Repr-Digest` for a lowercase hex SHA-256 digest. +fn representation_digest(sha256: &str) -> Option { + let bytes = hex::decode(sha256).ok().filter(|bytes| bytes.len() == 32)?; + Some(format!( + "sha-256=:{}:", + base64::engine::general_purpose::STANDARD.encode(bytes) + )) +} + +/// Only `accessProfile` is accepted, once. +fn parse_options(raw: Option<&str>) -> Result { + let mut profile = None; + if raw.is_some_and(|value| value.len() > 2048) { + return Err(()); + } + for pair in raw + .unwrap_or_default() + .split('&') + .filter(|pair| !pair.is_empty()) + { + let (name, value) = pair.split_once('=').ok_or(())?; + let name = percent_decode(name).map_err(|_| ())?; + let value = percent_decode(value).map_err(|_| ())?; + match name.as_str() { + "accessProfile" if profile.is_none() => profile = Some(value), + _ => return Err(()), + } + } + let mut options = QueryOptions::default(); + options.parsed.access_profile = profile; + Ok(options) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn representation_digest_encodes_the_stored_hex_digest() { + let sha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + assert_eq!( + representation_digest(sha256).as_deref(), + Some("sha-256=:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=:") + ); + assert_eq!(representation_digest("not-hex"), None); + assert_eq!(representation_digest("abcd"), None); + } + + #[test] + fn download_query_accepts_one_access_profile_only() { + assert!(parse_options(None).is_ok()); + assert_eq!( + parse_options(Some("accessProfile=clerk")) + .expect("profile") + .access_profile() + .map(String::as_str), + Some("clerk") + ); + assert!(parse_options(Some("accessProfile=a&accessProfile=b")).is_err()); + assert!(parse_options(Some("fields=name")).is_err()); + assert!(parse_options(Some("accessProfile")).is_err()); + } +} diff --git a/crates/registry-breg/src/api/service.rs b/crates/registry-breg/src/api/service.rs index defa85799c..b774ab2f01 100644 --- a/crates/registry-breg/src/api/service.rs +++ b/crates/registry-breg/src/api/service.rs @@ -129,6 +129,15 @@ impl HeldReadResponse { } } +/// One record slot's stored file, held until the read's terminal audit is +/// durable. `sha256` is the lowercase hex digest recorded when the file was +/// attached, and the held bytes were checked against it. +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct HeldRecordAttachment { + pub response: HeldReadResponse, + pub sha256: String, +} + #[derive(Clone, Debug, Eq, PartialEq)] enum ReadResponseContentType { Json, @@ -195,10 +204,22 @@ pub struct ImmediateActionInput<'a> { pub context: &'a AuthorizedActionContext, pub input: serde_json::Map, pub preconditions: BTreeMap, + /// Files sent in the same request for the Action's declared record attachment slots. + pub attachments: Vec, pub body_bytes: usize, pub correlation: &'a RequestCorrelation, } +/// One decoded file from an immediate Action request's `attachments` member. +/// +/// `name` is the Action's attachment name, not the record slot id. +pub struct ActionRequestAttachment { + pub name: String, + pub content_type: String, + pub sha256: String, + pub content: Vec, +} + /// Exact-ID condition acquisition under an action's selected authority. pub struct ActionTargetConditionsInput<'a> { pub route_id: &'a str, @@ -613,6 +634,18 @@ pub struct RevisionReadRequest { pub representation: CursorRepresentation, pub maximum_records: usize, pub correlation: RequestCorrelation, + /// What decides whether a revision may name the Proposal that produced it. + /// Absent when the deployment serves no Proposal Actions. + pub(crate) proposal_links: Option, +} + +/// The Proposal read authority of one revision read, per Action, and the +/// service that applies it. A revision names a Proposal only when the same +/// check a Proposal read applies admits the caller. +#[derive(Clone)] +pub(crate) struct ProposalLinkAccess { + pub(crate) mutations: Arc, + pub(crate) authorities: BTreeMap, } /// Authorized stored-record history query. The plan's snapshot scope carries @@ -757,6 +790,17 @@ pub trait RecordReadService: Send + Sync { Box::pin(async { Err(ReadServiceError::Unavailable) }) } + /// Download one record slot's file after the record itself is visible to + /// the selected profile's GET authority. The HTTP layer has already + /// checked the profile's slot grant. The default backend releases nothing. + fn record_attachment( + &self, + _request: RecordReadRequest, + _slot_id: String, + ) -> ServiceFuture<'_, Result, ReadServiceError>> { + Box::pin(async { Err(ReadServiceError::Unavailable) }) + } + fn list( &self, request: RecordReadRequest, diff --git a/crates/registry-breg/src/api/tests/immediate_action_tests.rs b/crates/registry-breg/src/api/tests/immediate_action_tests.rs index 191f4ecc33..94dcb824a8 100644 --- a/crates/registry-breg/src/api/tests/immediate_action_tests.rs +++ b/crates/registry-breg/src/api/tests/immediate_action_tests.rs @@ -217,6 +217,7 @@ async fn task_granted_invoke_uses_exact_action_scope_and_frozen_subjects() { context: &surface.context, input: Map::new(), preconditions: BTreeMap::new(), + attachments: Vec::new(), body_bytes: 2, correlation: &correlation, }) @@ -738,6 +739,58 @@ fn invocation_uses_public_names_and_a_closed_typed_envelope() { } } +#[test] +fn only_an_invocation_that_takes_files_reads_past_the_snapshot_budget() { + let registry = compiled(); + let mut action = registry.actions().actions[0].clone(); + let snapshot = action.maximum_snapshot_bytes as usize; + for kind in [ + ActionRouteKind::Availability, + ActionRouteKind::Invoke, + ActionRouteKind::TargetConditions, + ] { + assert_eq!(maximum_action_body_bytes(&action, kind), snapshot); + } + action.attachments.insert( + "evidence".to_owned(), + crate::model::CompiledActionAttachment { + effect_id: "rename".to_owned(), + entity_id: "case".to_owned(), + slot_id: "evidence".to_owned(), + maximum_bytes: 3_000, + content_types: vec!["text/plain".to_owned()], + }, + ); + // Neither read takes a file, so neither reads more than the snapshot. + assert_eq!( + maximum_action_body_bytes(&action, ActionRouteKind::Availability), + snapshot + ); + assert_eq!( + maximum_action_body_bytes(&action, ActionRouteKind::TargetConditions), + snapshot + ); + // The invocation adds the file in base64 with its member framing. + assert!(maximum_action_body_bytes(&action, ActionRouteKind::Invoke) >= snapshot + 4_000); + + for (kind, mut body) in [ + ( + ActionRouteKind::Availability, + json!({"input":{"caseId":"00000000-0000-4000-8000-000000000001"}, + "targetInput":"caseId"}), + ), + ( + ActionRouteKind::TargetConditions, + json!({"input":{"caseId":"00000000-0000-4000-8000-000000000001"}}), + ), + ] { + assert!(parse_body(&action, kind, &serde_json::to_vec(&body).unwrap()).is_ok()); + body["attachments"] = json!({"evidence":{ + "contentType":"text/plain", "sha256":"0".repeat(64), "content":"ZmlsZQ=="}}); + assert!(parse_body(&action, kind, &serde_json::to_vec(&body).unwrap()).is_err()); + } +} + #[test] fn a_fixed_patch_target_remains_required_when_its_input_is_declared_optional() { let mut project = parse_project_yaml(PROJECT.as_bytes()).unwrap(); diff --git a/crates/registry-breg/src/artifacts.rs b/crates/registry-breg/src/artifacts.rs index 2dfaae7012..38b65afaf4 100644 --- a/crates/registry-breg/src/artifacts.rs +++ b/crates/registry-breg/src/artifacts.rs @@ -861,6 +861,10 @@ pub(crate) fn openapi_action_input_schema(action: &CompiledAction) -> Value { if !condition_inputs.is_empty() { required.push(Value::String("preconditions".to_owned())); } + if !action.execution.is_proposal() && !action.attachments.is_empty() { + properties.insert("attachments".to_owned(), action_attachments_schema(action)); + required.push(Value::String("attachments".to_owned())); + } json!({ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": format!("urn:breg:action:{}:invoke-input", action.id), @@ -876,6 +880,48 @@ pub(crate) fn openapi_action_input_schema(action: &CompiledAction) -> Value { }) } +/// The `attachments` member of an immediate Action request: exactly one file +/// for each declared attachment, in standard base64 with its media type and +/// lowercase SHA-256 digest. The server refuses a size, media type or digest +/// outside the slot's declaration with the slot's own problem code. +fn action_attachments_schema(action: &CompiledAction) -> Value { + let properties = action + .attachments + .iter() + .map(|(name, attachment)| { + let encoded = u64::from(attachment.maximum_bytes).div_ceil(3) * 4; + ( + name.clone(), + json!({ + "type": "object", + "additionalProperties": false, + "required": ["contentType", "sha256", "content"], + "properties": { + "contentType": {"type": "string", "enum": attachment.content_types}, + "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}, + "content": { + "type": "string", + "contentEncoding": "base64", + "minLength": 4, + "maxLength": encoded, + "pattern": "^[A-Za-z0-9+/]*={0,2}$", + }, + }, + "x-registry-recordType": attachment.entity_id, + "x-registry-attachmentSlot": attachment.slot_id, + "x-registry-maximumBytes": attachment.maximum_bytes, + }), + ) + }) + .collect::>(); + json!({ + "type": "object", + "additionalProperties": false, + "required": action.attachments.keys().collect::>(), + "properties": properties, + }) +} + pub(crate) fn openapi_action_condition_request_schema(action: &CompiledAction) -> Value { let condition_inputs = action_condition_inputs(action); json!({ @@ -1850,17 +1896,18 @@ fn action_operation_responses( }) .collect::>(); if status == "422" { - examples = action - .handler - .as_ref() - .into_iter() - .flat_map(|handler| &handler.refusals) - .map(|(code, label)| { - let mut example = problem_example(status, "action.refused", label); - example["refusalCode"] = json!(code); - (code.clone(), json!({"value": example})) - }) - .collect(); + examples.extend( + action + .handler + .as_ref() + .into_iter() + .flat_map(|handler| &handler.refusals) + .map(|(code, label)| { + let mut example = problem_example(status, "action.refused", label); + example["refusalCode"] = json!(code); + (code.clone(), json!({"value": example})) + }), + ); } responses.insert( status.to_owned(), @@ -1994,6 +2041,27 @@ fn action_problem_responses( ); } responses.insert("412", precondition_problems); + if !action.execution.is_proposal() && !action.attachments.is_empty() { + responses.insert( + "413", + vec![ProblemExample { + code: "attachment.too-large", + detail: "The file is larger than the attachment slot accepts.", + }], + ); + responses.entry("415").or_default().push(ProblemExample { + code: "attachment.content-type", + detail: "The file media type is not one the attachment slot accepts.", + }); + responses.entry("422").or_default().push(ProblemExample { + code: "attachment.digest-mismatch", + detail: "The file content does not match its declared SHA-256 digest.", + }); + responses.entry("409").or_default().push(ProblemExample { + code: "attachment.slot-write-once", + detail: "The record attachment slot already holds a file and is write-once.", + }); + } } if may_refuse_write { responses.insert("403", vec![WRITE_OUTSIDE_BOUNDARY]); @@ -2222,6 +2290,10 @@ fn openapi_document(input: OpenApiDocumentInput<'_>) -> Value { let mut paths = Map::new(); let mut input_schemas = Map::new(); let mut has_access_log = false; + let has_proposal_actions = actions + .actions + .iter() + .any(|action| action.execution.is_proposal()); for route in &routes.routes { // An import grant is exercised only through the ingestion-run // surface, which the static document does not describe. @@ -2258,6 +2330,7 @@ fn openapi_document(input: OpenApiDocumentInput<'_>) -> Value { request_schema_ref: &request_schema_ref, readable_fields: None, access_profiles: OpenApiAccessProfiles::All, + proposal_links: has_proposal_actions, }), ); if route.operation == Operation::Get @@ -2275,6 +2348,27 @@ fn openapi_document(input: OpenApiDocumentInput<'_>) -> Value { ); has_access_log = true; } + if route.operation == Operation::Get && read_path_for_route(route, entity).is_none() { + for slot in entity.attachments.values() { + if record_attachment_profiles(route, entity, &slot.id).is_empty() { + continue; + } + paths + .entry(record_attachment_path(route, &slot.id)) + .or_insert_with(|| Value::Object(Map::new())) + .as_object_mut() + .expect("OpenAPI path entries are objects") + .insert( + "get".to_owned(), + openapi_record_attachment_operation( + route, + entity, + slot, + OpenApiAccessProfiles::All, + ), + ); + } + } } let mut has_immediate_actions = false; @@ -2461,6 +2555,116 @@ pub(crate) fn openapi_access_log_operation( Value::Object(operation) } +pub(crate) fn record_attachment_path(route: &CompiledRoute, slot_id: &str) -> String { + format!("{}/attachments/{slot_id}", route.path) +} + +/// The route's profiles whose `readableAttachments` grant names the slot. +pub(crate) fn record_attachment_profiles<'a>( + route: &'a CompiledRoute, + entity: &CompiledEntity, + slot_id: &str, +) -> Vec<&'a String> { + route + .access_profiles + .iter() + .filter(|profile| { + entity + .access_profiles + .get(profile.as_str()) + .is_some_and(|grant| grant.readable_attachments.contains(slot_id)) + }) + .collect() +} + +/// The download of one record slot. With every profile, it names only the +/// profiles whose grant reads the slot. +pub(crate) fn openapi_record_attachment_operation( + route: &CompiledRoute, + entity: &CompiledEntity, + slot: &crate::model::CompiledRecordAttachmentSlot, + access_profiles: OpenApiAccessProfiles<'_>, +) -> Value { + debug_assert_eq!(route.operation, Operation::Get); + let mut operation = Map::from_iter([ + ( + "operationId".to_owned(), + json!(format!("{}.attachment.{}", route.id, slot.id)), + ), + ("x-registry-recordType".to_owned(), json!(entity.id)), + ("x-registry-operation".to_owned(), json!("attachment")), + ("x-registry-attachmentSlot".to_owned(), json!(slot.id)), + ( + "description".to_owned(), + json!( + "Download the file in this record slot. The selected profile must grant get on the record type and name the slot in readableAttachments. The record must be visible to it as on get. A record outside the caller's authority, an unknown record and an empty slot all answer 404." + ), + ), + ("security".to_owned(), json!([{"bearerAuth": []}])), + ]); + match access_profiles { + OpenApiAccessProfiles::All => { + operation.insert( + "x-registry-accessProfiles".to_owned(), + json!(record_attachment_profiles(route, entity, &slot.id)), + ); + } + OpenApiAccessProfiles::Selected(profile) => { + operation.insert("x-registry-accessProfile".to_owned(), json!(profile)); + } + } + operation.insert( + "parameters".to_owned(), + json!([ + path_parameter( + "record_id", + json!({"type": "string", "format": "uuid"}), + "Canonical record UUID." + ), + header_parameter( + "traceparent", + false, + traceparent_schema(), + "Optional W3C trace context. Responses carry Registry trace context for the request." + ), + access_profile_parameter(route.default_access_profile.is_none()) + ]), + ); + let content = slot + .content_types + .iter() + .map(|media_type| { + ( + media_type.clone(), + json!({"schema": {"type": "string", "format": "binary", "maxLength": slot.maximum_bytes}}), + ) + }) + .collect::>(); + operation.insert( + "responses".to_owned(), + json!({ + "200": { + "description": "The stored file, with the media type and SHA-256 digest recorded when it was attached", + "headers": { + "traceparent": traceparent_header("Trace context for this response."), + "Cache-Control": no_store_header(), + "Content-Disposition": {"schema": {"const": crate::attachment::DOWNLOAD_CONTENT_DISPOSITION}}, + "X-Content-Type-Options": {"schema": {"const": "nosniff"}}, + "Repr-Digest": { + "description": "RFC 9530 SHA-256 digest of the stored bytes.", + "schema": {"type": "string", "pattern": "^sha-256=:[A-Za-z0-9+/]{43}=:$"} + } + }, + "content": content + }, + "400": access_log_problem_response("The query is invalid."), + "404": access_log_problem_response("The record or its file was not found."), + "503": access_log_problem_response("The record attachment service is unavailable.") + }), + ); + Value::Object(operation) +} + fn access_log_problem_response(description: &str) -> Value { json!({ "description": description, @@ -2592,6 +2796,11 @@ pub(crate) struct OpenApiOperationSpec<'a> { pub request_schema_ref: &'a str, pub readable_fields: Option<&'a BTreeSet>, pub access_profiles: OpenApiAccessProfiles<'a>, + /// Whether a revision response declares the optional `proposal` member. + /// The static document declares it for a registry with a Proposal + /// Action. The caller-filtered document declares it only when the + /// selected profile would receive the link. + pub proposal_links: bool, } const OPENAPI_EXAMPLE_TRACE_ID: &str = "11111111111111111111111111111111"; @@ -3932,6 +4141,9 @@ fn revision_response_schema(spec: OpenApiOperationSpec<'_>, json_ld: bool) -> Va if let Some(change_context) = revision_change_context_schema(spec) { properties.insert("changeContext".to_owned(), change_context); } + if spec.proposal_links { + properties.insert("proposal".to_owned(), revision_proposal_schema()); + } let item = json!({ "type": "object", "additionalProperties": false, @@ -3960,6 +4172,21 @@ fn revision_response_schema(spec: OpenApiOperationSpec<'_>, json_ld: bool) -> Va } } +/// The Proposal submission that wrote a revision. Present only for a revision +/// a Proposal wrote, and only when the caller could read that Proposal. +fn revision_proposal_schema() -> Value { + json!({ + "type": "object", + "additionalProperties": false, + "required": ["actionId", "proposalId", "submissionVersion"], + "properties": { + "actionId": {"type": "string"}, + "proposalId": {"type": "string", "format": "uuid"}, + "submissionVersion": {"type": "integer", "format": "int64", "minimum": 1} + } + }) +} + fn revision_change_context_schema(spec: OpenApiOperationSpec<'_>) -> Option { let mut fields = Vec::new(); match spec.access_profiles { @@ -4410,6 +4637,7 @@ fn problem_example(status: &str, code: &str, detail: &str) -> Value { "409" => "Conflict", "410" => "Gone", "412" => "Precondition Failed", + "413" => "Content Too Large", "415" => "Unsupported Media Type", "422" => "Unprocessable Entity", "428" => "Precondition Required", @@ -5044,6 +5272,7 @@ mod spatial_tests { request_schema_ref: "site", readable_fields: None, access_profiles: OpenApiAccessProfiles::Selected(profile), + proposal_links: false, }) } diff --git a/crates/registry-breg/src/attachment.rs b/crates/registry-breg/src/attachment.rs index 622122d148..0b59d3cd4b 100644 --- a/crates/registry-breg/src/attachment.rs +++ b/crates/registry-breg/src/attachment.rs @@ -7,10 +7,19 @@ use std::fmt; use sha2::{Digest, Sha256}; /// Downloads carry no filename: no slot metadata holds one, and deriving one would -/// echo authored configuration text back into a response header. -#[cfg(feature = "runtime")] +/// echo authored configuration text back into a response header. The +/// generated contract publishes the same value. pub(crate) const DOWNLOAD_CONTENT_DISPOSITION: &str = "attachment"; +/// The audit identity of a Record file read. Only a declared slot may be +/// supplied: an unknown caller-supplied name is represented by `None`. +pub(crate) fn record_attachment_operation_id(record_get: &str, slot: Option<&str>) -> String { + match slot { + Some(slot) => format!("{record_get}:attachment:{slot}"), + None => format!("{record_get}:attachment"), + } +} + #[derive(Clone, Eq, PartialEq)] pub struct AttachmentMutation { pub slot_id: String, diff --git a/crates/registry-breg/src/attachment_store.rs b/crates/registry-breg/src/attachment_store.rs index f2fb8075b2..db3d4fcfc1 100644 --- a/crates/registry-breg/src/attachment_store.rs +++ b/crates/registry-breg/src/attachment_store.rs @@ -30,6 +30,9 @@ pub(crate) const ATTACHMENT_TABLES: &[(&str, &[&str])] = &[ "registry_proposal_attachments", &["INSERT", "SELECT", "UPDATE", "DELETE"], ), + // The runtime only adds record references. Erasure runs as the owning + // migration role, and a write-once slot is never updated or deleted. + ("registry_record_attachments", &["INSERT", "SELECT"]), ]; /// The verification job table in the shape `registry-platform-dispatch` @@ -77,19 +80,43 @@ pub(crate) async fn install( proposal_id uuid NOT NULL, submission_version bigint NOT NULL CHECK (submission_version BETWEEN 1 AND 4294967295), slot_id text NOT NULL, - sha256 text NOT NULL CHECK (sha256 ~ '^[0-9a-f]{64}$'), - content_type text NOT NULL, - byte_size bigint NOT NULL CHECK (byte_size BETWEEN 0 AND 16777216), + sha256 text CHECK (sha256 ~ '^[0-9a-f]{64}$'), + content_type text, + byte_size bigint CHECK (byte_size BETWEEN 0 AND 16777216), uploaded_at timestamptz, uploaded_by text, erased_at timestamptz, PRIMARY KEY (action_id, proposal_id, submission_version, slot_id), FOREIGN KEY (action_id,proposal_id) REFERENCES registry_internal.registry_proposal_state, - CHECK ((erased_at IS NULL AND uploaded_at IS NOT NULL AND uploaded_by IS NOT NULL) - OR (erased_at IS NOT NULL AND uploaded_at IS NULL AND uploaded_by IS NULL)) + CHECK ((erased_at IS NULL AND sha256 IS NOT NULL AND content_type IS NOT NULL + AND byte_size IS NOT NULL AND uploaded_at IS NOT NULL AND uploaded_by IS NOT NULL) + OR (erased_at IS NOT NULL AND sha256 IS NULL AND content_type IS NULL + AND byte_size IS NULL AND uploaded_at IS NULL AND uploaded_by IS NULL)) ); CREATE INDEX IF NOT EXISTS registry_attachment_live_references - ON registry_internal.registry_proposal_attachments (sha256) WHERE erased_at IS NULL;" + ON registry_internal.registry_proposal_attachments (sha256) WHERE erased_at IS NULL; + CREATE TABLE IF NOT EXISTS registry_internal.registry_record_attachments ( + entity_id text NOT NULL CHECK (entity_id <> ''), + record_id uuid NOT NULL, + slot_id text NOT NULL CHECK (slot_id <> ''), + sha256 text CHECK (sha256 ~ '^[0-9a-f]{64}$'), + content_type text CHECK (content_type <> ''), + byte_size bigint CHECK (byte_size BETWEEN 1 AND 16777216), + attached_revision bigint CHECK (attached_revision > 0), + attached_at timestamptz, + attached_by text, + erased_at timestamptz, + PRIMARY KEY (entity_id, record_id, slot_id), + CHECK ((erased_at IS NULL AND sha256 IS NOT NULL AND content_type IS NOT NULL + AND byte_size IS NOT NULL AND attached_revision IS NOT NULL + AND ((attached_at IS NOT NULL AND attached_by IS NOT NULL) + OR (attached_at IS NULL AND attached_by IS NULL))) + OR (erased_at IS NOT NULL AND sha256 IS NULL AND content_type IS NULL + AND byte_size IS NULL AND attached_revision IS NULL + AND attached_at IS NULL AND attached_by IS NULL)) + ); + CREATE INDEX IF NOT EXISTS registry_record_attachment_live_references + ON registry_internal.registry_record_attachments (sha256) WHERE erased_at IS NULL;" ).await.map_err(unavailable)?; let revoke_grantees = crate::postgres::RuntimeRevoke::detect(client, role) .await @@ -370,24 +397,7 @@ pub(crate) async fn put( ) .await .map_err(unavailable)?; - if verification_policy != "disabled" { - // A new verdict row and its verification job commit together, so - // every pending verdict has exactly one job a worker can claim. - let created = client - .query_opt( - "INSERT INTO registry_internal.registry_attachment_verification - (sha256,policy_digest,content_type) VALUES ($1,$2,$3) ON CONFLICT DO NOTHING - RETURNING verification_id", - &[&hash, &verification_policy, &content_type], - ) - .await - .map_err(unavailable)?; - if let Some(row) = created { - crate::attachment_verification_worker::enqueue(client, row.get(0)) - .await - .map_err(|_| MutationError::Unavailable)?; - } - } + request_verification(client, &hash, content_type, verification_policy).await?; let row=client.query_one("INSERT INTO registry_internal.registry_proposal_attachments (action_id,proposal_id,submission_version,slot_id,sha256,content_type,byte_size,uploaded_at,uploaded_by) VALUES ($1,$2,$3,$4,$5,$6,$7,transaction_timestamp(),$8) ON CONFLICT @@ -410,6 +420,34 @@ pub(crate) async fn put( }) } +async fn request_verification( + client: &Transaction<'_>, + hash: &str, + content_type: &str, + verification_policy: &str, +) -> Result<(), MutationError> { + if verification_policy == "disabled" { + return Ok(()); + } + // A new verdict row and its verification job commit together, so + // every pending verdict has exactly one job a worker can claim. + let created = client + .query_opt( + "INSERT INTO registry_internal.registry_attachment_verification + (sha256,policy_digest,content_type) VALUES ($1,$2,$3) ON CONFLICT DO NOTHING + RETURNING verification_id", + &[&hash, &verification_policy, &content_type], + ) + .await + .map_err(unavailable)?; + if let Some(row) = created { + crate::attachment_verification_worker::enqueue(client, row.get(0)) + .await + .map_err(|_| MutationError::Unavailable)?; + } + Ok(()) +} + pub(crate) async fn remove( client: &Transaction<'_>, entity: &str, @@ -453,6 +491,8 @@ async fn retire_unreferenced(client: &impl GenericClient, hash: &str) -> Result< DELETE FROM registry_internal.registry_attachment_verification v WHERE sha256=$1 AND NOT EXISTS (SELECT 1 FROM registry_internal.registry_proposal_attachments a WHERE a.sha256=v.sha256 AND a.content_type=v.content_type AND a.erased_at IS NULL) + AND NOT EXISTS (SELECT 1 FROM registry_internal.registry_record_attachments r + WHERE r.sha256=v.sha256 AND r.content_type=v.content_type AND r.erased_at IS NULL) RETURNING verification_id) DELETE FROM registry_internal.registry_attachment_verification_jobs j USING retired WHERE j.verification_id=retired.verification_id AND j.state<>'leased'", @@ -462,7 +502,9 @@ async fn retire_unreferenced(client: &impl GenericClient, hash: &str) -> Result< .map_err(unavailable)?; client.execute("UPDATE registry_internal.registry_attachment_blobs b SET state='delete_pending', deletion_checked_at=NULL WHERE sha256=$1 AND NOT EXISTS (SELECT 1 FROM registry_internal.registry_proposal_attachments a - WHERE a.sha256=b.sha256 AND a.erased_at IS NULL)", &[&hash]).await.map_err(unavailable)?; + WHERE a.sha256=b.sha256 AND a.erased_at IS NULL) + AND NOT EXISTS (SELECT 1 FROM registry_internal.registry_record_attachments r + WHERE r.sha256=b.sha256 AND r.erased_at IS NULL)", &[&hash]).await.map_err(unavailable)?; client .execute( "DELETE FROM registry_internal.registry_attachment_blobs WHERE sha256=$1 AND @@ -670,6 +712,7 @@ pub(crate) async fn erase( let count = client .execute( "UPDATE registry_internal.registry_proposal_attachments SET + sha256=NULL,content_type=NULL,byte_size=NULL, uploaded_by=NULL,uploaded_at=NULL,erased_at=transaction_timestamp() WHERE action_id=$1 AND proposal_id=$2 AND submission_version=$3 AND erased_at IS NULL", &[&entity, &id, &version], @@ -682,12 +725,288 @@ pub(crate) async fn erase( Ok(count) } +/// One record slot's reference to deduplicated bytes. A record slot is +/// write-once: its first reference fills it for good, and an erased +/// reference stays as a tombstone that keeps the slot filled. The tombstone +/// keeps the digest, media type, size and filling revision, and drops who +/// filled the slot and when. +pub(crate) struct RecordAttachmentReference<'a> { + pub entity_id: &'a str, + pub record_id: Uuid, + pub slot_id: &'a str, + pub sha256: &'a str, + pub content_type: &'a str, + pub byte_size: u64, + /// The record revision that filled the slot. History erasure through + /// this revision erases the reference. + pub attached_revision: i64, + /// A keyed actor reference, never a raw principal. + pub attached_by: &'a str, +} + +/// Fill a record slot with a reference to bytes already live in the store, +/// without copying them. The caller's transaction also writes the record +/// revision the reference names, so both commit or neither does. +/// +/// # Errors +/// +/// [`MutationError::AttachmentSlotWriteOnce`] when the slot already holds a +/// reference, live or erased. [`MutationError::PreconditionFailed`] when the +/// bytes are not live under this size or verification already rejected them. +/// [`MutationError::Conflict`] when the pinned storage binding differs. +pub(crate) async fn attach_record_reference( + client: &Transaction<'_>, + reference: &RecordAttachmentReference<'_>, + backend: &str, + verification_policy: &str, +) -> Result<(), MutationError> { + verify_backend_binding(client, backend, verification_policy).await?; + lock_hash(client, reference.sha256).await?; + let size = i64::try_from(reference.byte_size).map_err(|_| MutationError::InvalidRequest)?; + let live = client + .query_opt( + "SELECT 1 FROM registry_internal.registry_attachment_blobs + WHERE sha256=$1 AND byte_size=$2 AND backend_id=$3 AND state='live'", + &[&reference.sha256, &size, &backend], + ) + .await + .map_err(unavailable)?; + if live.is_none() { + return Err(MutationError::PreconditionFailed); + } + if verification_status(client, reference.sha256, reference.content_type).await? + == AttachmentVerificationStatus::Rejected + { + return Err(MutationError::PreconditionFailed); + } + let inserted = client + .query_opt( + "INSERT INTO registry_internal.registry_record_attachments + (entity_id,record_id,slot_id,sha256,content_type,byte_size,attached_revision, + attached_at,attached_by) + VALUES ($1,$2,$3,$4,$5,$6,$7,transaction_timestamp(),$8) + ON CONFLICT (entity_id,record_id,slot_id) DO NOTHING RETURNING 1", + &[ + &reference.entity_id, + &reference.record_id, + &reference.slot_id, + &reference.sha256, + &reference.content_type, + &size, + &reference.attached_revision, + &reference.attached_by, + ], + ) + .await + .map_err(unavailable)?; + if inserted.is_none() { + return Err(MutationError::AttachmentSlotWriteOnce); + } + request_verification( + client, + reference.sha256, + reference.content_type, + verification_policy, + ) + .await +} + +/// Store one file's bytes and fill a record slot with them in the caller's +/// transaction. External bytes were staged in a separately committed +/// transaction and written under this transaction's hash lock first. +pub(crate) async fn put_record_attachment( + client: &Transaction<'_>, + reference: &RecordAttachmentReference<'_>, + bytes: &[u8], + backend: &str, + verification_policy: &str, +) -> Result<(), MutationError> { + if bytes.is_empty() + || bytes.len() > 16777216 + || bytes.len() as u64 != reference.byte_size + || content_hash(bytes) != reference.sha256 + { + return Err(MutationError::InvalidRequest); + } + pin_backend(client, backend, verification_policy).await?; + lock_hash(client, reference.sha256).await?; + let size = bytes.len() as i64; + if backend == "database" { + client + .execute( + "INSERT INTO registry_internal.registry_attachment_blobs + (sha256,byte_size,backend_id,content,state) VALUES ($1,$2,'database',$3,'live') + ON CONFLICT DO NOTHING", + &[&reference.sha256, &size, &bytes], + ) + .await + .map_err(unavailable)?; + } + require_backend(client, reference.sha256, backend, reference.byte_size).await?; + if backend == "database" { + let intact: bool = client + .query_one( + "SELECT content=$2 FROM registry_internal.registry_attachment_blobs WHERE sha256=$1", + &[&reference.sha256, &bytes], + ) + .await + .map_err(unavailable)? + .get(0); + if !intact { + return Err(MutationError::Unavailable); + } + } + client + .execute( + "UPDATE registry_internal.registry_attachment_blobs SET state='live', + deletion_checked_at=NULL WHERE sha256=$1", + &[&reference.sha256], + ) + .await + .map_err(unavailable)?; + attach_record_reference(client, reference, backend, verification_policy).await +} + +/// One record slot's admitted bytes: database content, or `None` for bytes +/// the caller reads from the pinned external backend under the hash lock. +pub(crate) struct StoredRecordAttachment { + pub sha256: String, + pub content_type: String, + pub byte_size: u64, + pub backend_id: String, + pub content: Option>, +} + +/// Admit one record slot's bytes for a read the caller already authorized +/// for the record in this transaction. The hash lock lasts until the +/// transaction ends, so external bytes are read before deletion can run. +/// An empty, erased, or unverified slot answers `None`. +/// +/// # Errors +/// +/// [`MutationError::Unavailable`] when a live reference has no live bytes of +/// its recorded size, which only a storage fault produces. +pub(crate) async fn load_record_attachment( + client: &impl GenericClient, + entity_id: &str, + record_id: Uuid, + slot_id: &str, +) -> Result, MutationError> { + let Some(row) = client + .query_opt( + "SELECT sha256,content_type FROM registry_internal.registry_record_attachments + WHERE entity_id=$1 AND record_id=$2 AND slot_id=$3 AND erased_at IS NULL", + &[&entity_id, &record_id, &slot_id], + ) + .await + .map_err(unavailable)? + else { + return Ok(None); + }; + let sha256: String = row.get(0); + let content_type: String = row.get(1); + lock_hash(client, &sha256).await?; + if !verification_status(client, &sha256, &content_type) + .await? + .permits_content() + { + return Ok(None); + } + // Recheck the reference after acquiring the deletion lock. + let Some(row) = client + .query_opt( + "SELECT a.byte_size, b.state='live' AND b.byte_size=a.byte_size, b.backend_id, b.content + FROM registry_internal.registry_record_attachments a + LEFT JOIN registry_internal.registry_attachment_blobs b ON b.sha256=a.sha256 + WHERE a.entity_id=$1 AND a.record_id=$2 AND a.slot_id=$3 AND a.erased_at IS NULL + AND a.sha256=$4", + &[&entity_id, &record_id, &slot_id, &sha256], + ) + .await + .map_err(unavailable)? + else { + return Ok(None); + }; + if row.get::<_, Option>(1) != Some(true) { + return Err(MutationError::Unavailable); + } + Ok(Some(StoredRecordAttachment { + sha256, + content_type, + byte_size: u64::try_from(row.get::<_, i64>(0)).map_err(|_| MutationError::Unavailable)?, + backend_id: row.get(2), + content: row.get(3), + })) +} + +pub(crate) struct RecordAttachmentErasure { + pub erased: u64, + pub kept: u64, +} + +/// Erase only explicitly selected current file slots. Clear attribution +/// introduced by erased history when a revision boundary is supplied. Each +/// erased slot keeps only its identity and erasure time, so it stays written. +pub(crate) async fn erase_record_attachments( + client: &impl GenericClient, + entity_id: &str, + record_id: Uuid, + through_revision: Option, + erase_files: &[String], +) -> Result { + let hashes = client + .query( + "SELECT DISTINCT sha256 FROM registry_internal.registry_record_attachments + WHERE entity_id=$1 AND record_id=$2 AND slot_id=ANY($3) AND erased_at IS NULL + ORDER BY sha256", + &[&entity_id, &record_id, &erase_files], + ) + .await + .map_err(unavailable)?; + for row in &hashes { + lock_hash(client, &row.get::<_, String>(0)).await?; + } + let count = client + .execute( + "UPDATE registry_internal.registry_record_attachments SET + sha256=NULL,content_type=NULL,byte_size=NULL,attached_revision=NULL, + attached_by=NULL,attached_at=NULL,erased_at=transaction_timestamp() + WHERE entity_id=$1 AND record_id=$2 AND slot_id=ANY($3) AND erased_at IS NULL", + &[&entity_id, &record_id, &erase_files], + ) + .await + .map_err(unavailable)?; + for row in hashes { + retire_unreferenced(client, &row.get::<_, String>(0)).await?; + } + if let Some(through_revision) = through_revision { + client.execute( + "UPDATE registry_internal.registry_record_attachments SET attached_by=NULL,attached_at=NULL + WHERE entity_id=$1 AND record_id=$2 AND attached_revision<=$3 AND erased_at IS NULL", + &[&entity_id, &record_id, &through_revision], + ).await.map_err(unavailable)?; + } + let kept: i64 = client + .query_one( + "SELECT count(*) FROM registry_internal.registry_record_attachments + WHERE entity_id=$1 AND record_id=$2 AND erased_at IS NULL", + &[&entity_id, &record_id], + ) + .await + .map_err(unavailable)? + .get(0); + Ok(RecordAttachmentErasure { + erased: count, + kept: u64::try_from(kept).map_err(|_| MutationError::Unavailable)?, + }) +} + fn unavailable(_: tokio_postgres::Error) -> MutationError { MutationError::Unavailable } /// Only selected fields are queried, including after operator erasure. Erased -/// values carry no uploader identity or timestamp and never confer byte access. +/// values carry no file metadata and never confer byte access. #[cfg(feature = "postgres-test")] pub(crate) async fn metadata_for_read( client: &impl GenericClient, @@ -714,8 +1033,10 @@ pub(crate) async fn metadata_for_read( } Ok(rows.into_iter().map(|row| { let slot:String=row.get(0);let erased:bool=row.get(3); - let mut value=serde_json::json!({"slotId":slot,"proposalVersion":version,"sha256":row.get::<_,String>(1),"byteSize":row.get::<_,i64>(2),"filled":true,"erased":erased}); + let mut value=serde_json::json!({"slotId":slot,"proposalVersion":version,"filled":true,"erased":erased}); if !erased { + value["sha256"]=serde_json::json!(row.get::<_,String>(1)); + value["byteSize"]=serde_json::json!(row.get::<_,i64>(2)); value["contentType"]=serde_json::json!(row.get::<_,String>(4)); value["uploadedAt"]=serde_json::json!(row.get::<_,Option>(5)); value["uploadedBy"]=serde_json::json!(row.get::<_,Option>(6)); @@ -771,7 +1092,9 @@ pub(crate) async fn finish_external_delete( WHERE sha256=$1 AND backend_id=$2 AND state IN ('staged','delete_pending','delete_confirmed') AND NOT EXISTS (SELECT 1 FROM registry_internal.registry_proposal_attachments a - WHERE a.sha256=b.sha256 AND a.erased_at IS NULL)", + WHERE a.sha256=b.sha256 AND a.erased_at IS NULL) + AND NOT EXISTS (SELECT 1 FROM registry_internal.registry_record_attachments r + WHERE r.sha256=b.sha256 AND r.erased_at IS NULL)", &[&hash, &backend], ) .await @@ -792,7 +1115,9 @@ pub(crate) async fn fail_external_delete( WHERE sha256=$1 AND backend_id=$2 AND state IN ('staged','delete_pending','delete_confirmed') AND NOT EXISTS (SELECT 1 FROM registry_internal.registry_proposal_attachments a - WHERE a.sha256=b.sha256 AND a.erased_at IS NULL)", + WHERE a.sha256=b.sha256 AND a.erased_at IS NULL) + AND NOT EXISTS (SELECT 1 FROM registry_internal.registry_record_attachments r + WHERE r.sha256=b.sha256 AND r.erased_at IS NULL)", &[&hash, &backend], ) .await @@ -957,6 +1282,44 @@ pub mod test_support { ) -> Result<(), MutationError> { super::verify_backend_binding(client, backend, policy).await } + /// Fill a record slot with database-stored bytes in one transaction, + /// as a second writer would, and commit only when the store accepts it. + pub async fn attach_record( + client: &mut tokio_postgres::Client, + entity: &str, + record: uuid::Uuid, + slot: &str, + content_type: &str, + bytes: &[u8], + revision: i64, + ) -> Result<(), MutationError> { + let transaction = client + .transaction() + .await + .map_err(|_| MutationError::Unavailable)?; + let sha256 = super::content_hash(bytes); + super::put_record_attachment( + &transaction, + &super::RecordAttachmentReference { + entity_id: entity, + record_id: record, + slot_id: slot, + sha256: &sha256, + content_type, + byte_size: bytes.len() as u64, + attached_revision: revision, + attached_by: "attacher", + }, + bytes, + "database", + "disabled", + ) + .await?; + transaction + .commit() + .await + .map_err(|_| MutationError::Unavailable) + } /// Load the bytes of one verdict row under `lease_token`, as a leased /// verification job does: `true` when the row still waits for a /// verdict, `false` when it is settled. @@ -1075,8 +1438,10 @@ pub(crate) async fn load_verification_content( WHERE v.verification_id=$1 AND v.sha256=$2 AND v.content_type=$3 AND v.verdict='pending' AND j.state='leased' AND j.lease_token=$4 AND j.lease_expires_at>transaction_timestamp() AND b.state='live' AND b.backend_id=$5 AND b.byte_size=$6 - AND EXISTS (SELECT 1 FROM registry_internal.registry_proposal_attachments a - WHERE a.sha256=v.sha256 AND a.content_type=v.content_type AND a.erased_at IS NULL)", + AND (EXISTS (SELECT 1 FROM registry_internal.registry_proposal_attachments a + WHERE a.sha256=v.sha256 AND a.content_type=v.content_type AND a.erased_at IS NULL) + OR EXISTS (SELECT 1 FROM registry_internal.registry_record_attachments r + WHERE r.sha256=v.sha256 AND r.content_type=v.content_type AND r.erased_at IS NULL))", &[ &target.verification_id, &target.sha256, diff --git a/crates/registry-breg/src/attachment_verification_worker.rs b/crates/registry-breg/src/attachment_verification_worker.rs index 635a612d63..2c7faa9c1f 100644 --- a/crates/registry-breg/src/attachment_verification_worker.rs +++ b/crates/registry-breg/src/attachment_verification_worker.rs @@ -113,10 +113,14 @@ macro_rules! verifiable { "(verdict.policy_digest = (SELECT verification_policy \ FROM {schema}.registry_attachment_storage_binding WHERE singleton) \ AND blob.state = 'live' \ - AND EXISTS (SELECT 1 FROM {schema}.registry_proposal_attachments AS reference \ + AND (EXISTS (SELECT 1 FROM {schema}.registry_proposal_attachments AS reference \ WHERE reference.sha256 = verdict.sha256 \ AND reference.content_type = verdict.content_type \ - AND reference.erased_at IS NULL))" + AND reference.erased_at IS NULL) \ + OR EXISTS (SELECT 1 FROM {schema}.registry_record_attachments AS record_reference \ + WHERE record_reference.sha256 = verdict.sha256 \ + AND record_reference.content_type = verdict.content_type \ + AND record_reference.erased_at IS NULL)))" }; } /// A job is claimable when its verdict row is gone or decided, so it can diff --git a/crates/registry-breg/src/compiler.rs b/crates/registry-breg/src/compiler.rs index 228fe91290..e420897f93 100644 --- a/crates/registry-breg/src/compiler.rs +++ b/crates/registry-breg/src/compiler.rs @@ -4133,6 +4133,7 @@ pub(crate) fn expand_project_access( require_access_reason: profile.require_access_reason, operations: grant.operations.clone(), readable_fields: grant.readable_fields.clone(), + readable_attachments: grant.readable_attachments.clone(), writable_fields: grant.writable_fields.clone(), filterable_fields: grant.filterable_fields.clone(), sortable_fields: grant.sortable_fields.clone(), @@ -4337,6 +4338,7 @@ fn validate_entities( _ => {} } validate_entity_fields(entity, entities, errors); + validate_record_attachments(entity, errors); validate_access_log(entity, entities, errors); validate_geojson(entity, errors); validate_derived(entity, errors); @@ -4366,6 +4368,69 @@ fn validate_entities( validate_read_path_cycles(entities, errors); } +fn validate_record_attachments(entity: &EntitySource, errors: &mut Vec) { + if entity.attachments.is_empty() { + return; + } + let field_names = entity + .fields + .iter() + .flat_map(|field| { + [ + field.id.clone(), + field + .api_name + .clone() + .unwrap_or_else(|| default_api_name(&field.id)), + ] + }) + .chain(derived_field_map(entity).keys().map(|id| (*id).to_owned())) + .collect::>(); + attachments::validate_record_slots( + &entity.attachments, + &field_names, + "recordTypes[].attachments", + errors, + ); +} + +/// A profile reads a record slot only through the record's own `get` grant, +/// so `readableAttachments` names declared slots on a profile that grants +/// `get`. +fn validate_attachment_grant( + entity: &EntitySource, + access: &AccessProfileSource, + errors: &mut Vec, +) { + if access.readable_attachments.is_empty() { + return; + } + let path = format!( + "recordTypes[id={}].accessProfiles[id={}].readableAttachments", + entity.id, access.id + ); + if !access.operations.contains(&Operation::Get) { + errors.push(Diagnostic::error( + "breg.access-profile.attachment-grant-invalid", + &path, + "readableAttachments requires the get operation on the record type", + )); + } + for slot in &access.readable_attachments { + if !entity + .attachments + .iter() + .any(|declared| &declared.id == slot) + { + errors.push(Diagnostic::error( + "breg.access-profile.attachment-grant-invalid", + format!("{path}[slot={slot}]"), + "readableAttachments must name an attachment slot the record type declares", + )); + } + } +} + fn validate_access_log( entity: &EntitySource, entities: &BTreeMap, @@ -5959,6 +6024,7 @@ fn validate_profiles( } validate_spatial_queries(access, entity, errors); validate_required_filters(access, entity, errors); + validate_attachment_grant(entity, access, errors); let mut read_processed = access.readable_fields.clone(); read_processed.extend(access.filterable_fields.iter().cloned()); read_processed.extend(access.sortable_fields.iter().cloned()); @@ -8189,6 +8255,7 @@ fn compile_entities( derived_relations, source_relation, selector_profiles, + attachments: attachments::compile_record_slots(&source.attachments), timers: BTreeMap::new(), read_paths, change_control: source.mutation_policy.clone().map(|change_control| { diff --git a/crates/registry-breg/src/compiler/attachments.rs b/crates/registry-breg/src/compiler/attachments.rs index 01f2370c75..47672b78df 100644 --- a/crates/registry-breg/src/compiler/attachments.rs +++ b/crates/registry-breg/src/compiler/attachments.rs @@ -4,37 +4,91 @@ use std::collections::{BTreeMap, BTreeSet}; use crate::contract::{ - AttachmentSlotSource, MAX_ATTACHMENT_BYTES, MAX_ATTACHMENT_CONTENT_TYPES, MAX_ATTACHMENT_SLOTS, + AttachmentSlotSource, RecordAttachmentSlotSource, MAX_ATTACHMENT_BYTES, + MAX_ATTACHMENT_CONTENT_TYPES, MAX_ATTACHMENT_SLOTS, }; use crate::diagnostics::Diagnostic; use crate::logical_names::reserved_logical_name; -use crate::model::CompiledAttachmentSlot; +use crate::model::{CompiledAttachmentSlot, CompiledRecordAttachmentSlot}; + +/// The members every slot declaration shares, whoever owns the slot. +struct SlotShape<'a> { + id: &'a String, + maximum_bytes: u32, + content_types: &'a [String], +} pub(crate) fn validate_slots( slots: &[AttachmentSlotSource], field_names: &BTreeSet, base: &str, errors: &mut Vec, +) { + let shapes = slots + .iter() + .map(|slot| SlotShape { + id: &slot.id, + maximum_bytes: slot.maximum_bytes, + content_types: &slot.content_types, + }) + .collect::>(); + validate_shapes(&shapes, "a Proposal", field_names, base, errors); +} + +/// Validates a record type's slots. Each must also declare `writeOnce: true`, +/// the only mode a record slot has. +pub(crate) fn validate_record_slots( + slots: &[RecordAttachmentSlotSource], + field_names: &BTreeSet, + base: &str, + errors: &mut Vec, +) { + let shapes = slots + .iter() + .map(|slot| SlotShape { + id: &slot.id, + maximum_bytes: slot.maximum_bytes, + content_types: &slot.content_types, + }) + .collect::>(); + validate_shapes(&shapes, "a record type", field_names, base, errors); + for (index, slot) in slots.iter().enumerate() { + if !slot.write_once { + errors.push(Diagnostic::error( + "breg.attachment.write-once-required", + format!("{base}[{index}].writeOnce"), + "a record attachment slot must declare writeOnce: true", + )); + } + } +} + +fn validate_shapes( + slots: &[SlotShape<'_>], + owner: &str, + field_names: &BTreeSet, + base: &str, + errors: &mut Vec, ) { if slots.len() > MAX_ATTACHMENT_SLOTS { errors.push(Diagnostic::error( "breg.attachment.slots-bounds-invalid", base, - "a Proposal supports at most eight attachment slots", + &format!("{owner} supports at most eight attachment slots"), )); } let mut ids = BTreeSet::new(); for (index, slot) in slots.iter().enumerate() { let path = format!("{base}[{index}]"); - super::validate_id(&slot.id, &format!("{path}.id"), errors); - if reserved_logical_name(&slot.id) || field_names.contains(&slot.id) { + super::validate_id(slot.id, &format!("{path}.id"), errors); + if reserved_logical_name(slot.id) || field_names.contains(slot.id) { errors.push(Diagnostic::error( "breg.attachment.id-collision", format!("{path}.id"), "an attachment ID must not collide with a stored, derived, API, or server-owned field name", )); } - if !ids.insert(&slot.id) { + if !ids.insert(slot.id) { errors.push(Diagnostic::error( "breg.attachment.id-duplicate", format!("{path}.id"), @@ -116,3 +170,22 @@ pub(crate) fn compile_slots( }) .collect() } + +pub(crate) fn compile_record_slots( + slots: &[RecordAttachmentSlotSource], +) -> BTreeMap { + slots + .iter() + .map(|slot| { + ( + slot.id.clone(), + CompiledRecordAttachmentSlot { + id: slot.id.clone(), + maximum_bytes: slot.maximum_bytes, + content_types: slot.content_types.clone(), + classification: slot.classification, + }, + ) + }) + .collect() +} diff --git a/crates/registry-breg/src/compiler/statistics.rs b/crates/registry-breg/src/compiler/statistics.rs index f899f524b1..6ae477f835 100644 --- a/crates/registry-breg/src/compiler/statistics.rs +++ b/crates/registry-breg/src/compiler/statistics.rs @@ -810,6 +810,7 @@ fn authentication_profile( required_purposes: profile.required_purposes.clone(), operations: Default::default(), readable_fields: Default::default(), + readable_attachments: Default::default(), writable_fields: Default::default(), filterable_fields: Default::default(), required_filters: Vec::new(), diff --git a/crates/registry-breg/src/contract.rs b/crates/registry-breg/src/contract.rs index d20530569f..05695dc317 100644 --- a/crates/registry-breg/src/contract.rs +++ b/crates/registry-breg/src/contract.rs @@ -1879,6 +1879,9 @@ pub struct EntitySource { pub fields: Vec, #[serde(default, skip_serializing_if = "Option::is_none")] pub geojson: Option, + /// Write-once file slots filled by immediate Action create effects. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub attachments: Vec, /// Mandatory request-access requirements checked against every profile, including module contributions. #[serde( default, @@ -2309,6 +2312,40 @@ pub struct AttachmentSlotSource { pub classification: Classification, } +/// One file slot on a record type. A file enters it through an immediate +/// Action create effect in the same request, or when an applied Proposal +/// promotes one of its files. Once written it never changes. +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[serde(deny_unknown_fields, rename_all = "camelCase")] +pub struct RecordAttachmentSlotSource { + #[serde(deserialize_with = "local_id")] + #[cfg_attr(feature = "schema", schemars(with = "registry_platform_yaml::LocalId"))] + pub id: String, + #[serde(deserialize_with = "bounded_u32::<_, 1, MAX_ATTACHMENT_BYTES>")] + #[cfg_attr( + feature = "schema", + schemars(with = "BoundedU32<1, MAX_ATTACHMENT_BYTES>") + )] + pub maximum_bytes: u32, + pub content_types: Vec, + pub classification: Classification, + /// Must be `true`: a record slot holds the first file written to it. + pub write_once: bool, +} + +/// Where an effect takes one record slot's file from. In an immediate +/// Action it names a file in the same request. In a Proposal Action it names +/// a Proposal attachment slot, and applying the Proposal promotes that file. +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[serde(deny_unknown_fields, rename_all = "camelCase")] +pub struct EffectAttachmentSource { + #[serde(deserialize_with = "local_id")] + #[cfg_attr(feature = "schema", schemars(with = "registry_platform_yaml::LocalId"))] + pub from_attachment: String, +} + #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(deny_unknown_fields, rename_all = "camelCase")] @@ -2886,6 +2923,19 @@ pub struct ActionEffectSource { pub set: BTreeMap, #[serde(default)] pub clear: UniqueSet, + /// Record slots the effect fills, keyed by slot id. An immediate create + /// effect takes files from the same request. A Proposal create or patch + /// effect promotes files from Proposal attachment slots on apply. + #[serde( + default, + skip_serializing_if = "BTreeMap::is_empty", + deserialize_with = "local_id_map" + )] + #[cfg_attr( + feature = "schema", + schemars(schema_with = "local_id_map_schema::") + )] + pub attachments: BTreeMap, } #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] @@ -5111,6 +5161,9 @@ pub struct AccessProfileSource { pub operations: UniqueSet, #[serde(default)] pub readable_fields: UniqueSet, + /// Record attachment slots the profile may download. Requires `get`. + #[serde(default, skip_serializing_if = "UniqueSet::is_empty")] + pub readable_attachments: UniqueSet, #[serde(default)] pub writable_fields: UniqueSet, #[serde(default)] @@ -5672,6 +5725,9 @@ pub struct EntityPermissionSource { pub entity: String, pub operations: UniqueSet, pub readable_fields: UniqueSet, + /// Record attachment slots the profile may download. Requires `get`. + #[serde(skip_serializing_if = "UniqueSet::is_empty")] + pub readable_attachments: UniqueSet, pub writable_fields: UniqueSet, pub filterable_fields: UniqueSet, /// Alternative search criteria; a `list` must satisfy at least one. diff --git a/crates/registry-breg/src/contract/sentinel.rs b/crates/registry-breg/src/contract/sentinel.rs index 16264f82d0..e06f906f69 100644 --- a/crates/registry-breg/src/contract/sentinel.rs +++ b/crates/registry-breg/src/contract/sentinel.rs @@ -472,6 +472,9 @@ pub(super) struct AuthoredModuleProfile { operations: UniqueSet, #[serde(default)] readable_fields: UniqueSet, + /// Record attachment slots the profile may download. Requires `get`. + #[serde(default, skip_serializing_if = "UniqueSet::is_empty")] + readable_attachments: UniqueSet, #[serde(default)] writable_fields: UniqueSet, #[serde(default)] @@ -542,6 +545,7 @@ impl From for AccessProfileSource { require_access_reason: authored.require_access_reason, operations: authored.operations, readable_fields: authored.readable_fields, + readable_attachments: authored.readable_attachments, writable_fields: authored.writable_fields, filterable_fields: authored.filterable_fields, required_filters: authored.required_filters, @@ -575,6 +579,7 @@ impl From for AuthoredModuleProfile { require_access_reason: profile.require_access_reason, operations: profile.operations, readable_fields: profile.readable_fields, + readable_attachments: profile.readable_attachments, writable_fields: profile.writable_fields, filterable_fields: profile.filterable_fields, required_filters: profile.required_filters, @@ -671,6 +676,9 @@ pub(super) struct AuthoredEntityPermission { operations: UniqueSet, #[serde(default)] readable_fields: UniqueSet, + /// Record attachment slots the profile may download. Requires `get`. + #[serde(default, skip_serializing_if = "UniqueSet::is_empty")] + readable_attachments: UniqueSet, #[serde(default)] writable_fields: UniqueSet, #[serde(default)] @@ -736,6 +744,7 @@ impl TryFrom for EntityPermissionSource { entity: authored.entity, operations: authored.operations, readable_fields: authored.readable_fields, + readable_attachments: authored.readable_attachments, writable_fields: authored.writable_fields, filterable_fields: authored.filterable_fields, required_filters: authored.required_filters, diff --git a/crates/registry-breg/src/fixtures.rs b/crates/registry-breg/src/fixtures.rs index e542d6fafa..69227224e2 100644 --- a/crates/registry-breg/src/fixtures.rs +++ b/crates/registry-breg/src/fixtures.rs @@ -1880,6 +1880,7 @@ fn action_profile_from_grant( required_purposes: grant.required_purposes.clone().into(), operations: grant.operations.clone().into(), readable_fields: Default::default(), + readable_attachments: Default::default(), writable_fields: Default::default(), filterable_fields: Default::default(), required_filters: Vec::new(), diff --git a/crates/registry-breg/src/history_erasure.rs b/crates/registry-breg/src/history_erasure.rs index 4fd22a7673..14c8a39056 100644 --- a/crates/registry-breg/src/history_erasure.rs +++ b/crates/registry-breg/src/history_erasure.rs @@ -40,13 +40,14 @@ const MAX_REASON_BYTES: usize = 1024; pub(crate) const MAX_ERASURE_REVISIONS: i64 = 10_000; const AUDIT_OPERATION_ID: &str = "history-erasure-maintenance"; /// The audit schema of the per-record history erasure entry. -pub const HISTORY_ERASURE_AUDIT_SCHEMA: &str = "breg-history-erasure-audit/v3"; +pub const HISTORY_ERASURE_AUDIT_SCHEMA: &str = "breg-history-erasure-audit/v4"; #[derive(Clone, Eq, PartialEq)] pub struct RecordHistoryErasureTarget<'a> { entity_id: &'a str, record_id: Uuid, erase_through_revision: i64, + erase_files: Vec, } impl fmt::Debug for RecordHistoryErasureTarget<'_> { @@ -67,8 +68,39 @@ impl<'a> RecordHistoryErasureTarget<'a> { entity_id, record_id, erase_through_revision, + erase_files: Vec::new(), } } + + /// Select current file slots for explicit erasure. The caller supplies + /// the verified active package's registry, whose identity the maintenance + /// transaction checks before it writes anything. + /// + /// # Errors + /// Returns [`HistoryErasureError::InvalidInput`] for an undeclared or + /// repeated slot. An empty selection preserves every current file. + pub fn with_erase_files( + mut self, + registry: &crate::CompiledRegistry, + slots: &[String], + ) -> Result { + if !slots.is_empty() { + let entity = registry + .entities() + .get(self.entity_id) + .ok_or(HistoryErasureError::InvalidInput)?; + let unique: std::collections::BTreeSet<_> = slots.iter().collect(); + if unique.len() != slots.len() + || slots + .iter() + .any(|slot| !entity.attachments.contains_key(slot)) + { + return Err(HistoryErasureError::InvalidInput); + } + } + self.erase_files = slots.to_vec(); + Ok(self) + } } pub struct HistoryErasureRequest<'a> { @@ -96,6 +128,9 @@ pub struct HistoryErasureOutcome { pub scrubbed_proposal_target_count: u64, pub scrubbed_proposal_submission_count: u64, pub removed_descriptor_count: u64, + pub erased_file_reference_count: u64, + pub kept_file_reference_count: u64, + pub removed_proposal_link_count: u64, } #[derive(Clone, Copy, Debug, Eq, PartialEq, thiserror::Error)] @@ -228,14 +263,30 @@ async fn erase_record_history_scoped( let head = lock_history_head(&transaction).await?; let summary = target_revision_summary(&transaction, &request.target).await?; let affected_positions = affected_commit_positions(&transaction, &request.target).await?; - let coverage_update = coverage_update_for_erasure( - head.coverage_ready, - head.coverage_baseline_position, - head.unavailable_after_position, - summary.has_unindexed_revisions, - affected_positions.first().copied(), - lifecycle_reference.is_some(), - )?; + let coverage_update = if summary.revision_count == 0 { + if lifecycle_reference.is_some() + || request.target.erase_files.is_empty() + || !head.coverage_ready + { + return Err(HistoryErasureError::TargetUnavailable); + } + // A named current file can outlive all of its history. Erasing it + // does not move the snapshot boundary. The write below must actually + // erase a live selected slot before this transaction may commit. + CoverageUpdate { + coverage_ready: head.coverage_ready, + unavailable_after_position: head.unavailable_after_position, + } + } else { + coverage_update_for_erasure( + head.coverage_ready, + head.coverage_baseline_position, + head.unavailable_after_position, + summary.has_unindexed_revisions, + affected_positions.first().copied(), + lifecycle_reference.is_some(), + )? + }; let scrubbed_cached_response_count = tombstone_erased_cached_responses( &transaction, @@ -264,6 +315,27 @@ async fn erase_record_history_scoped( let scrubbed_change_context_count = scrub_change_contexts(&transaction, &affected_positions).await?; let erased_commit_member_count = delete_commit_members(&transaction, &request.target).await?; + // Files are current Record state. Ordinary history erasure clears the + // attribution carried by erased revisions and erases only named slots. + // Field-encryption erase-and-rebaseline keeps files and their attribution. + let files = crate::attachment_store::erase_record_attachments( + &transaction, + request.target.entity_id, + request.target.record_id, + lifecycle_reference + .is_none() + .then_some(request.target.erase_through_revision), + &request.target.erase_files, + ) + .await + .map_err(|_| HistoryErasureError::Unavailable)?; + if summary.revision_count == 0 && files.erased == 0 { + return Err(HistoryErasureError::TargetUnavailable); + } + // An applied Proposal keeps its receipt, and its link to a revision this + // erasure removes goes with that revision. + let removed_proposal_link_count = + delete_proposal_result_links(&transaction, &request.target).await?; let erased_revision_count = delete_revisions(&transaction, &request.target).await?; let removed_descriptor_count = delete_unreferenced_history_descriptors(&transaction, request.expected).await?; @@ -283,6 +355,9 @@ async fn erase_record_history_scoped( scrubbed_proposal_target_count, scrubbed_proposal_submission_count, removed_descriptor_count, + erased_file_reference_count: files.erased, + kept_file_reference_count: files.kept, + removed_proposal_link_count, }; let entry = history_erasure_entry(&request, &outcome, lifecycle_reference)?; match lifecycle_reference { @@ -362,9 +437,6 @@ async fn target_revision_summary( revision_count: row.get(0), has_unindexed_revisions: row.get(1), }; - if summary.revision_count == 0 { - return Err(HistoryErasureError::TargetUnavailable); - } if summary.revision_count > MAX_ERASURE_REVISIONS { return Err(HistoryErasureError::InvalidInput); } @@ -436,6 +508,26 @@ async fn delete_commit_members( .map_err(|_| HistoryErasureError::Unavailable) } +async fn delete_proposal_result_links( + transaction: &tokio_postgres::Transaction<'_>, + target: &RecordHistoryErasureTarget<'_>, +) -> Result { + transaction + .execute( + "DELETE FROM registry_internal.registry_proposal_results + WHERE target_entity_id = $1 + AND target_record_id = $2 + AND target_revision <= $3", + &[ + &target.entity_id, + &target.record_id, + &target.erase_through_revision, + ], + ) + .await + .map_err(|_| HistoryErasureError::Unavailable) +} + async fn delete_revisions( transaction: &tokio_postgres::Transaction<'_>, target: &RecordHistoryErasureTarget<'_>, @@ -683,6 +775,7 @@ fn history_erasure_request_entry( "operatorReference": references.operator, "targetReference": references.target, "reasonReference": references.reason, + "eraseFileCount": request.target.erase_files.len(), }), )) } @@ -719,6 +812,9 @@ fn history_erasure_entry( "scrubbedProposalTargetCount": outcome.scrubbed_proposal_target_count, "scrubbedProposalSubmissionCount": outcome.scrubbed_proposal_submission_count, "removedDescriptorCount": outcome.removed_descriptor_count, + "erasedFileReferenceCount": outcome.erased_file_reference_count, + "keptFileReferenceCount": outcome.kept_file_reference_count, + "removedProposalLinkCount": outcome.removed_proposal_link_count, "operatorResponsibility": "saved_exports_event_consumers_and_backups", "stubPolicy": "commit_position_and_minimized_origin_retained_context_removed", }); diff --git a/crates/registry-breg/src/history_schema.rs b/crates/registry-breg/src/history_schema.rs index d59e8cd84d..e9454ca13b 100644 --- a/crates/registry-breg/src/history_schema.rs +++ b/crates/registry-breg/src/history_schema.rs @@ -836,6 +836,7 @@ mod tests { definition_revision: "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa".to_owned(), relationships: Default::default(), + attachments: Default::default(), primary_dataset: None, id: "membership".to_owned(), source_module: None, diff --git a/crates/registry-breg/src/immediate_actions.rs b/crates/registry-breg/src/immediate_actions.rs index 0d0f030d61..fa628b7e3b 100644 --- a/crates/registry-breg/src/immediate_actions.rs +++ b/crates/registry-breg/src/immediate_actions.rs @@ -15,8 +15,8 @@ use crate::diagnostics::Diagnostic; use crate::logical_names::{default_api_name, reserved_logical_name, valid_api_name}; mod commit_evidence; use crate::model::{ - ActionRouteKind, CompiledAction, CompiledActionAccessEntry, CompiledActionInput, - CompiledActionInventory, CompiledActionPermission, CompiledActionRoute, + ActionRouteKind, CompiledAction, CompiledActionAccessEntry, CompiledActionAttachment, + CompiledActionInput, CompiledActionInventory, CompiledActionPermission, CompiledActionRoute, CompiledActionTargetPermission, CompiledActionTargetUse, CompiledActionTargetUseSource, CompiledCommitGuard, CompiledEntity, CompiledPlanEffect, CompiledPlanMutation, CompiledPlanTarget, CompiledPlanTargetBinding, CompiledPlanValue, CompiledProposalPermission, @@ -321,6 +321,7 @@ fn compile_action( } } let requires = compile_requirements(action, &input_map, entities, &target_uses, errors); + let attachments = compile_action_attachments(action, &inputs, entities, timer_actions, errors); let writes_path = if handler.is_some() { "actions[].plan.writes" } else { @@ -352,7 +353,7 @@ fn compile_action( let condition_route = (!action.is_proposal() && target_uses.iter().any(|use_| use_.condition_required)) .then(|| format!("/v1/actions/{}/target-conditions", action.id)); - let execution = compile_execution( + let mut execution = compile_execution( action, entities, profiles, @@ -360,6 +361,15 @@ fn compile_action( &target_uses, errors, ); + if let crate::model::CompiledActionExecution::Proposal { proposal } = &mut execution { + proposal.promotions = compile_attachment_promotions( + action, + &effects, + &proposal.attachments, + entities, + errors, + ); + } let compiled = CompiledAction { api_name: action .api_name @@ -386,6 +396,7 @@ fn compile_action( handler, inputs, effects, + attachments, requires, target_uses, permissions, @@ -561,6 +572,7 @@ fn compile_handler( operation: slot.operation, set: BTreeMap::new(), clear: Default::default(), + attachments: BTreeMap::new(), }; let diagnostics_start = errors.len(); let target = compile_target( @@ -1356,6 +1368,210 @@ fn compile_inputs( inputs } +/// Binds each file an Action request carries to the record slot one create +/// effect fills. Only an immediate fixed-plan Action without Evidence or a +/// timer can carry files: every other immediate path has no request to take +/// them from, or commits outside the request's own transaction. A Proposal +/// Action carries no request files. Its effects promote Proposal files +/// instead, and `compile_attachment_promotions` checks them. +fn compile_action_attachments( + action: &ActionSource, + inputs: &[CompiledActionInput], + entities: &BTreeMap, + timer_actions: &BTreeSet, + errors: &mut Vec, +) -> BTreeMap { + let mut compiled = BTreeMap::new(); + let declared = action + .effects() + .iter() + .any(|effect| !effect.attachments.is_empty()); + if !declared || action.is_proposal() { + return compiled; + } + let base = format!("actions[id={}].plan.effects", action.id); + if !action.evidence.is_empty() + || !action.commit_guards.evidence.is_empty() + || timer_actions.contains(&action.id) + { + errors.push(Diagnostic::error( + "breg.action.attachment-invalid", + &base, + "only an immediate Action without Evidence or a timer can attach request files to records", + )); + } + let input_names = inputs + .iter() + .flat_map(|input| [input.id.clone(), input.api_name.clone()]) + .collect::>(); + for (index, effect) in action.effects().iter().enumerate() { + if effect.attachments.is_empty() { + continue; + } + let effect_id = effective_action_effect_id(effect, index); + let path = format!("{base}[id={effect_id}].attachments"); + let entity = match (&effect.operation, &effect.target.entity) { + (Operation::Create, Some(entity_id)) => entities.get(entity_id), + _ => None, + }; + let Some(entity) = entity else { + errors.push(Diagnostic::error( + "breg.action.attachment-invalid", + &path, + "only a create effect on a declared record type can attach files", + )); + continue; + }; + for (slot_id, source) in &effect.attachments { + let slot_path = format!("{path}[slot={slot_id}]"); + let Some(slot) = entity.attachments.get(slot_id) else { + errors.push(Diagnostic::error( + "breg.action.attachment-invalid", + &slot_path, + "an effect attachment must name a slot the target record type declares", + )); + continue; + }; + let name = &source.from_attachment; + if input_names.contains(name) { + errors.push(Diagnostic::error( + "breg.action.attachment-invalid", + format!("{slot_path}.fromAttachment"), + "an Action attachment name must not collide with an Action input", + )); + continue; + } + let attachment = CompiledActionAttachment { + effect_id: effect_id.clone(), + entity_id: entity.id.clone(), + slot_id: slot.id.clone(), + maximum_bytes: slot.maximum_bytes, + content_types: slot.content_types.clone(), + }; + if compiled.insert(name.clone(), attachment).is_some() { + errors.push(Diagnostic::error( + "breg.action.attachment-invalid", + format!("{slot_path}.fromAttachment"), + "each Action attachment fills exactly one record slot", + )); + } + } + } + if compiled.len() > crate::contract::MAX_ATTACHMENT_SLOTS { + errors.push(Diagnostic::error( + "breg.action.attachment-invalid", + &base, + "an Action request carries at most eight attachments", + )); + } + compiled +} + +/// Binds each Proposal file an effect promotes to the record slot it fills. +/// The record slot must hold every file the Proposal slot can hold, so a +/// promotion never narrows what the Proposal accepted. One record slot of one +/// record takes at most one promotion. +fn compile_attachment_promotions( + action: &ActionSource, + effects: &[CompiledPlanEffect], + proposal_slots: &BTreeMap, + entities: &BTreeMap, + errors: &mut Vec, +) -> Vec { + let mut promotions = Vec::new(); + let mut filled = BTreeSet::new(); + let base = format!("actions[id={}].plan.effects", action.id); + for (index, effect) in action.effects().iter().enumerate() { + if effect.attachments.is_empty() { + continue; + } + let effect_id = effective_action_effect_id(effect, index); + let path = format!("{base}[id={effect_id}].attachments"); + let compiled = effects.iter().find(|compiled| compiled.id == effect_id); + let entity = compiled + .filter(|compiled| matches!(compiled.operation, Operation::Create | Operation::Patch)) + .and_then(|compiled| entities.get(&compiled.target.entity_id)); + let (Some(compiled), Some(entity)) = (compiled, entity) else { + errors.push(Diagnostic::error( + "breg.action.attachment-invalid", + &path, + "only a create or patch effect on a declared record type can promote a Proposal file", + )); + continue; + }; + let target = write_target_binding_key(&compiled.target, &effect_id); + for (slot_id, source) in &effect.attachments { + let slot_path = format!("{path}[slot={slot_id}]"); + let from_path = format!("{slot_path}.fromAttachment"); + let Some(slot) = entity.attachments.get(slot_id) else { + errors.push(Diagnostic::error( + "breg.action.attachment-invalid", + &slot_path, + "an effect attachment must name a slot the target record type declares", + )); + continue; + }; + let Some(from) = proposal_slots.get(&source.from_attachment) else { + errors.push(Diagnostic::error( + "breg.action.attachment-invalid", + &from_path, + "a promotion must name a Proposal attachment slot the Action declares", + )); + continue; + }; + if let Some(content_type) = from + .content_types + .iter() + .find(|content_type| !slot.content_types.contains(content_type)) + { + errors.push(Diagnostic::error( + "breg.action.attachment-invalid", + &from_path, + &format!( + "the record slot does not accept the content type {content_type} that the Proposal slot accepts" + ), + )); + continue; + } + if from.maximum_bytes > slot.maximum_bytes { + errors.push(Diagnostic::error( + "breg.action.attachment-invalid", + &from_path, + "the Proposal slot accepts files larger than the record slot holds", + )); + continue; + } + // Classifications are ordered, so a promoted file's label never + // drops. Who reads it is decided by the record grants. + if slot.classification < from.classification { + errors.push(Diagnostic::error( + "breg.action.attachment-invalid", + &from_path, + "the record slot is less restricted than the Proposal slot it takes the file from", + )); + continue; + } + if !filled.insert((target.clone(), slot.id.clone())) { + errors.push(Diagnostic::error( + "breg.action.attachment-invalid", + &slot_path, + "an Action cannot promote into one record slot of one record more than once", + )); + continue; + } + promotions.push(crate::model::CompiledAttachmentPromotion { + effect_id: effect_id.clone(), + entity_id: entity.id.clone(), + slot_id: slot.id.clone(), + from_attachment: from.id.clone(), + maximum_bytes: slot.maximum_bytes, + content_types: slot.content_types.clone(), + }); + } + } + promotions +} + fn compile_effects( action: &ActionSource, inputs: &BTreeMap<&str, &CompiledActionInput>, @@ -2299,6 +2515,7 @@ fn validate_permission_access_requirements( require_access_reason: profile.require_access_reason, operations: [Operation::Invoke].into(), readable_fields: Default::default(), + readable_attachments: Default::default(), writable_fields: Default::default(), filterable_fields: Default::default(), required_filters: Vec::new(), @@ -3093,6 +3310,7 @@ fn compile_execution( }, review_context: proposal.review_context.clone(), attachments, + promotions: Vec::new(), permissions, }, } @@ -3395,7 +3613,14 @@ pub(crate) fn definition_revision( let policy = match &action.execution { crate::model::CompiledActionExecution::Immediate => json!({"mode":"immediate"}), crate::model::CompiledActionExecution::Proposal { proposal } => { - json!({"mode":"proposal","review":proposal.review,"application":proposal.application,"retention":proposal.retention,"reviewContext":proposal.review_context,"attachments":proposal.attachments}) + let mut policy = json!({"mode":"proposal","review":proposal.review,"application":proposal.application,"retention":proposal.retention,"reviewContext":proposal.review_context,"attachments":proposal.attachments}); + // Promotions change what an approved Proposal writes, so they are + // part of the Action's identity. Omitting an empty list keeps the + // revision of every Action without promotions unchanged. + if !proposal.promotions.is_empty() { + policy["promotions"] = json!(proposal.promotions); + } + policy } }; let inputs = action @@ -3413,7 +3638,13 @@ pub(crate) fn definition_revision( value["refusals"] = json!(function.refusals.keys().collect::>()); value }); - let payload = json!({"id":action.id,"apiName":action.api_name,"inputs":inputs,"plan":{"effects":action.effects,"function":function},"commitGuards":{"targets":action.requires,"evidence":action.commit_evidence},"planEvidence":action.evidence,"targets":targets,"execution":policy,"consentIssuer":action.consent_issuer}); + let mut payload = json!({"id":action.id,"apiName":action.api_name,"inputs":inputs,"plan":{"effects":action.effects,"function":function},"commitGuards":{"targets":action.requires,"evidence":action.commit_evidence},"planEvidence":action.evidence,"targets":targets,"execution":policy,"consentIssuer":action.consent_issuer}); + // Request-file bindings decide which request part fills which record + // slot, so they are part of the Action's identity. Omitting an empty map + // keeps the revision of every Action without request files unchanged. + if !action.attachments.is_empty() { + payload["attachments"] = json!(action.attachments); + } format!( "sha256:{}", hex_lower(&Sha256::digest( diff --git a/crates/registry-breg/src/migration.rs b/crates/registry-breg/src/migration.rs index 5f39c8958e..179af937dc 100644 --- a/crates/registry-breg/src/migration.rs +++ b/crates/registry-breg/src/migration.rs @@ -239,10 +239,9 @@ pub enum MigrationError { pub type Result = std::result::Result; -/// Whether a package applied as a successor has nothing to apply: its plan has -/// no schema statement and no reviewed migration, and it is not an access or -/// disclosure change or a changed compiled presentation alone. This reads only -/// the package, so a caller can refuse it before opening the database. +/// A successor is empty when its plan has no schema statements, reviewed +/// migration, verified metadata changes, or timer-store installation. This +/// reads only the package, so a caller can refuse it before opening the database. pub fn successor_plan_is_empty(package: &VerifiedPackage) -> bool { let plan = &package.manifest().migration_plan; plan.statements.is_empty() @@ -265,10 +264,11 @@ fn verified_metadata_only_plan(package: &VerifiedPackage) -> bool { && prior.registry_revision != file.sha256 }) })) - && plan - .changes - .iter() - .all(|change| change.class == CompiledRegistryChangeClass::AccessOrDisclosureChange) + && plan.changes.iter().all(|change| { + change.class == CompiledRegistryChangeClass::AccessOrDisclosureChange + || (change.class == CompiledRegistryChangeClass::CompatibleAdditive + && change.code == CompiledRegistryChangeCode::RecordAttachmentSlotAdded) + }) } fn installs_record_timer_store(package: &VerifiedPackage) -> bool { diff --git a/crates/registry-breg/src/model.rs b/crates/registry-breg/src/model.rs index 22e9f31060..fa4dfc4c68 100644 --- a/crates/registry-breg/src/model.rs +++ b/crates/registry-breg/src/model.rs @@ -105,6 +105,45 @@ pub struct CompiledAttachmentSlot { pub classification: Classification, } +/// A record type's write-once file slot. The first file written to it is +/// the only file it ever holds. +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[serde(deny_unknown_fields, rename_all = "camelCase")] +pub struct CompiledRecordAttachmentSlot { + pub id: String, + pub maximum_bytes: u32, + pub content_types: Vec, + pub classification: Classification, +} + +/// One file an immediate Action request carries, and the record slot its +/// create effect writes it into. +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[serde(deny_unknown_fields, rename_all = "camelCase")] +pub struct CompiledActionAttachment { + pub effect_id: String, + #[serde(rename = "recordType")] + pub entity_id: String, + pub slot_id: String, + pub maximum_bytes: u32, + pub content_types: Vec, +} + +/// One Proposal file that an applied effect references from a record slot. +/// The bounds are the record slot's. Apply checks the frozen file against +/// them again. +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[serde(deny_unknown_fields, rename_all = "camelCase")] +pub struct CompiledAttachmentPromotion { + pub effect_id: String, + #[serde(rename = "recordType")] + pub entity_id: String, + pub slot_id: String, + pub from_attachment: String, + pub maximum_bytes: u32, + pub content_types: Vec, +} + #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(deny_unknown_fields, rename_all = "camelCase")] pub struct CompiledLogicalField { @@ -431,6 +470,9 @@ pub struct CompiledAction { pub condition_route: Option, pub inputs: Vec, pub effects: Vec, + /// Files the request carries, keyed by their name in the request. + #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] + pub attachments: BTreeMap, #[serde(default, skip_serializing_if = "Vec::is_empty")] pub requires: Vec, pub target_uses: Vec, @@ -476,6 +518,10 @@ pub struct CompiledProposalPolicy { pub retention: CompiledProposalRetentionMode, pub review_context: Option, pub attachments: BTreeMap, + /// Proposal files that applied effects reference from record slots, in + /// effect order. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub promotions: Vec, pub permissions: Vec, #[serde(default, skip_serializing_if = "Option::is_none")] pub system_apply_grant: Option, @@ -1030,6 +1076,9 @@ pub struct CompiledEntity { pub derived_relations: BTreeMap, pub source_relation: CompiledSourceRelation, pub selector_profiles: BTreeMap, + /// Write-once file slots keyed by slot id. + #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] + pub attachments: BTreeMap, /// Root-enabled autonomous timers keyed by their stable identifier. #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] pub timers: BTreeMap, diff --git a/crates/registry-breg/src/mutation.rs b/crates/registry-breg/src/mutation.rs index f8f9ee2aab..cae653bef2 100644 --- a/crates/registry-breg/src/mutation.rs +++ b/crates/registry-breg/src/mutation.rs @@ -5,6 +5,7 @@ mod action; #[cfg(all(feature = "runtime", feature = "tooling"))] pub(crate) use action::erase_expired_action_evidence; +pub(crate) use action::validate_action_attachments; pub(crate) use action::{HookChangeApplication, HookChangeOutcome}; mod proposal; pub(crate) use proposal::{ @@ -2425,6 +2426,19 @@ pub enum MutationError { /// The review authority rejected the Proposal, and a rejection is terminal. #[error("the review rejected this Proposal")] ProposalRejected, + /// A record attachment slot already holds a file. Record slots are + /// write-once, so a second write is refused whatever its bytes are. + #[error("the record attachment slot already holds a file")] + AttachmentSlotWriteOnce, + /// A file is larger than its attachment slot's `maximumBytes`. + #[error("the file is larger than the attachment slot accepts")] + AttachmentTooLarge, + /// A file's declared media type is not in its slot's `contentTypes`. + #[error("the file media type is not one the attachment slot accepts")] + AttachmentContentType, + /// A file's bytes do not hash to the SHA-256 digest the request declared. + #[error("the file content does not match its declared digest")] + AttachmentDigestMismatch, #[error("idempotency key is already bound to another request")] IdempotencyConflict, /// The exact request already committed under this key and its held diff --git a/crates/registry-breg/src/mutation/action.rs b/crates/registry-breg/src/mutation/action.rs index 4438f0bf25..d105ffb49c 100644 --- a/crates/registry-breg/src/mutation/action.rs +++ b/crates/registry-breg/src/mutation/action.rs @@ -15,7 +15,9 @@ use crate::action_handler::{ use crate::action_outcome::{ bound_document, decode_document, json_document, validate_proposed_outcome, }; -use crate::api::{ActionTargetConditionsInput, HeldReadResponse, ImmediateActionInput}; +use crate::api::{ + ActionRequestAttachment, ActionTargetConditionsInput, HeldReadResponse, ImmediateActionInput, +}; type ActionInputs = Map; @@ -186,7 +188,8 @@ impl MutationTransaction { } }; let request_digest = - match canonical_action_request_digest(action, &normalized_input, &BTreeMap::new()) { + match canonical_action_request_digest(action, &normalized_input, &BTreeMap::new(), &[]) + { Ok(digest) => digest, Err(error) => { self.record_action_boundary_audit( @@ -266,6 +269,7 @@ impl MutationTransaction { None, None, Some(authority), + &[], ) .await; let definite_refusal = failure_is_refusal(&result) && !fault.is_enabled(); @@ -570,11 +574,17 @@ impl MutationTransaction { let normalized_input = validate_action_input_with_constraints(&***client, action, input.input).await?; validate_precondition_set(action, &input.preconditions)?; + let attachments = input.attachments; + validate_action_attachments(action, &attachments)?; let _attempt = self .begin_action_boundary_audit(claims, input.route_id, input.correlation) .await?; - let request_digest = - canonical_action_request_digest(action, &normalized_input, &input.preconditions)?; + let request_digest = canonical_action_request_digest( + action, + &normalized_input, + &input.preconditions, + &attachments, + )?; let binding = resolve_action_binding( self.audit.profile(), &self.idempotency, @@ -592,6 +602,8 @@ impl MutationTransaction { }, )?; let reserved_creates = reserve_action_create_ids(action)?; + self.stage_action_attachments(client, claims, &attachments, deadline) + .await?; let mut candidate = None; let trusted_now = time::OffsetDateTime::now_utc(); let application_id = Uuid::new_v4(); @@ -619,6 +631,7 @@ impl MutationTransaction { None, None, None, + &attachments, ) .await; if matches!(attempt, Err(MutationError::RetryableConflict)) @@ -649,6 +662,131 @@ impl MutationTransaction { }) } + /// Stage each external file in its own committed transaction before any + /// object write, as a Proposal upload does. A request that later refuses + /// leaves a staged row the retention sweep removes. The database backend + /// stores bytes in the record's own transaction and stages nothing. + async fn stage_action_attachments( + &self, + client: &mut Client, + claims: &ActionClaimContext, + attachments: &[ActionRequestAttachment], + deadline: tokio::time::Instant, + ) -> Result<(), MutationError> { + if attachments.is_empty() + || !matches!( + self.attachment_storage, + crate::attachment_storage::AttachmentStorage::S3(_) + ) + { + return Ok(()); + } + let guarded = begin_action_transaction( + client, + self.lock_key, + self.lock_timeout, + &self.expected, + claims, + ) + .await + .map_err(|_| MutationError::Unavailable)?; + guarded + .set_statement_budget(deadline.saturating_duration_since(tokio::time::Instant::now())) + .await + .map_err(|_| MutationError::Unavailable)?; + for attachment in attachments_in_lock_order(attachments) { + crate::attachment_store::stage_external( + guarded.transaction(), + &attachment.sha256, + attachment.content.len() as u64, + &self.attachment_storage.binding_digest(), + &self.attachment_verification.binding_digest(), + ) + .await?; + } + guarded + .commit() + .await + .map_err(|_| MutationError::Unavailable) + } + + /// Fill each record slot the Action declares from its file, in the + /// transaction that writes the created record, its history, the receipt + /// and the outbox. Every file commits with the record or none does. + async fn write_action_attachments( + &self, + transaction: &Transaction<'_>, + action: &CompiledAction, + claims: &ActionClaimContext, + binding: &crate::idempotency::ResolvedIdempotencyBinding, + results: &[ActionEffectResult], + attachments: &[ActionRequestAttachment], + ) -> Result<(), MutationError> { + // A request's files were checked against the declared names, and only + // a request can carry them. Any other path that reaches an Action + // declaring files would commit the record without them. + if attachments.len() != action.attachments.len() { + return Err(MutationError::Unavailable); + } + if attachments.is_empty() { + return Ok(()); + } + let backend = self.attachment_storage.binding_digest(); + let verification = self.attachment_verification.binding_digest(); + for attachment in attachments_in_lock_order(attachments) { + let declared = action + .attachments + .get(&attachment.name) + .ok_or(MutationError::InvalidRequest)?; + // Compilation binds every attachment to one create effect of a + // fixed plan, so a missing result is a runtime fault. + let record = results + .iter() + .find(|result| { + result.effect_id == declared.effect_id + && result.entity_id == declared.entity_id + && result.operation == Operation::Create + }) + .ok_or(MutationError::Unavailable)?; + let byte_size = attachment.content.len() as u64; + if let crate::attachment_storage::AttachmentStorage::S3(store) = + &self.attachment_storage + { + crate::attachment_store::lock_hash(transaction, &attachment.sha256).await?; + crate::attachment_store::require_backend( + transaction, + &attachment.sha256, + &backend, + byte_size, + ) + .await?; + check_current_action_grant(claims)?; + store + .put(&attachment.sha256, attachment.content.clone()) + .await + .map_err(|_| MutationError::Unavailable)?; + } + crate::attachment_store::put_record_attachment( + transaction, + &crate::attachment_store::RecordAttachmentReference { + entity_id: &declared.entity_id, + record_id: record.record_uuid, + slot_id: &declared.slot_id, + sha256: &attachment.sha256, + content_type: &attachment.content_type, + byte_size, + attached_revision: record.record_revision, + attached_by: &binding.principal_reference, + }, + &attachment.content, + &backend, + &verification, + ) + .await?; + } + Ok(()) + } + /// Apply one settled hook proposal through the immediate-action path. /// /// The proposal runs the same validation, authorization, and mutation @@ -1121,7 +1259,7 @@ impl MutationTransaction { }; let Ok(request_digest) = - canonical_action_request_digest(action, &normalized_input, &preconditions) + canonical_action_request_digest(action, &normalized_input, &preconditions, &[]) else { return refused_proposal( "hook.proposal.input_refused", @@ -1203,6 +1341,7 @@ impl MutationTransaction { None, Some(&causation), None, + &[], ) .await; if matches!(attempt, Err(MutationError::RetryableConflict)) @@ -1401,6 +1540,7 @@ impl MutationTransaction { commit_requests: Option<&[(CompiledEvidenceCapability, EvidenceSubjects)]>, causation: Option<&Causation>, timer_authority: Option<&TimerActionAuthority>, + attachments: &[ActionRequestAttachment], ) -> Result { if tokio::time::Instant::now() >= deadline { return Err(MutationError::Unavailable); @@ -1903,6 +2043,15 @@ impl MutationTransaction { }, ) .await?; + self.write_action_attachments( + transaction.transaction(), + action, + claims, + binding, + &results, + attachments, + ) + .await?; let held = action_held_response(action, claims, application_id, &results)?; let public_result_count = u16::try_from( @@ -3664,17 +3813,96 @@ fn canonical_action_request_digest( action: &CompiledAction, input_values: &ActionInputs, preconditions: &BTreeMap, + attachments: &[ActionRequestAttachment], ) -> Result<[u8; 32], MutationError> { - let canonical = canonicalize_json(&json!({ + let mut request = json!({ "action": action.id, "route": action.route, "input": input_values, "preconditions": preconditions, - })) - .map_err(|_| MutationError::InvalidRequest)?; + }); + // A request without files keeps its digest, so receipts stored before + // record attachment slots existed still replay. A file binds by its + // digest, media type and size, never by its bytes. + if !attachments.is_empty() { + request["attachments"] = attachments + .iter() + .map(|attachment| { + ( + attachment.name.clone(), + json!({ + "contentType": attachment.content_type, + "sha256": attachment.sha256, + "byteSize": attachment.content.len(), + }), + ) + }) + .collect::>() + .into(); + } + let canonical = canonicalize_json(&request).map_err(|_| MutationError::InvalidRequest)?; Ok(Sha256::digest(canonical).into()) } +/// Content-hash lock order, so two requests sharing files cannot deadlock. +fn attachments_in_lock_order( + attachments: &[ActionRequestAttachment], +) -> Vec<&ActionRequestAttachment> { + let mut ordered = attachments.iter().collect::>(); + ordered.sort_by(|left, right| { + left.sha256 + .cmp(&right.sha256) + .then_with(|| left.name.cmp(&right.name)) + }); + ordered +} + +/// Checks the files of one immediate Action request against the record slots +/// the Action fills: exactly the declared names, each within its slot's media +/// types and size, and each matching its declared sha256. +/// +/// # Errors +/// +/// [`MutationError::InvalidRequest`] for a missing, unknown or empty file, +/// [`MutationError::AttachmentContentType`], [`MutationError::AttachmentTooLarge`] +/// and [`MutationError::AttachmentDigestMismatch`] for a file its slot refuses. +pub(crate) fn validate_action_attachments( + action: &CompiledAction, + attachments: &[ActionRequestAttachment], +) -> Result<(), MutationError> { + let names = attachments + .iter() + .map(|attachment| attachment.name.as_str()) + .collect::>(); + if names.len() != attachments.len() + || !names + .iter() + .copied() + .eq(action.attachments.keys().map(String::as_str)) + { + return Err(MutationError::InvalidRequest); + } + for attachment in attachments { + let declared = action + .attachments + .get(&attachment.name) + .ok_or(MutationError::InvalidRequest)?; + if attachment.content.is_empty() { + return Err(MutationError::InvalidRequest); + } + if !declared.content_types.contains(&attachment.content_type) { + return Err(MutationError::AttachmentContentType); + } + if attachment.content.len() > declared.maximum_bytes as usize { + return Err(MutationError::AttachmentTooLarge); + } + if crate::attachment_store::content_hash(&attachment.content) != attachment.sha256 { + return Err(MutationError::AttachmentDigestMismatch); + } + } + Ok(()) +} + // Admission state is created once, before protected external processing. It // retains all identity and request bindings across confirmed SQL aborts. pub(crate) struct PreparedEvidenceAction { @@ -3839,6 +4067,10 @@ impl MutationTransaction { let normalized = validate_action_input_with_constraints(&***client, action, input.input).await?; validate_precondition_set(action, &input.preconditions)?; + // Compilation refuses record attachment slots on Evidence Actions. + if !input.attachments.is_empty() { + return Err(MutationError::InvalidRequest); + } *attempt = Some( self.begin_action_boundary_audit(claims, input.route_id, input.correlation) .await?, @@ -3860,6 +4092,7 @@ impl MutationTransaction { action, &normalized, &input.preconditions, + &[], )?, }, )?; @@ -4016,6 +4249,7 @@ impl MutationTransaction { Some(&prepared.commit_requests), None, None, + &[], ) .await; if matches!(result, Err(MutationError::RetryableConflict)) diff --git a/crates/registry-breg/src/mutation/proposal.rs b/crates/registry-breg/src/mutation/proposal.rs index fa8b0f2993..721039b79c 100644 --- a/crates/registry-breg/src/mutation/proposal.rs +++ b/crates/registry-breg/src/mutation/proposal.rs @@ -87,6 +87,17 @@ fn check_current_proposal_grant(authority: &ProposalAuthority) -> Result<(), Mut Ok(()) } +/// The answer to a target context the database refused to install. A context +/// `install_target` rejects means the caller may not read that target. A +/// store failure means nobody knows yet, so it answers 503 instead of being +/// taken for a refusal that would silently omit what the caller may read. +fn target_install_error(error: crate::postgres::PostgresKernelError) -> MutationError { + match error { + crate::postgres::PostgresKernelError::Configuration(_) => MutationError::PreconditionFailed, + _ => MutationError::Unavailable, + } +} + fn validate_attachment_authority( action: &CompiledAction, authority: &ProposalAuthority, @@ -796,7 +807,7 @@ impl MutationTransaction { digest, ) .await - .map_err(|_| MutationError::PreconditionFailed)?; + .map_err(target_install_error)?; let lock = !matches!( authority.operation, ProposalAuthorityOperation::Lifecycle( @@ -862,8 +873,13 @@ impl MutationTransaction { } } if document.header.state == "applied" { - let rows=tx.query("SELECT target_entity_id,target_record_id FROM registry_internal.registry_proposal_results - WHERE action_id=$1 AND proposal_id=$2 AND submission_version=$3 ORDER BY target_entity_id,target_record_id", + // Every record the application wrote bounds the read. History + // erasure removes the result link to a revision it erases, so the + // frozen targets name the records whose link is gone. + let rows=tx.query("SELECT target_entity_id,target_record_id FROM registry_internal.registry_proposal_targets + WHERE action_id=$1 AND proposal_id=$2 AND submission_version=$3 + UNION SELECT target_entity_id,target_record_id FROM registry_internal.registry_proposal_results + WHERE action_id=$1 AND proposal_id=$2 AND submission_version=$3 ORDER BY 1,2", &[&document.action_id,&document.proposal_id,&document.header.submission_version]) .await.map_err(map_database_error)?; for row in rows { @@ -889,7 +905,7 @@ impl MutationTransaction { None, ) .await - .map_err(|_| MutationError::PreconditionFailed)?; + .map_err(target_install_error)?; let current = load_proposal_row(tx, entity, id, false).await?; if !authority .authorizes_snapshot(entity, id, ¤t.data) @@ -2502,6 +2518,8 @@ impl MutationTransaction { let mut links = Vec::new(); let mut rows = Vec::new(); let mut timer_rows = Vec::new(); + // Effect id to the record revision it wrote, for promotions. + let mut applied = BTreeMap::::new(); let mut groups = Vec::>::new(); let mut positions = BTreeMap::<(String, Uuid), usize>::new(); for effect in frozen.effects() { @@ -2724,8 +2742,20 @@ impl MutationTransaction { current.record_uuid, current.record_revision, )); + for effect in &group { + applied.insert( + effect.id().as_str().to_owned(), + ( + entity.id.clone(), + current.record_uuid, + current.record_revision, + ), + ); + } timer_rows.push((entity, current)); } + self.promote_proposal_attachments(tx, action, document, frozen, binding, &applied) + .await?; stage_record_timer_rows( tx, timer_staging, @@ -2769,6 +2799,89 @@ impl MutationTransaction { Ok((observed, links)) } + /// Fill the record slots the Action's effects promote into. Each slot + /// references the bytes the frozen Proposal file already holds in the + /// store, so nothing is copied. The reference commits with the record + /// revision its effect wrote, or the apply fails. An empty optional + /// Proposal slot leaves its record slot empty. + async fn promote_proposal_attachments( + &self, + tx: &Transaction<'_>, + action: &CompiledAction, + document: &ProposalDocument, + frozen: &crate::proposal_workflow::ProposalSnapshot, + binding: &crate::idempotency::ResolvedIdempotencyBinding, + applied: &BTreeMap, + ) -> Result<(), MutationError> { + let CompiledActionExecution::Proposal { proposal } = &action.execution else { + return Err(MutationError::PreconditionFailed); + }; + if proposal.promotions.is_empty() { + return Ok(()); + } + let backend = self.attachment_storage.binding_digest(); + let verification = self.attachment_verification.binding_digest(); + // Content-hash lock order, as the immediate path uses, so two applies + // sharing files cannot deadlock. An empty optional Proposal slot has + // no file and promotes nothing. + let mut promotions = proposal + .promotions + .iter() + .filter_map(|promotion| { + frozen + .attachments() + .get(&promotion.from_attachment) + .map(|file| (promotion, file)) + }) + .collect::>(); + promotions.sort_by(|(left, left_file), (right, right_file)| { + left_file + .sha256 + .cmp(&right_file.sha256) + .then_with(|| left.effect_id.cmp(&right.effect_id)) + .then_with(|| left.slot_id.cmp(&right.slot_id)) + }); + for (promotion, file) in promotions { + let (entity_id, record_id, revision) = applied + .get(&promotion.effect_id) + .ok_or(MutationError::PreconditionFailed)?; + // The compiler checked these bounds against the Proposal slot. + // The frozen file is checked again so a changed slot fails closed. + if *entity_id != promotion.entity_id + || !promotion.content_types.contains(&file.content_type) + || file.byte_size > u64::from(promotion.maximum_bytes) + { + return Err(MutationError::PreconditionFailed); + } + crate::attachment_store::require_frozen_reference( + tx, + &document.action_id, + document.proposal_id, + document.header.submission_version, + &promotion.from_attachment, + file, + ) + .await?; + crate::attachment_store::attach_record_reference( + tx, + &crate::attachment_store::RecordAttachmentReference { + entity_id, + record_id: *record_id, + slot_id: &promotion.slot_id, + sha256: &file.sha256, + content_type: &file.content_type, + byte_size: file.byte_size, + attached_revision: *revision, + attached_by: &binding.principal_reference, + }, + &backend, + &verification, + ) + .await?; + } + Ok(()) + } + pub(crate) async fn authorize_proposal_review_read( &self, tx: &Transaction<'_>, @@ -4639,3 +4752,23 @@ mod commit_guard_date_tests { )); } } + +#[cfg(test)] +mod target_install_tests { + use super::*; + use crate::postgres::PostgresKernelError; + + #[test] + fn a_refused_target_context_is_a_refusal_and_a_store_failure_is_unavailable() { + assert!(matches!( + target_install_error(PostgresKernelError::Configuration( + "verified database context is incomplete or invalid" + )), + MutationError::PreconditionFailed + )); + assert!(matches!( + target_install_error(PostgresKernelError::Connection), + MutationError::Unavailable + )); + } +} diff --git a/crates/registry-breg/src/odrl_export.rs b/crates/registry-breg/src/odrl_export.rs index 9c41192f2e..b2f853c422 100644 --- a/crates/registry-breg/src/odrl_export.rs +++ b/crates/registry-breg/src/odrl_export.rs @@ -351,6 +351,9 @@ fn audit_access_profile(access: &AccessProfileSource) { required_purposes: _, operations: _, readable_fields: _, + // The export describes record field projections only. A profile's + // file downloads are not part of the exported permission. + readable_attachments: _, writable_fields: _, filterable_fields: _, // Read by `omission_reasons`, which omits the list grant as `required-filters`. diff --git a/crates/registry-breg/src/package.rs b/crates/registry-breg/src/package.rs index 79f67e1494..aecf5c5ae9 100644 --- a/crates/registry-breg/src/package.rs +++ b/crates/registry-breg/src/package.rs @@ -353,6 +353,9 @@ pub enum CompiledRegistryChangeCode { EntityAccessLogChanged, EntityGeoJsonChanged, EntityTemporalChanged, + RecordAttachmentSlotAdded, + RecordAttachmentSlotRemoved, + RecordAttachmentSlotChanged, FieldAddedOptional, FieldAddedRequired, FieldRemoved, @@ -425,6 +428,7 @@ pub struct CompiledRegistryChangeTarget { pub enum CompiledRegistryChangeTargetKind { Registry, RecordType, + RecordAttachmentSlot, Field, DerivedRelation, Constraint, @@ -1243,6 +1247,9 @@ impl CompiledRegistryChangeCode { Self::FieldGenerationChanged => Some( "enabling generation on a retained field needs a reviewed backfill of missing values; changing or removing an active generator is unsupported", ), + Self::RecordAttachmentSlotRemoved | Self::RecordAttachmentSlotChanged => Some( + "a record attachment slot id and its policy remain stable while retained record files can name it. Keep the existing slot unchanged and add a new slot id for a different policy", + ), _ => None, } } @@ -1255,6 +1262,18 @@ fn compare_entities( ) { for (entity_id, previous_entity) in &previous.entities { let Some(candidate_entity) = candidate.entities.get(entity_id) else { + for slot_id in previous_entity.attachments.keys() { + push_change( + changes, + CompiledRegistryChangeClass::Unsupported, + CompiledRegistryChangeCode::RecordAttachmentSlotRemoved, + target( + CompiledRegistryChangeTargetKind::RecordAttachmentSlot, + Some(entity_id.as_str()), + Some(slot_id.as_str()), + ), + ); + } for field_id in previous_entity .fields .iter() @@ -1384,6 +1403,19 @@ fn compare_entities( ), ); } + compare_map( + entity_id, + &previous_entity.attachments, + &candidate_entity.attachments, + CompiledRegistryChangeTargetKind::RecordAttachmentSlot, + CompiledRegistryChangeCode::RecordAttachmentSlotAdded, + CompiledRegistryChangeCode::RecordAttachmentSlotRemoved, + CompiledRegistryChangeCode::RecordAttachmentSlotChanged, + CompiledRegistryChangeClass::CompatibleAdditive, + CompiledRegistryChangeClass::Unsupported, + CompiledRegistryChangeClass::Unsupported, + changes, + ); compare_fields(entity_id, previous_entity, candidate_entity, changes); compare_derived_relations(entity_id, previous_entity, candidate_entity, changes); compare_map( diff --git a/crates/registry-breg/src/package/tests/immediate_actions.rs b/crates/registry-breg/src/package/tests/immediate_actions.rs index 297ef85d02..b15ee16fb8 100644 --- a/crates/registry-breg/src/package/tests/immediate_actions.rs +++ b/crates/registry-breg/src/package/tests/immediate_actions.rs @@ -38,6 +38,110 @@ fn source_without_actions() -> Value { value } +fn source_with_record_attachment() -> Value { + let mut value = source(); + value["recordTypes"]["item"]["attachments"] = json!([{ + "id": "evidence", + "maximumBytes": 4096, + "contentTypes": ["application/pdf"], + "classification": "restricted", + "writeOnce": true + }]); + value +} + +#[test] +fn record_attachment_successors_allow_additions_and_refuse_existing_slot_changes() { + let before = compile(&source_with_record_attachment()); + + let mut added_source = source_with_record_attachment(); + added_source["recordTypes"]["item"]["attachments"] + .as_array_mut() + .unwrap() + .push(json!({ + "id": "certificate", + "maximumBytes": 4096, + "contentTypes": ["application/pdf"], + "classification": "restricted", + "writeOnce": true + })); + let added = compiled_registry_change_set(&before, &compile(&added_source), "prior-package"); + assert!(added.changes.iter().any(|change| { + change.class == CompiledRegistryChangeClass::CompatibleAdditive + && change.code == CompiledRegistryChangeCode::RecordAttachmentSlotAdded + && change.target.kind == CompiledRegistryChangeTargetKind::RecordAttachmentSlot + && change.target.record_type_id.as_deref() == Some("item") + && change.target.member_id.as_deref() == Some("certificate") + })); + change_set_to_applicable_migration_plan(&added) + .expect("a new record attachment slot is a safe additive successor"); + + let mut removed_source = source_with_record_attachment(); + removed_source["recordTypes"]["item"]["attachments"] = json!([]); + let removed_registry = compile(&removed_source); + let removed = compiled_registry_change_set(&before, &removed_registry, "prior-package"); + assert!(removed.changes.iter().any(|change| { + change.class == CompiledRegistryChangeClass::Unsupported + && change.code == CompiledRegistryChangeCode::RecordAttachmentSlotRemoved + && change.target.kind == CompiledRegistryChangeTargetKind::RecordAttachmentSlot + && change.target.record_type_id.as_deref() == Some("item") + && change.target.member_id.as_deref() == Some("evidence") + })); + assert_eq!( + change_set_to_applicable_migration_plan(&removed).err(), + Some(PackageError::MigrationPlan), + "a successor cannot strand retained bytes under a removed slot id" + ); + let baseline = CompiledRegistryMigrationBaseline::from_compiled("prior-package", &before); + assert_eq!( + reviewed_successor_migration_plan( + &baseline, + &removed_registry, + &removed, + vec!["modules/core/migrations/attachment-slot/descriptor.json".to_owned()], + "sha256:0000000000000000000000000000000000000000000000000000000000000000".to_owned(), + ) + .err(), + Some(PackageError::MigrationPlan), + "reviewed SQL cannot override the retained slot-id invariant" + ); + + let mut renamed_source = source_with_record_attachment(); + renamed_source["recordTypes"]["item"]["attachments"][0]["id"] = json!("certificate"); + let renamed = compiled_registry_change_set(&before, &compile(&renamed_source), "prior-package"); + assert!(renamed.changes.iter().any(|change| { + change.class == CompiledRegistryChangeClass::Unsupported + && change.code == CompiledRegistryChangeCode::RecordAttachmentSlotRemoved + && change.target.member_id.as_deref() == Some("evidence") + })); + assert!(renamed.changes.iter().any(|change| { + change.class == CompiledRegistryChangeClass::CompatibleAdditive + && change.code == CompiledRegistryChangeCode::RecordAttachmentSlotAdded + && change.target.member_id.as_deref() == Some("certificate") + })); + assert_eq!( + change_set_to_applicable_migration_plan(&renamed).err(), + Some(PackageError::MigrationPlan), + "renaming is a refused removal plus a safe addition" + ); + + let mut changed_source = source_with_record_attachment(); + changed_source["recordTypes"]["item"]["attachments"][0]["maximumBytes"] = json!(8192); + let changed = compiled_registry_change_set(&before, &compile(&changed_source), "prior-package"); + assert!(changed.changes.iter().any(|change| { + change.class == CompiledRegistryChangeClass::Unsupported + && change.code == CompiledRegistryChangeCode::RecordAttachmentSlotChanged + && change.target.kind == CompiledRegistryChangeTargetKind::RecordAttachmentSlot + && change.target.record_type_id.as_deref() == Some("item") + && change.target.member_id.as_deref() == Some("evidence") + })); + assert_eq!( + change_set_to_applicable_migration_plan(&changed).err(), + Some(PackageError::MigrationPlan), + "a successor cannot reinterpret a retained slot id" + ); +} + fn ordinary_policy_source(auditor_operations: Option<&[&str]>) -> Value { let mut source = json!({ "apiVersion":"id.registrystack.org/formats/breg/project/v1alpha1", "kind":"BRegProject", diff --git a/crates/registry-breg/src/postgres/catalog.rs b/crates/registry-breg/src/postgres/catalog.rs index 58b1318976..58c822a535 100644 --- a/crates/registry-breg/src/postgres/catalog.rs +++ b/crates/registry-breg/src/postgres/catalog.rs @@ -143,8 +143,10 @@ const MANAGED_INTERNAL_INDEXES: &[&str] = &[ "registry_internal.registry_proposal_idempotency_by_request", "registry_internal.registry_proposal_pending_targets", "registry_internal.registry_proposal_queue", + "registry_internal.registry_proposal_results_by_target", "registry_internal.registry_proposal_review_completion_reconcile", "registry_internal.registry_proposal_review_submission_jobs", + "registry_internal.registry_record_attachment_live_references", super::timer::TIMER_BINDINGS_OPEN_INDEX, super::timer::TIMER_DUE_INDEX, super::timer::TIMER_HISTORY_INDEX, diff --git a/crates/registry-breg/src/postgres/mutation.rs b/crates/registry-breg/src/postgres/mutation.rs index 4382a4cc69..db04f8c041 100644 --- a/crates/registry-breg/src/postgres/mutation.rs +++ b/crates/registry-breg/src/postgres/mutation.rs @@ -2070,7 +2070,13 @@ impl PostgresRecordMutationService { | MutationError::ActionHandlerFailure(_) | MutationError::ActionEvidenceFailure { .. } | MutationError::ActionRefusal(_) - | MutationError::TimerGenerationUnsupported => { + | MutationError::TimerGenerationUnsupported + // An ingestion batch never writes a file, so these + // refusals cannot reach a run. + | MutationError::AttachmentSlotWriteOnce + | MutationError::AttachmentTooLarge + | MutationError::AttachmentContentType + | MutationError::AttachmentDigestMismatch => { (IngestionAttemptOutcome::Unavailable, None) } }; diff --git a/crates/registry-breg/src/postgres/proposal.rs b/crates/registry-breg/src/postgres/proposal.rs index a4efba6225..2aaa8ec348 100644 --- a/crates/registry-breg/src/postgres/proposal.rs +++ b/crates/registry-breg/src/postgres/proposal.rs @@ -670,6 +670,92 @@ impl PostgresRecordMutationService { } } + /// How long the Proposal link checks of one revision read may take + /// together. The read computes one deadline from it for all its checks. + pub(crate) fn proposal_link_budget(&self) -> std::time::Duration { + self.action_timeout + } + + /// Whether the caller could read this Proposal. It runs the check a + /// Proposal read runs, [`Self::proposal_document`], through the same + /// `authorize_proposal_document`, in its own read transaction, and it + /// writes no audit entry: the caller is a revision read that audits its own + /// response. A Proposal the caller may not read, or that no longer exists, + /// is `Ok(false)`. Every other failure is an error, so a conflict or a + /// store failure fails the read instead of hiding the link. `deadline` is + /// the revision read's one deadline for all its link checks. + pub(crate) async fn proposal_link_readable( + &self, + id: Uuid, + authority: &ProposalAuthority, + deadline: tokio::time::Instant, + ) -> Result { + let client = self.proposal_read_client(authority, deadline).await?; + let mut guard = QueryCancellationGuard::new(self.pool.clone(), client); + let result = tokio::time::timeout_at(deadline, async { + let guarded = begin_proposal_transaction( + guard.client(), + self.lock_key, + self.lock_timeout, + &self.expected, + authority, + ) + .await + .map_err(|_| MutationError::Unavailable)?; + guarded + .set_statement_budget( + deadline.saturating_duration_since(tokio::time::Instant::now()), + ) + .await + .map_err(|_| MutationError::Unavailable)?; + // No row lock. A link names an applied Proposal, and applied is + // terminal: no runtime write changes its lifecycle row, inputs, + // submission or results, and operator erasure and other + // maintenance take the exclusive registry lock this transaction's + // shared lock excludes. The Proposal read locks the row to keep a + // changing document coherent, and `authorize_proposal_document` + // itself takes no lock for a Get, so a plain read gives the same + // answer here without waiting behind a lifecycle command's row + // lock. + let document = match proposal_store::load_document( + guarded.transaction(), + id, + proposal_store::DocumentLock::None, + ) + .await + { + Ok(document) => document, + Err(error) => return link_readable(Err(error)), + }; + let readable = link_readable( + self.coordinator + .authorize_proposal_document( + guarded.transaction(), + &self.registry, + &document, + authority, + ) + .await, + )?; + guarded + .commit() + .await + .map_err(|_| MutationError::Unavailable)?; + Ok(readable) + }) + .await; + match result { + Ok(result) => { + guard.disarm(); + result + } + Err(_) => { + guard.cancel_and_discard().await; + Err(MutationError::Unavailable) + } + } + } + pub(crate) async fn proposal_document( &self, id: Uuid, @@ -1547,3 +1633,43 @@ impl PostgresRecordMutationService { Ok(value) } } + +/// Whether a link check's authorization outcome lets the caller read the +/// Proposal. Only the two refusals a Proposal read gives a caller who may not +/// read it omit the link. A conflict, a retryable conflict or any other +/// failure stays an error, which the revision read answers as unavailable. +fn link_readable(outcome: Result<(), MutationError>) -> Result { + match outcome { + Ok(()) => Ok(true), + Err(MutationError::AuthorizationRefused | MutationError::PreconditionFailed) => Ok(false), + Err(error) => Err(error), + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn a_link_check_omits_only_a_refusal_and_fails_on_anything_else() { + assert_eq!(link_readable(Ok(())), Ok(true)); + for refusal in [ + MutationError::AuthorizationRefused, + MutationError::PreconditionFailed, + ] { + assert_eq!(link_readable(Err(refusal)), Ok(false)); + } + for failure in [ + MutationError::Conflict, + MutationError::RetryableConflict, + MutationError::Unavailable, + MutationError::InvalidRequest, + ] { + assert_eq!( + link_readable(Err(failure.clone())), + Err(failure), + "a store failure is a 503, never a silent omission" + ); + } + } +} diff --git a/crates/registry-breg/src/postgres/read.rs b/crates/registry-breg/src/postgres/read.rs index d066ab2597..735d02257e 100644 --- a/crates/registry-breg/src/postgres/read.rs +++ b/crates/registry-breg/src/postgres/read.rs @@ -4,6 +4,8 @@ #[path = "access_log.rs"] mod access_log; +#[path = "record_attachment_read.rs"] +mod record_attachment_read; use std::collections::{BTreeMap, BTreeSet}; use std::sync::Arc; @@ -63,6 +65,7 @@ pub struct PostgresRecordReadService { fault: ReadFaultControl, field_encryption: Option>, read_alerts: Option, + attachment_storage: crate::attachment_storage::AttachmentStorage, #[cfg(feature = "postgres-test")] query_plan: Option>>>, } @@ -89,6 +92,7 @@ impl PostgresRecordReadService { fault: ReadFaultControl::Disabled, field_encryption: None, read_alerts: None, + attachment_storage: crate::attachment_storage::AttachmentStorage::Database, #[cfg(feature = "postgres-test")] query_plan: None, } @@ -121,6 +125,18 @@ impl PostgresRecordReadService { self } + /// Bind the storage record attachment bytes are read from. It must be the + /// binding the mutation service writes under, or every stored file reads + /// as unavailable. + #[must_use] + pub fn with_attachment_storage( + mut self, + storage: crate::attachment_storage::AttachmentStorage, + ) -> Self { + self.attachment_storage = storage; + self + } + #[cfg(feature = "postgres-test")] #[must_use] #[doc(hidden)] @@ -724,6 +740,14 @@ impl RecordReadService for PostgresRecordReadService { Box::pin(self.read_access_log(request, cursor, limit)) } + fn record_attachment( + &self, + request: RecordReadRequest, + slot_id: String, + ) -> ServiceFuture<'_, Result, ReadServiceError>> { + Box::pin(self.read_record_attachment(request, slot_id)) + } + fn get( &self, request: RecordReadRequest, diff --git a/crates/registry-breg/src/postgres/record_attachment_read.rs b/crates/registry-breg/src/postgres/record_attachment_read.rs new file mode 100644 index 0000000000..8b4feed4e8 --- /dev/null +++ b/crates/registry-breg/src/postgres/record_attachment_read.rs @@ -0,0 +1,215 @@ +// SPDX-License-Identifier: Apache-2.0 + +use super::*; +use crate::api::HeldRecordAttachment; +use crate::attachment_storage::AttachmentStorage; + +impl PostgresRecordReadService { + /// Release one record slot's file to a profile whose `get` authority sees + /// the record and whose grant names the slot. The record's visibility, + /// the slot reference and the bytes are read in one RLS-bound snapshot, + /// under the content-hash lock that deletion also takes. + pub(super) async fn read_record_attachment( + &self, + mut request: RecordReadRequest, + slot_id: String, + ) -> Result, ReadServiceError> { + if !profile_is_keyed(self.audit.profile()) { + return Err(ReadServiceError::Unavailable); + } + let plan = ReadPlan::from_request(&self.registry, &self.expected, &self.cursors, &request) + .map_err(|_| ReadServiceError::Unavailable)?; + let granted = plan + .entity + .access_profiles + .get(request.context.selected_profile()) + .is_some_and(|profile| profile.readable_attachments.contains(&slot_id)); + if plan.operation != Operation::Get + || plan.read_path.is_some() + || !plan.entity.attachments.contains_key(&slot_id) + || !granted + || !request.selected_fields.is_empty() + { + return Err(ReadServiceError::Unavailable); + } + let record_id = match &request.kind { + RecordReadKind::Get { id } if valid_canonical_uuid(id) => id.clone(), + _ => return Err(ReadServiceError::Unavailable), + }; + let record_uuid = Uuid::parse_str(&record_id).map_err(|_| ReadServiceError::Unavailable)?; + let claims = strict_claim_context(&self.registry, &request.context, &request.entity_id)?; + if claims.principal().is_none() { + return Err(ReadServiceError::Unavailable); + } + // A distinct operation identity keeps the operational audit truthful: + // this endpoint releases file bytes and does not read the record body. + // The slot is configuration, not a value, so the identity names it. + request.operation_id = crate::attachment::record_attachment_operation_id( + &request.operation_id, + Some(&slot_id), + ); + let _attempt = begin_pre_io_audit( + &self.audit, + &self.expected, + &claims, + PreIoAudit { + kind: PreIoAuditKind::Attempt, + method: request.method, + operation_id: &request.operation_id, + target_record: Some(&record_id), + refusal_reason: None, + correlation: &request.correlation, + }, + ) + .await + .map_err(|_| ReadServiceError::Unavailable)?; + let client = self + .pool + .get() + .await + .map_err(|_| ReadServiceError::Unavailable)?; + // A read abandoned at its deadline stops its statement and gives up + // the session rather than leaving the backend running. + let mut session = QueryCancellationGuard::new(self.pool.clone(), client); + let read = async { + let transaction = begin_record_transaction( + session.client(), + self.lock_key, + self.lock_timeout, + &self.expected, + &claims, + ) + .await + .map_err(|_| ReadServiceError::Unavailable)?; + #[cfg(feature = "postgres-test")] + self.outrun_request_deadline_for_test(transaction.transaction()) + .await?; + install_evaluation_date(transaction.transaction(), &self.registry, None).await?; + // The record's own GET source relation answers visibility, so row + // boundaries, consent and lifecycle apply exactly as on GET. + let relations = ReadRelations::collection(&plan.entity, None, &[])?; + let visible = transaction + .transaction() + .query_typed( + &format!( + "SELECT 1 FROM {} WHERE {} = $1::text::uuid LIMIT 1", + relations.from_sql, relations.id_expression + ), + &[(&record_id, Type::TEXT)], + ) + .await + .map_err(|_| ReadServiceError::Unavailable)?; + if visible.is_empty() { + transaction + .commit() + .await + .map_err(|_| ReadServiceError::Unavailable)?; + return Ok(None); + } + let Some(stored) = crate::attachment_store::load_record_attachment( + transaction.transaction(), + &plan.entity.id, + record_uuid, + &slot_id, + ) + .await + .map_err(|_| ReadServiceError::Unavailable)? + else { + transaction + .commit() + .await + .map_err(|_| ReadServiceError::Unavailable)?; + return Ok(None); + }; + // External bytes are fetched while the hash lock is held, so + // deletion cannot remove them between the reference and the read. + let bytes = self.stored_record_attachment_bytes(&stored).await?; + if u64::try_from(bytes.len()).ok() != Some(stored.byte_size) + || crate::attachment_store::content_hash(&bytes) != stored.sha256 + { + tracing::error!("a record attachment's stored bytes do not match its digest"); + return Err(ReadServiceError::Unavailable); + } + let held = HeldRecordAttachment { + response: HeldReadResponse::from_attachment(bytes, stored.content_type)?, + sha256: stored.sha256, + }; + crate::subject_access_log::record_reads( + transaction.transaction(), + self.read_alerts.as_ref(), + &plan.entity, + &request.entity_id, + &request.context, + std::slice::from_ref(&record_id), + &request.operation_id, + &self.expected, + &request.correlation, + &self.audit, + ) + .await?; + transaction + .commit() + .await + .map_err(|_| ReadServiceError::Unavailable)?; + Ok::<_, ReadServiceError>(Some(held)) + } + .await; + session.disarm(); + let read = match read { + Ok(read) => read, + Err(error) => return Err(self.refused_read(&request, &claims, &plan, error).await), + }; + let Some(held) = read else { + self.record_read_terminal_audit( + &request, + self.terminal( + &request, + &claims, + &plan, + TerminalAuditOutcome::Refused, + 0, + None, + )?, + ) + .await + .map_err(|_| ReadServiceError::Unavailable)?; + return Ok(None); + }; + self.fault.fail_at(ReadFaultPoint::BeforeTerminalAudit)?; + self.record_read_terminal_audit( + &request, + self.terminal( + &request, + &claims, + &plan, + TerminalAuditOutcome::Returned, + 1, + None, + )?, + ) + .await + .map_err(|_| ReadServiceError::Unavailable)?; + Ok(Some(held)) + } + + /// Bytes from the storage binding the reference was written under. A + /// changed binding cannot read content another binding retains. + async fn stored_record_attachment_bytes( + &self, + stored: &crate::attachment_store::StoredRecordAttachment, + ) -> Result, ReadServiceError> { + if stored.backend_id != self.attachment_storage.binding_digest() { + tracing::error!("a record attachment is retained under another storage binding"); + return Err(ReadServiceError::Unavailable); + } + match &self.attachment_storage { + AttachmentStorage::Database => { + stored.content.clone().ok_or(ReadServiceError::Unavailable) + } + AttachmentStorage::S3(store) => store + .get(&stored.sha256, stored.byte_size) + .await + .map_err(|_| ReadServiceError::Unavailable), + } + } +} diff --git a/crates/registry-breg/src/postgres/revision_read.rs b/crates/registry-breg/src/postgres/revision_read.rs index c5051da705..4c40798d63 100644 --- a/crates/registry-breg/src/postgres/revision_read.rs +++ b/crates/registry-breg/src/postgres/revision_read.rs @@ -184,12 +184,27 @@ impl PostgresRevisionReadService { .read_rows(session.client(), &request, &claims, &plan) .await; session.disarm(); + // The Proposal link check below takes its own pooled session, so the + // record session goes back to the pool first. Holding both at once + // would exhaust a small pool and deadlock concurrent reads. + drop(session); let materialized = match materialized { Ok(materialized) => materialized, Err(error) => { return Err(self.refused(&claims, &request, &plan, error).await); } }; + // One deadline bounds every Proposal link check of this read, however + // many distinct Proposals the page names. + let link_deadline = request + .proposal_links + .as_ref() + .map(|access| tokio::time::Instant::now() + access.mutations.proposal_link_budget()); + let materialized = match resolve_proposal_links(&request, link_deadline, materialized).await + { + Ok(materialized) => materialized, + Err(error) => return Err(self.refused(&claims, &request, &plan, error).await), + }; let held = match RevisionReadResult::from_rows( &self.registry, &plan.entity, @@ -306,7 +321,7 @@ impl PostgresRevisionReadService { _ => None, } }; - let rows = match withheld_fields { + let mut rows = match withheld_fields { None => Vec::new(), Some(withheld_fields) => { let disclosure = RevisionDisclosure { @@ -347,6 +362,15 @@ impl PostgresRevisionReadService { .await? } }; + if request.proposal_links.is_some() && !rows.is_empty() { + attach_proposal_links( + transaction.transaction(), + &plan.entity.id, + record_id, + &mut rows, + ) + .await?; + } if !rows.is_empty() { crate::subject_access_log::record_reads( transaction.transaction(), @@ -721,6 +745,28 @@ struct RevisionEnvelope { data: Map, #[serde(skip_serializing_if = "Option::is_none")] change_context: Option>, + /// The Proposal submission that wrote this revision. Present only after + /// the caller's Proposal read authority admitted it. + #[serde(skip_serializing)] + proposal: Option, +} + +/// The stored link from a revision to the Proposal submission that wrote it. +#[derive(Clone)] +struct ProposalLink { + action_id: String, + proposal_id: Uuid, + submission_version: i64, +} + +impl ProposalLink { + fn member(&self) -> Value { + json!({ + "actionId": self.action_id, + "proposalId": self.proposal_id.to_string(), + "submissionVersion": self.submission_version, + }) + } } impl RevisionEnvelope { @@ -754,11 +800,99 @@ impl RevisionEnvelope { if let Some(change_context) = self.change_context { extensions.insert("changeContext".to_owned(), Value::Object(change_context)); } + if let Some(link) = &self.proposal { + extensions.insert("proposal".to_owned(), link.member()); + } record_profile::record_member(self.id, self.revision.to_string(), self.data, extensions) .map_err(|_| ReadServiceError::Unavailable) } } +/// Attach the stored Proposal link of each revision that has one. The link is +/// not yet disclosed: [`resolve_proposal_links`] keeps it only for a caller +/// who may read the Proposal. +async fn attach_proposal_links( + transaction: &tokio_postgres::Transaction<'_>, + entity_id: &str, + record_id: Uuid, + envelopes: &mut [RevisionEnvelope], +) -> Result<(), ReadServiceError> { + let revisions = envelopes + .iter() + .map(|envelope| i64::try_from(envelope.revision).map_err(|_| ReadServiceError::Unavailable)) + .collect::, _>>()?; + let rows = transaction + .query( + "SELECT target_revision, action_id, proposal_id, submission_version + FROM registry_internal.registry_proposal_results + WHERE target_entity_id = $1 AND target_record_id = $2 + AND target_revision = ANY($3) + ORDER BY target_revision, action_id, proposal_id, submission_version", + &[&entity_id, &record_id, &revisions], + ) + .await + .map_err(|_| ReadServiceError::Unavailable)?; + for row in rows { + let revision = + u64::try_from(row.get::<_, i64>(0)).map_err(|_| ReadServiceError::Unavailable)?; + if let Some(envelope) = envelopes + .iter_mut() + .find(|envelope| envelope.revision == revision) + { + envelope.proposal = Some(ProposalLink { + action_id: row.get(1), + proposal_id: row.get(2), + submission_version: row.get(3), + }); + } + } + Ok(()) +} + +/// Drop each Proposal link the caller could not read the Proposal of. The +/// check is the Proposal read's own authorization, applied once per Proposal. +/// A caller with no Proposal read authority for an Action sees no link to it. +/// Every check runs under the read's one `deadline`, which is present when +/// the request carries Proposal link access. +async fn resolve_proposal_links( + request: &RevisionReadRequest, + deadline: Option, + mut envelopes: Vec, +) -> Result, ReadServiceError> { + let mut decided: BTreeMap<(String, Uuid), bool> = BTreeMap::new(); + for envelope in &mut envelopes { + let Some(link) = envelope.proposal.as_ref() else { + continue; + }; + let key = (link.action_id.clone(), link.proposal_id); + let readable = match decided.get(&key) { + Some(readable) => *readable, + None => { + let readable = match request.proposal_links.as_ref().zip(deadline).and_then( + |(access, deadline)| { + access + .authorities + .get(&link.action_id) + .map(|authority| (&access.mutations, authority, deadline)) + }, + ) { + Some((mutations, authority, deadline)) => mutations + .proposal_link_readable(link.proposal_id, authority, deadline) + .await + .map_err(|_| ReadServiceError::Unavailable)?, + None => false, + }; + decided.insert(key, readable); + readable + } + }; + if !readable { + envelope.proposal = None; + } + } + Ok(envelopes) +} + #[allow(clippy::too_many_arguments)] // Authority, projection and retained-schema caches stay separate. async fn revision_rows_from_rows( transaction: &tokio_postgres::Transaction<'_>, @@ -949,6 +1083,7 @@ async fn revision_from_row( request_reference, data, change_context, + proposal: None, })) } diff --git a/crates/registry-breg/src/problem.rs b/crates/registry-breg/src/problem.rs index 1785fdda90..71ee01d356 100644 --- a/crates/registry-breg/src/problem.rs +++ b/crates/registry-breg/src/problem.rs @@ -26,6 +26,10 @@ pub enum ProblemCode { ActionGuardFailed, ActionHandlerFailed, ActionRefused, + AttachmentContentType, + AttachmentDigestMismatch, + AttachmentSlotWriteOnce, + AttachmentTooLarge, AuthenticationRefused, ExternalViewIncomplete, IdempotencyConflict, @@ -68,6 +72,10 @@ impl ProblemCode { Self::ActionGuardFailed, Self::ActionHandlerFailed, Self::ActionRefused, + Self::AttachmentContentType, + Self::AttachmentDigestMismatch, + Self::AttachmentSlotWriteOnce, + Self::AttachmentTooLarge, Self::AuthenticationRefused, Self::ExternalViewIncomplete, Self::IdempotencyExpired, @@ -113,6 +121,10 @@ impl ProblemCode { Self::ActionGuardFailed, Self::ActionHandlerFailed, Self::ActionRefused, + Self::AttachmentContentType, + Self::AttachmentDigestMismatch, + Self::AttachmentSlotWriteOnce, + Self::AttachmentTooLarge, Self::AuthenticationRefused, Self::IdempotencyExpired, Self::IdempotencyConflict, @@ -153,6 +165,10 @@ impl ProblemCode { Self::ActionGuardFailed => "action.guard_failed", Self::ActionHandlerFailed => "action.handler_failed", Self::ActionRefused => "action.refused", + Self::AttachmentContentType => "attachment.content-type", + Self::AttachmentDigestMismatch => "attachment.digest-mismatch", + Self::AttachmentSlotWriteOnce => "attachment.slot-write-once", + Self::AttachmentTooLarge => "attachment.too-large", Self::AuthenticationRefused => "authentication.refused", Self::ExternalViewIncomplete => "external_view.incomplete", Self::IdempotencyConflict => "idempotency.key-reused", @@ -201,7 +217,8 @@ impl ProblemCode { Self::AuthenticationRefused => 401, Self::IngestionProfileMismatch | Self::WriteOutsideBoundary => 403, Self::LookupUnresolved | Self::ResourceNotFound => 404, - Self::IdempotencyConflict + Self::AttachmentSlotWriteOnce + | Self::IdempotencyConflict | Self::IngestionChunkMismatch | Self::IngestionRunBlocked | Self::IngestionRunNotOpen @@ -215,8 +232,11 @@ impl ProblemCode { Self::ActionGuardFailed | Self::PreconditionFailed | Self::ProposalReviewResultMismatch => 412, - Self::UnsupportedMediaType => 415, - Self::ActionRefused | Self::StatisticalDatasetReleaseRefused => 422, + Self::AttachmentTooLarge => 413, + Self::AttachmentContentType | Self::UnsupportedMediaType => 415, + Self::ActionRefused + | Self::AttachmentDigestMismatch + | Self::StatisticalDatasetReleaseRefused => 422, Self::PreconditionRequired => 428, Self::ActionHandlerFailed | Self::StatisticalDatasetDomainViolation => 500, Self::ActionEvidenceFailed @@ -240,6 +260,7 @@ impl ProblemCode { 409 => "Conflict", 410 => "Gone", 412 => "Precondition Failed", + 413 => "Content Too Large", 415 => "Unsupported Media Type", 422 => "Unprocessable Entity", 428 => "Precondition Required", @@ -261,6 +282,16 @@ impl ProblemCode { Self::ActionGuardFailed => "The action guard was not satisfied.", Self::ActionHandlerFailed => "The action handler could not produce an accepted result.", Self::ActionRefused => "The action was refused by a declared business rule.", + Self::AttachmentContentType => { + "The file media type is not one the attachment slot accepts." + } + Self::AttachmentDigestMismatch => { + "The file content does not match its declared SHA-256 digest." + } + Self::AttachmentSlotWriteOnce => { + "The record attachment slot already holds a file and is write-once." + } + Self::AttachmentTooLarge => "The file is larger than the attachment slot accepts.", Self::AuthenticationRefused => "The bearer credential is missing or refused.", Self::ExternalViewIncomplete => { "The external view's indexed coverage is incomplete for this request." @@ -370,6 +401,42 @@ mod tests { } } + #[test] + fn record_attachment_refusals_have_their_exact_public_contracts() { + for (problem, status, title, code) in [ + ( + ProblemCode::AttachmentContentType, + 415, + "Unsupported Media Type", + "attachment.content-type", + ), + ( + ProblemCode::AttachmentDigestMismatch, + 422, + "Unprocessable Entity", + "attachment.digest-mismatch", + ), + ( + ProblemCode::AttachmentSlotWriteOnce, + 409, + "Conflict", + "attachment.slot-write-once", + ), + ( + ProblemCode::AttachmentTooLarge, + 413, + "Content Too Large", + "attachment.too-large", + ), + ] { + assert!(ProblemCode::ALL.contains(&problem)); + assert!(ProblemCode::DOCUMENTED.contains(&problem)); + assert_eq!(problem.status(), status); + assert_eq!(problem.title(), title); + assert_eq!(problem.code(), code); + } + } + #[test] fn every_type_resolves_under_the_shared_product_prefix() { for problem in ProblemCode::ALL { diff --git a/crates/registry-breg/src/proposal_artifacts.rs b/crates/registry-breg/src/proposal_artifacts.rs index 7e91ad96a9..cec9295a0e 100644 --- a/crates/registry-breg/src/proposal_artifacts.rs +++ b/crates/registry-breg/src/proposal_artifacts.rs @@ -15,6 +15,9 @@ pub(crate) fn append_proposal_openapi( // be refused when a profile it describes may apply a Proposal whose plan // can be refused as that profile. let mut apply_may_refuse_write = false; + // Every record slot is write-once, so applying a Proposal that promotes + // a file can meet a slot an earlier write already filled. + let mut apply_may_fill_written_slot = false; for action in &actions.actions { let CompiledActionExecution::Proposal { proposal } = &action.execution else { continue; @@ -47,6 +50,8 @@ pub(crate) fn append_proposal_openapi( } apply_may_refuse_write |= permitted(ProposalOperation::Apply) && action_may_refuse_write(action, entities, &grant.profile_id); + apply_may_fill_written_slot |= + permitted(ProposalOperation::Apply) && !proposal.promotions.is_empty(); let document_fields = proposal .review_context .as_ref() @@ -221,6 +226,9 @@ pub(crate) fn append_proposal_openapi( if operation == ProposalOperation::Apply && apply_may_refuse_write { document["responses"]["403"] = json!({"description":"The application writes outside what the selected access profile may write: a disclosure condition binds it on a record type the plan patches (`write.outside-boundary`)"}); } + if operation == ProposalOperation::Apply && apply_may_fill_written_slot { + document["responses"]["409"] = json!({"description":"The Proposal was rejected, the idempotency key was reused with a different request, or the plan promotes a file into a record slot that already holds one (`attachment.slot-write-once`)"}); + } let schema = match operation { ProposalOperation::Apply => proposal_apply_input_schema(), ProposalOperation::Edit | ProposalOperation::Rebase => json!({"anyOf":inputs}), diff --git a/crates/registry-breg/src/proposal_retention.rs b/crates/registry-breg/src/proposal_retention.rs index ee4d2b1f96..d5213a3ec7 100644 --- a/crates/registry-breg/src/proposal_retention.rs +++ b/crates/registry-breg/src/proposal_retention.rs @@ -762,7 +762,9 @@ impl ProposalRetentionOperatorService { AND (state IN ('delete_pending','delete_confirmed') OR (state='staged' AND created_at < transaction_timestamp()-interval '10 minutes')) AND NOT EXISTS (SELECT 1 FROM registry_internal.registry_proposal_attachments a - WHERE a.sha256=b.sha256 AND a.erased_at IS NULL)", + WHERE a.sha256=b.sha256 AND a.erased_at IS NULL) + AND NOT EXISTS (SELECT 1 FROM registry_internal.registry_record_attachments r + WHERE r.sha256=b.sha256 AND r.erased_at IS NULL)", &[&hash, &backend], ) .await diff --git a/crates/registry-breg/src/proposal_store.rs b/crates/registry-breg/src/proposal_store.rs index 3b281645fe..a02c390a20 100644 --- a/crates/registry-breg/src/proposal_store.rs +++ b/crates/registry-breg/src/proposal_store.rs @@ -201,6 +201,9 @@ pub(crate) async fn install( REFERENCES registry_internal.registry_revisions (entity_id, record_id, record_revision) ); + CREATE INDEX IF NOT EXISTS registry_proposal_results_by_target + ON registry_internal.registry_proposal_results + (target_entity_id, target_record_id, target_revision); CREATE TABLE IF NOT EXISTS registry_internal.registry_proposal_idempotency_links ( key_reference text NOT NULL, action_revision text NOT NULL CHECK (action_revision ~ '^sha256:[0-9a-f]{64}$'), diff --git a/crates/registry-breg/src/proposal_workflow.rs b/crates/registry-breg/src/proposal_workflow.rs index bad90a463b..b2c4529d1a 100644 --- a/crates/registry-breg/src/proposal_workflow.rs +++ b/crates/registry-breg/src/proposal_workflow.rs @@ -388,7 +388,7 @@ impl ProposalWorkflow { if !proposal.effect_digest.matches(&application.effect_digest) { return Err(WorkflowError::DigestMismatch); } - proposal.verify_application_links(&application.result_links) + proposal.verify_restored_application_links(&application.result_links) } fn validate_restored_state(&self) -> Result<(), WorkflowError> { @@ -1067,6 +1067,28 @@ impl ProposalSnapshot { } Ok(()) } + + /// An application links every target it wrote. History erasure removes + /// the link to a revision it erases, so a stored receipt links a subset + /// of the targets, possibly none. + fn verify_restored_application_links( + &self, + result_links: &[ApplicationResultLink], + ) -> Result<(), WorkflowError> { + let expected = self + .expected_targets() + .keys() + .map(TargetIdentity::record_key) + .collect::>(); + if result_links + .iter() + .all(|link| expected.contains(&(link.entity_id.clone(), link.record_id.clone()))) + { + Ok(()) + } else { + Err(WorkflowError::ApplicationReceiptMismatch) + } + } } #[derive(Clone, PartialEq, Serialize, Deserialize)] @@ -1595,9 +1617,8 @@ impl ApplicationReceipt { self.effect_digest.validate()?; self.applied_by.validate()?; self.applied_at.validate()?; - if self.result_links.is_empty() { - return Err(WorkflowError::ApplicationReceiptMismatch); - } + // An empty list is a receipt whose links history erasure removed. + // The apply itself requires a link for every target. let mut unique = BTreeSet::new(); for link in &self.result_links { link.validate()?; @@ -2774,6 +2795,70 @@ mod source_owned_review_tests { assert_eq!(applied.state(), ProposalState::Applied); } + #[test] + fn an_apply_links_every_target_and_a_stored_receipt_links_no_other_record() { + let submitted = workflow() + .submit( + context("submitter", "2026-09-19T00:00:00Z"), + proposal(no_review()), + ) + .expect("submit") + .into_workflow(); + let frozen = submitted.current_proposal().expect("frozen proposal"); + let digest = frozen.effect_digest().clone(); + let contract = frozen.contract_fingerprint().clone(); + let elsewhere = || { + vec![ApplicationResultLink::new( + entity("asset-placement"), + record("placement-2"), + revision(4), + )] + }; + let refused = submitted.clone().apply( + context("applier", "2026-09-19T00:02:00Z"), + SubmissionVersion::first(), + &digest, + &contract, + None, + observed_targets(), + PreparedApplication::new(ApplicationId::new("application-1").unwrap(), elsewhere()) + .unwrap(), + None, + ); + assert_eq!( + refused.expect_err("an apply links exactly the frozen targets"), + WorkflowError::ApplicationReceiptMismatch + ); + let applied = submitted + .apply( + context("applier", "2026-09-19T00:02:00Z"), + SubmissionVersion::first(), + &digest, + &contract, + None, + observed_targets(), + application(), + None, + ) + .expect("direct application") + .into_workflow(); + + let mut erased = applied.clone(); + erased.application.as_mut().unwrap().result_links.clear(); + erased + .validate_restored() + .expect("history erasure may remove every link"); + let mut foreign = applied; + foreign.application.as_mut().unwrap().result_links = elsewhere(); + assert!( + matches!( + foreign.validate_restored(), + Err(WorkflowError::ApplicationReceiptMismatch) + ), + "a stored link names only a frozen target" + ); + } + #[test] fn each_submit_freezes_the_access_profile_that_submitted_it() { let as_profile = |timestamp: &str, profile: &str| { diff --git a/crates/registry-breg/src/startup.rs b/crates/registry-breg/src/startup.rs index 4145ab8e77..19375f49e0 100644 --- a/crates/registry-breg/src/startup.rs +++ b/crates/registry-breg/src/startup.rs @@ -1849,7 +1849,8 @@ async fn finish_prepared_server( .with_event_destinations( Some(Arc::clone(&event_destinations)), config.identity().instance_id(), - ); + ) + .with_attachment_storage(attachment_storage.clone()); let records = Arc::new(match field_encryption.clone() { Some(field_encryption) => records.with_field_encryption(field_encryption), None => records, diff --git a/crates/registry-breg/src/tests/artifacts_response_schema_tests.rs b/crates/registry-breg/src/tests/artifacts_response_schema_tests.rs index 182b40ee92..4df980de14 100644 --- a/crates/registry-breg/src/tests/artifacts_response_schema_tests.rs +++ b/crates/registry-breg/src/tests/artifacts_response_schema_tests.rs @@ -1245,6 +1245,7 @@ fn the_required_filter_refusal_is_documented_only_where_a_profile_requires_a_fil request_schema_ref: "person", readable_fields: None, access_profiles: super::OpenApiAccessProfiles::Selected(profile), + proposal_links: false, }); assert_eq!(declares(&operation["responses"]), declared, "{profile}"); } diff --git a/crates/registry-breg/tests/attachment_promotion_compiler.rs b/crates/registry-breg/tests/attachment_promotion_compiler.rs new file mode 100644 index 0000000000..7d0107fbc4 --- /dev/null +++ b/crates/registry-breg/tests/attachment_promotion_compiler.rs @@ -0,0 +1,361 @@ +// SPDX-License-Identifier: Apache-2.0 +//! A Proposal Action's create or patch effect can promote one Proposal file +//! into a record slot of its target record type. The compiler refuses every +//! promotion the record slot could not hold. + +use registry_breg::compiler::{compile_project, CompileProfile}; +use registry_breg::contract::parse_project_json; +use registry_breg::CompileFailure; +use serde_json::{json, Value}; + +const CODE: &str = "breg.action.attachment-invalid"; + +fn source() -> Value { + json!({"apiVersion":"id.registrystack.org/formats/breg/project/v1alpha1","kind":"BRegProject", + "project":{"id":"promotion-compiler","version":"1","defaultLanguage":"en", + "canonicalBaseIri":"https://promotion.example.test"}, + "datasets":{"directory":{}}, + "recordTypes":{ + "application":{"primaryDataset":"directory","route":"applications","mutationMode":"mutable", + "fields":[{"id":"name","type":"string","required":true,"maximumLength":64,"classification":"internal"}, + {"id":"note","type":"string","required":false,"maximumLength":64,"classification":"internal"}], + "attachments":[{"id":"evidence","maximumBytes":64,"contentTypes":["text/plain","application/pdf"], + "classification":"restricted","writeOnce":true}]}}, + "actions":{ + "amend":{"execution":{"mode":"proposal","proposal":{"review":{"type":"none"}, + "application":{"mode":"manual"},"retention":{"mode":"operator-erase"}, + "attachments":[{"id":"document","required":false,"maximumBytes":64, + "contentTypes":["text/plain"],"classification":"restricted"}]}}, + "inputs":[{"id":"target","type":"reference","target":"application","required":true,"classification":"internal"}, + {"id":"name","type":"string","required":true,"maximumLength":64,"classification":"internal"}], + "commitGuards":{"targets":[{"input":"target","revision":"unchanged"}]}, + "plan":{"type":"fixed","effects":[ + {"id":"copy","target":{"recordType":"application"},"operation":"create", + "set":{"name":{"fromInput":"name"}}, + "attachments":{"evidence":{"fromAttachment":"document"}}}, + {"id":"original","target":{"fromInput":"target"},"operation":"patch", + "set":{"name":{"fromInput":"name"}}, + "attachments":{"evidence":{"fromAttachment":"document"}}}]}}}, + "accessProfiles":{ + "clerk":{"default":true,"principalClaim":"sub","requiredScopes":["application:manage"], + "requiredPurposes":["registry-administration"],"permissions":{ + "records":[{"recordType":"application","operations":["get","list"], + "readableFields":["name","note"],"readableAttachments":["evidence"], + "rowBoundaries":"unrestricted"}], + "actions":[{"action":"amend","operations":["start"],"targets":[ + {"recordType":"application","rowBoundaries":"unrestricted"}]}], + "proposals":[{"action":"amend","operations":["get","list","edit","submit","apply"], + "ownership":"caller","readableAttachments":["document"], + "writableAttachments":["document"],"targets":[ + {"recordType":"application","rowBoundaries":"unrestricted"}]}]}}}}) +} + +fn compile_bytes(bytes: &[u8]) -> Result { + let project = parse_project_json(bytes)?; + compile_project(&project, &[], CompileProfile::Authoring) +} + +fn compile(source: &Value) -> Result { + compile_bytes(&serde_json::to_vec(source).unwrap()) +} + +fn mutated(mutate: impl FnOnce(&mut Value)) -> Value { + let mut source = source(); + mutate(&mut source); + source +} + +/// Asserts one `breg.action.attachment-invalid` refusal at `path` whose +/// message contains `message`. +fn assert_refused(source: &Value, path: &str, message: &str) { + let Err(failure) = compile(source) else { + panic!("expected the promotion to be refused, but the project compiled") + }; + assert!( + failure.diagnostics().iter().any(|diagnostic| { + diagnostic.code == CODE + && diagnostic.path == path + && diagnostic.message.contains(message) + }), + "expected {CODE} at {path} with {message:?}: {:#?}", + failure.diagnostics() + ); +} + +fn effect_path(effect: &str) -> String { + format!("actions[id=amend].plan.effects[id={effect}].attachments[slot=evidence]") +} + +#[test] +fn create_and_patch_effects_promote_one_proposal_file() { + let compiled = compile(&source()).expect("a matching promotion compiles"); + let action = compiled + .actions() + .actions + .iter() + .find(|action| action.id == "amend") + .unwrap(); + let execution = serde_json::to_value(&action.execution).unwrap(); + assert_eq!( + execution["proposal"]["promotions"], + json!([ + {"effectId":"copy","recordType":"application","slotId":"evidence", + "fromAttachment":"document","maximumBytes":64, + "contentTypes":["text/plain","application/pdf"]}, + {"effectId":"original","recordType":"application","slotId":"evidence", + "fromAttachment":"document","maximumBytes":64, + "contentTypes":["text/plain","application/pdf"]} + ]) + ); + // A Proposal request carries no record file, so the Action has no + // request attachments and its start schema has no file member. + assert!(action.attachments.is_empty()); +} + +#[test] +fn a_promotion_must_name_a_declared_proposal_slot() { + assert_refused( + &mutated(|source| { + source["actions"]["amend"]["plan"]["effects"][1]["attachments"] = + json!({"evidence":{"fromAttachment":"missing"}}); + }), + &format!("{}.fromAttachment", effect_path("original")), + "Proposal attachment slot", + ); +} + +#[test] +fn a_promotion_must_name_a_slot_of_the_effect_target_record_type() { + assert_refused( + &mutated(|source| { + source["actions"]["amend"]["plan"]["effects"][0]["attachments"] = + json!({"missing":{"fromAttachment":"document"}}); + }), + "actions[id=amend].plan.effects[id=copy].attachments[slot=missing]", + "a slot the target record type declares", + ); +} + +#[test] +fn a_promotion_refuses_a_content_type_the_record_slot_does_not_accept() { + assert_refused( + &mutated(|source| { + source["actions"]["amend"]["execution"]["proposal"]["attachments"][0]["contentTypes"] = + json!(["text/plain", "image/png"]); + }), + &format!("{}.fromAttachment", effect_path("copy")), + "content type", + ); +} + +#[test] +fn a_promotion_refuses_a_size_the_record_slot_does_not_accept() { + assert_refused( + &mutated(|source| { + source["actions"]["amend"]["execution"]["proposal"]["attachments"][0]["maximumBytes"] = + json!(65); + }), + &format!("{}.fromAttachment", effect_path("copy")), + "larger", + ); +} + +#[test] +fn a_promotion_refuses_a_record_slot_less_restricted_than_the_proposal_slot() { + for classification in ["internal", "public"] { + assert_refused( + &mutated(|source| { + source["recordTypes"]["application"]["attachments"][0]["classification"] = + json!(classification); + }), + &format!("{}.fromAttachment", effect_path("copy")), + "less restricted", + ); + } +} + +#[test] +fn a_promotion_may_fill_a_record_slot_more_restricted_than_the_proposal_slot() { + let source = mutated(|source| { + source["actions"]["amend"]["execution"]["proposal"]["attachments"][0]["classification"] = + json!("internal"); + }); + compile(&source).expect("a more restricted record slot holds the file"); +} + +#[test] +fn two_effects_cannot_promote_into_one_record_slot_of_one_record() { + // `again` patches the same target record as `original`, through a + // different field, so only the promotion overlaps. + assert_refused( + &mutated(|source| { + source["actions"]["amend"]["plan"]["effects"] + .as_array_mut() + .unwrap() + .push( + json!({"id":"again","target":{"fromInput":"target"},"operation":"patch", + "set":{"note":{"fromInput":"name"}}, + "attachments":{"evidence":{"fromAttachment":"document"}}}), + ); + }), + &effect_path("again"), + "more than once", + ); +} + +#[test] +fn one_effect_cannot_name_one_record_slot_twice() { + let bytes = serde_json::to_string(&source()).unwrap(); + let single = r#""attachments":{"evidence":{"fromAttachment":"document"}}"#; + assert!(bytes.contains(single)); + let duplicated = bytes.replacen( + single, + r#""attachments":{"evidence":{"fromAttachment":"document"},"evidence":{"fromAttachment":"document"}}"#, + 1, + ); + let Err(failure) = compile_bytes(duplicated.as_bytes()) else { + panic!("expected a duplicate slot key to be refused, but the project compiled") + }; + assert!( + failure + .diagnostics() + .iter() + .any(|diagnostic| diagnostic.code == "breg.source.json-invalid"), + "{:#?}", + failure.diagnostics() + ); +} + +#[test] +fn an_immediate_action_still_cannot_take_a_file_from_a_proposal_slot() { + // An immediate Action has no Proposal slots: its create effect names a + // file in the same request, and a patch effect cannot attach a file. + let source = mutated(|source| { + source["actions"]["amend"]["execution"] = json!({"mode":"immediate"}); + source["accessProfiles"]["clerk"]["permissions"]["actions"][0]["operations"] = + json!(["invoke"]); + source["accessProfiles"]["clerk"]["permissions"] + .as_object_mut() + .unwrap() + .remove("proposals"); + }); + assert_refused( + &source, + "actions[id=amend].plan.effects[id=original].attachments", + "only a create effect", + ); +} + +#[test] +fn a_tombstone_effect_cannot_promote_a_file() { + let source = mutated(|source| { + source["actions"]["amend"]["plan"]["effects"][1] = json!({ + "id":"original","target":{"fromInput":"target"},"operation":"tombstone", + "attachments":{"evidence":{"fromAttachment":"document"}}}); + }); + assert_refused( + &source, + "actions[id=amend].plan.effects[id=original].attachments", + "only a create or patch effect", + ); +} + +fn apply_conflict_description(source: &Value) -> String { + let compiled = compile(source).expect("the project compiles"); + let openapi: Value = serde_json::from_slice( + &compiled + .artifacts() + .get("generated/openapi.json") + .expect("generated OpenAPI") + .bytes, + ) + .unwrap(); + openapi["paths"]["/v1/proposals/{proposal_id}/apply"]["post"]["responses"]["409"]["description"] + .as_str() + .expect("apply documents 409") + .to_owned() +} + +#[test] +fn apply_documents_a_filled_write_once_slot_only_when_a_plan_promotes_a_file() { + // Every record slot is write-once, so any promotion can meet a filled + // slot when the Proposal is applied. + assert!( + apply_conflict_description(&source()).contains("`attachment.slot-write-once`"), + "a promotion into a filled slot can be refused" + ); + let unpromoted = mutated(|source| { + for effect in source["actions"]["amend"]["plan"]["effects"] + .as_array_mut() + .unwrap() + { + effect.as_object_mut().unwrap().remove("attachments"); + } + }); + assert!( + !apply_conflict_description(&unpromoted).contains("slot-write-once"), + "a plan that promotes nothing cannot meet a filled slot" + ); +} + +/// The same project with one immediate Action whose create effect files the +/// request part `document` into the record slot, or files nothing. +fn immediate_source(binding: Option<&str>) -> Value { + mutated(|source| { + source["actions"]["amend"]["execution"] = json!({"mode":"immediate"}); + let effects = source["actions"]["amend"]["plan"]["effects"] + .as_array_mut() + .unwrap(); + effects.truncate(1); + match binding { + Some(name) => { + effects[0]["attachments"] = json!({"evidence":{"fromAttachment":name}}); + } + None => { + effects[0].as_object_mut().unwrap().remove("attachments"); + } + } + source["accessProfiles"]["clerk"]["permissions"]["actions"][0]["operations"] = + json!(["invoke"]); + source["accessProfiles"]["clerk"]["permissions"] + .as_object_mut() + .unwrap() + .remove("proposals"); + }) +} + +fn amend_revision(source: &Value) -> String { + let compiled = compile(source).expect("the immediate Action compiles"); + compiled + .actions() + .actions + .iter() + .find(|action| action.id == "amend") + .unwrap() + .definition_revision + .clone() +} + +#[test] +fn an_immediate_action_revision_covers_its_request_file_bindings() { + // The bindings decide which request part fills which record slot, so a + // request accepted under one set must not be replayed under another. + let bound = amend_revision(&immediate_source(Some("document"))); + let renamed = amend_revision(&immediate_source(Some("upload"))); + let unbound = amend_revision(&immediate_source(None)); + assert_ne!( + bound, renamed, + "renaming the request part moves the revision" + ); + assert_ne!(bound, unbound, "dropping the binding moves the revision"); +} + +#[test] +fn an_immediate_action_without_request_files_keeps_its_revision() { + // An Action that files nothing keeps the revision it had before request + // files were part of the revision, so its stored retries stay valid. + assert_eq!( + amend_revision(&immediate_source(None)), + "sha256:4d2e0fb342b537ee57675e9600861300709a40058c2cad043144b7d6d27c19d2" + ); +} diff --git a/crates/registry-breg/tests/compiled_ddl_pins.rs b/crates/registry-breg/tests/compiled_ddl_pins.rs index 1cb8853d31..8154a650c5 100644 --- a/crates/registry-breg/tests/compiled_ddl_pins.rs +++ b/crates/registry-breg/tests/compiled_ddl_pins.rs @@ -78,6 +78,10 @@ //! admitted profile requires a filter. A registry with no disclosure //! condition, required filter or access reason keeps its exact SQL and Action //! fingerprints. +//! The record attachment Problems `attachment.too-large`, +//! `attachment.content-type`, `attachment.digest-mismatch` and +//! `attachment.slot-write-once` in the generated Problem schema likewise move +//! artifact revisions only. SQL and Action fingerprints stay fixed. use registry_breg::compiler::{compile_project, CompileProfile}; use registry_breg::contract::{parse_module_yaml, parse_project_yaml}; @@ -100,7 +104,7 @@ const FIXTURES: &[Fixture] = &[ ), module: None, ddl_sha256: "6d6431e3e4fb3eb254ef8f3b2e895aed2c09ed4ee7ca506627e1d063359f4578", - revision: "sha256:f620ea3ea326561996e718c17523fc1fb86f2694788f9ace923f28a494efa356", + revision: "sha256:08f60d4a781ad80f957579927f703668a9a60fd75ff66533ba11e0137e157ea1", }, Fixture { name: "asset-registration-actions", @@ -111,7 +115,7 @@ const FIXTURES: &[Fixture] = &[ "../../../products/breg/fixtures/asset-registration-actions/modules/asset-registration-actions-core/module.yaml" )), ddl_sha256: "43acdae956eb2f932fb22a2cccc5cee5ed19cf806f2f28bbc677eff219d00b99", - revision: "sha256:45cab0f3b9e7a03c682e58a529a3931a1f4a98c5809c6d2b1c06e4e8ad0c442f", + revision: "sha256:49ca49a8d3c42e51d6e87e6c2a4cf3b48912ba643182e2333f948bdbb6330d52", }, Fixture { name: "facility-registry-actions", @@ -122,7 +126,7 @@ const FIXTURES: &[Fixture] = &[ "../../../products/breg/fixtures/facility-registry-actions/modules/facility-registry-actions-core/module.yaml" )), ddl_sha256: "6439a877ee6508b999a77242542695d8ccddc6d80518699d90eddc32b305780b", - revision: "sha256:630c864d8a830f0365ea16b97c4b7c86b2c93adb4c4016717eae1d27a3b3a3d9", + revision: "sha256:b2b2a04f66dc65e9144b4b77099953572e3e16d8e94446dbfcb47954c31f7667", }, Fixture { name: "household-contact-actions", @@ -133,7 +137,7 @@ const FIXTURES: &[Fixture] = &[ "../../../products/breg/fixtures/household-contact-actions/modules/household-contact-actions-core/module.yaml" )), ddl_sha256: "f82f2f8376df97fb184c04d31c8e42c291f7a03dbd909828e1bf61612106de35", - revision: "sha256:ab7cb164756c143fc50889dcfecdd89b2786826771f990d954dbc5c8a279b400", + revision: "sha256:80a558305edc78b5db62bac2eb75c078994aad4a518b1f6f8eed1d235a226717", }, ]; diff --git a/crates/registry-breg/tests/compiler_contract.rs b/crates/registry-breg/tests/compiler_contract.rs index cb3d85a25a..366e558870 100644 --- a/crates/registry-breg/tests/compiler_contract.rs +++ b/crates/registry-breg/tests/compiler_contract.rs @@ -6245,6 +6245,10 @@ fn generated_openapi_routes_and_physical_names_share_one_compiled_inventory() { "action.guard_failed", "action.handler_failed", "action.refused", + "attachment.content-type", + "attachment.digest-mismatch", + "attachment.slot-write-once", + "attachment.too-large", "authentication.refused", "idempotency.expired", "idempotency.key-reused", @@ -7576,6 +7580,103 @@ fn snapshot_operation_is_authenticated_stored_field_history_contract() { .as_object() .expect("revision detail properties render") .contains_key("changeContext")); + for schema in [revision_schema, revision_detail_schema] { + assert!( + !schema["properties"] + .as_object() + .expect("revision properties render") + .contains_key("proposal"), + "a registry without a Proposal Action declares no Proposal link" + ); + } +} + +/// The optional `proposal` member of a revision names the Proposal that wrote +/// it, so the OpenAPI document declares it only for a registry that has a +/// Proposal Action. A registry whose Actions are all immediate declares none. +#[test] +fn revision_schemas_declare_the_proposal_link_only_for_a_registry_with_proposal_actions() { + let targets = json!([{"recordType":"target","rowBoundaries":"unrestricted"}]); + let source = |execution: Value, operation: &str, proposals: Value| { + json!({"datasets":{"directory": {}}, + "apiVersion":"id.registrystack.org/formats/breg/project/v1alpha1", + "kind":"BRegProject", + "project":{"id":"revision-proposal-link","version":"1","defaultLanguage":"en","canonicalBaseIri":"https://authoring.example.test"}, + "recordTypes":{"target": {"primaryDataset":"directory","route":"targets","mutationMode":"mutable","classification":"internal", + "fields":[{"id":"name","type":"string","required":true,"maximumLength":64,"classification":"internal"}]}}, + "actions":{"correct-name": {"execution":execution, + "inputs":[{"id":"target","type":"reference","target":"target","required":true,"classification":"internal"}, + {"id":"value","type":"string","required":true,"maximumLength":64,"classification":"internal"}], + "plan":{"type":"fixed","effects":[{"id":"name","target":{"fromInput":"target"},"operation":"patch","set":{"name":{"fromInput":"value"}}}]}}}, + "accessProfiles":{"historian": {"default":true,"principalClaim":"principal","requiredScopes":"unrestricted","permissions":{ + "records":[{"recordType":"target","operations":["get","revisions"],"revisionAccess":true, + "readableFields":["name"],"rowBoundaries":"unrestricted"}], + "actions":[{"action":"correct-name","operations":[operation],"targets":targets}], + "proposals":proposals}}} + }) + }; + let proposal = source( + json!({"mode":"proposal","proposal":{"review":{"type":"none"}, + "application":{"mode":"manual"},"retention":{"mode":"operator-erase"}}}), + "start", + json!([{"action":"correct-name","operations":["get"],"ownership":"caller","targets":targets}]), + ); + let immediate = source(json!({"mode":"immediate"}), "invoke", json!([])); + let revision_schemas = |source: &Value| { + let compiled = compile_json(&serde_json::to_vec(source).expect("source serializes")) + .expect("the revision link project compiles"); + let openapi = compiled + .artifacts() + .get("generated/openapi.json") + .expect("OpenAPI is generated"); + let openapi = parse_json_strict(&openapi.bytes).expect("OpenAPI is strict JSON"); + let list = openapi["paths"]["/v1/records/targets/{record_id}/revisions"]["get"] + ["responses"]["200"]["content"]["application/json"]["schema"]["properties"]["items"] + ["items"] + .clone(); + let detail = openapi["paths"]["/v1/records/targets/{record_id}/revisions/{revision}"] + ["get"]["responses"]["200"]["content"]["application/json"]["schema"]["properties"] + ["data"] + .clone(); + [list, detail] + }; + + for schema in revision_schemas(&proposal) { + assert_eq!( + schema["properties"]["proposal"], + json!({ + "type": "object", + "additionalProperties": false, + "required": ["actionId", "proposalId", "submissionVersion"], + "properties": { + "actionId": {"type": "string"}, + "proposalId": {"type": "string", "format": "uuid"}, + "submissionVersion": {"type": "integer", "format": "int64", "minimum": 1} + } + }), + "a registry with a Proposal Action declares the Proposal link" + ); + assert!(!schema["required"] + .as_array() + .expect("revision required properties render") + .contains(&json!("proposal"))); + } + for schema in revision_schemas(&immediate) { + assert!( + schema["properties"] + .as_object() + .expect("revision properties render") + .contains_key("domainData"), + "the revision schema renders" + ); + assert!( + !schema["properties"] + .as_object() + .expect("revision properties render") + .contains_key("proposal"), + "a registry with only immediate Actions declares no Proposal link" + ); + } } #[test] diff --git a/crates/registry-breg/tests/fixtures/audit-identity-goldens.json b/crates/registry-breg/tests/fixtures/audit-identity-goldens.json index c9deee6d53..ea0f2b3654 100644 --- a/crates/registry-breg/tests/fixtures/audit-identity-goldens.json +++ b/crates/registry-breg/tests/fixtures/audit-identity-goldens.json @@ -5,6 +5,9 @@ "breg-history-erasure-audit/v3": [ "activationId" ], + "breg-history-erasure-audit/v4": [ + "activationId" + ], "breg-history-rebaseline-audit/v3": [ "activationId" ], diff --git a/crates/registry-breg/tests/postgres_compiled_schema.rs b/crates/registry-breg/tests/postgres_compiled_schema.rs index cdb07f40ac..605d6d50c9 100644 --- a/crates/registry-breg/tests/postgres_compiled_schema.rs +++ b/crates/registry-breg/tests/postgres_compiled_schema.rs @@ -369,6 +369,73 @@ async fn immediate_action_catalog_localizes_its_conditional_internal_index() { database.cleanup().await; } +/// A revision read finds the Proposal that wrote each revision on its page +/// by target record and revision, so the Proposal results table carries an +/// index in that order, and the managed catalog names it when it is missing. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn proposal_results_catalog_localizes_its_target_revision_index() { + let registry = compiled_action_registry(); + let database = TestDatabase::create(1).await; + let (migration, migration_task) = database.connect_migration().await; + install_compiled_schema(&migration, ®istry, &database.runtime_role) + .await + .expect("the Action-bearing Registry installs its exact catalog"); + let catalog = ExpectedManagedCatalog::compiled(®istry); + + let definition: Option = database + .admin + .query_opt( + "SELECT pg_catalog.pg_get_indexdef(c.oid) + FROM pg_catalog.pg_class c + JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace + WHERE n.nspname = 'registry_internal' + AND c.relname = 'registry_proposal_results_by_target'", + &[], + ) + .await + .expect("the test administrator reads the index catalog") + .map(|row| row.get(0)); + assert_eq!( + definition.as_deref(), + Some( + "CREATE INDEX registry_proposal_results_by_target \ + ON registry_internal.registry_proposal_results \ + USING btree (target_entity_id, target_record_id, target_revision)" + ), + "the Proposal results table is indexed by target record and revision" + ); + assert_eq!( + catalog_drift_objects(&database.admin, ®istry, &catalog) + .await + .unwrap(), + Vec::::new(), + "a pristine catalog with the Proposal results index has no named drift" + ); + database + .admin + .batch_execute( + "BEGIN; + DROP INDEX registry_internal.registry_proposal_results_by_target", + ) + .await + .expect("the test administrator removes the Proposal results index"); + let named_drift = catalog_drift_objects(&database.admin, ®istry, &catalog) + .await + .unwrap(); + database + .admin + .batch_execute("ROLLBACK") + .await + .expect("the test administrator restores the Proposal results index"); + assert_eq!( + named_drift, + ["registry_internal.registry_proposal_results_by_target".to_owned()] + ); + + migration_task.abort(); + database.cleanup().await; +} + /// The source view is not a barrier view, so the planner flattens it and may /// evaluate a caller predicate before the lifecycle condition of the view. /// Row security does not rest on that order: PostgreSQL applies the policies diff --git a/crates/registry-breg/tests/postgres_package/compiler_upgrade.rs b/crates/registry-breg/tests/postgres_package/compiler_upgrade.rs index d8c845f7f0..bd801d666a 100644 --- a/crates/registry-breg/tests/postgres_package/compiler_upgrade.rs +++ b/crates/registry-breg/tests/postgres_package/compiler_upgrade.rs @@ -11,6 +11,87 @@ const OTHER_SOURCE_VIEW: &str = "entity.second-record.source-view"; const CURRENT_VIEW_OPTIONS: &str = "WITH (security_invoker=true)"; const EARLIER_VIEW_OPTIONS: &str = "WITH (security_invoker=true, security_barrier=true)"; +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn adding_only_a_record_attachment_slot_applies_without_ddl() { + let database = TestDatabase::create(1).await; + let module_bytes = indexed_module_bytes(OtherEntity::Unchanged); + let mut initial_request = indexed_request(module_bytes.clone()); + let provisional = prepare_package(initial_request.clone()).expect("initial package prepares"); + initial_request.schema_fingerprint = + measure_fresh_compiled_schema(&database, provisional.registry()).await; + let (initial_root, initial) = publish_and_load(initial_request); + let active = apply_package( + &database, + &initial, + ApplyPrecondition::InitialActivation, + Duration::from_secs(5), + Duration::from_secs(5), + ) + .await + .expect("initial package applies"); + let predecessor = load_predecessor_package(initial_root.path(), &local_context()) + .expect("active package is a readable predecessor"); + + let mut module: Value = serde_json::from_slice(&module_bytes).expect("module is JSON"); + module["recordTypes"]["neutral-record"]["attachments"] = json!([{ + "id": "evidence", + "maximumBytes": 4096, + "contentTypes": ["application/pdf"], + "classification": "restricted", + "writeOnce": true + }]); + let mut request = indexed_request(serde_json::to_vec(&module).expect("module serializes")); + request.from_package_digest = Some(active.package_digest.clone()); + request + .schema_fingerprint + .clone_from(&active.schema_fingerprint); + request.migration_plan = PackageMigrationPlanInput::SuccessorFromBaseline { + prior_baseline: Box::new(predecessor.migration_baseline().clone()), + }; + let (successor_root, successor) = publish_and_load(request); + let plan = &successor.manifest().migration_plan; + let [addition] = plan.changes.as_slice() else { + panic!("expected one change, the attachment slot addition"); + }; + assert_eq!( + addition.class, + CompiledRegistryChangeClass::CompatibleAdditive + ); + assert_eq!( + addition.code, + CompiledRegistryChangeCode::RecordAttachmentSlotAdded + ); + assert!(plan.statements.is_empty()); + assert!(plan.reviewed_descriptors.is_empty()); + + let upgraded = apply_package( + &database, + &successor, + ApplyPrecondition::Successor { current: &active }, + Duration::from_secs(5), + Duration::from_secs(5), + ) + .await + .expect("an attachment slot alone applies without SQL"); + assert_eq!(upgraded.schema_fingerprint, active.schema_fingerprint); + let ledger = database + .admin + .query_one( + "SELECT migration_kind, statement_checksums FROM registry_internal.registry_migrations + WHERE activation_id = $1::text::uuid", + &[&upgraded.activation_id], + ) + .await + .expect("the successor has an activation ledger entry"); + assert_eq!(ledger.get::<_, String>(0), "metadata-only"); + assert!(ledger.get::<_, Vec>(1).is_empty()); + assert!(successor.registry().entities()["neutral-record"] + .attachments + .contains_key("evidence")); + assert_startup(&database, &successor_root, &successor).await; + database.cleanup().await; +} + #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn an_unchanged_successor_over_an_earlier_compilers_package_refreshes_compiler_owned_ddl_once( ) { diff --git a/crates/registry-breg/tests/postgres_proposal_s3.rs b/crates/registry-breg/tests/postgres_proposal_s3.rs index d57d22988f..e6513a8424 100644 --- a/crates/registry-breg/tests/postgres_proposal_s3.rs +++ b/crates/registry-breg/tests/postgres_proposal_s3.rs @@ -15,6 +15,8 @@ use axum::{ response::{IntoResponse, Response}, Router, }; +use base64::Engine as _; +use registry_breg::mutation::MutationFaultPoint; use registry_breg::{ api::{VerifiedClaimValue, VerifiedRequestClaims}, attachment_storage::AttachmentStorage, @@ -27,6 +29,7 @@ use registry_breg_client::{ BRegRecordFormat, }; use serde_json::{json, Map, Value}; +use sha2::Digest as _; use std::{ collections::{BTreeMap, BTreeSet}, path::Path, @@ -85,12 +88,68 @@ fn registry_source(automatic: bool) -> Value { } fn compile(source: Value) -> registry_breg::CompiledRegistry { let project = parse_project_json(&serde_json::to_vec(&source).unwrap()).unwrap(); - compile_project(&project, &[], CompileProfile::Authoring).expect("standalone Proposal compiles") + compile_project(&project, &[], CompileProfile::Authoring).expect("standalone registry compiles") } fn registry(automatic: bool) -> registry_breg::CompiledRegistry { compile(registry_source(automatic)) } +fn immediate_action_registry() -> registry_breg::CompiledRegistry { + compile(json!({ + "apiVersion":"id.registrystack.org/formats/breg/project/v1alpha1","kind":"BRegProject", + "project":{"id":"proposal-test","version":"1","defaultLanguage":"en", + "canonicalBaseIri":"https://proposal.example.test"}, + "datasets":{"directory": {}}, + "recordTypes":{"application":{"primaryDataset":"directory","route":"applications", + "mutationMode":"mutable","fields":[ + {"id":"name","type":"string","required":true,"maximumLength":64, + "classification":"internal"}], + "attachments":[{"id":"evidence","maximumBytes":4096, + "contentTypes":["text/plain"],"classification":"restricted","writeOnce":true}]}}, + "actions":{"register":{"execution":{"mode":"immediate"},"inputs":[ + {"id":"name","type":"string","required":true,"maximumLength":64, + "classification":"internal"}], + "plan":{"type":"fixed","effects":[{"id":"application", + "target":{"recordType":"application"},"operation":"create", + "set":{"name":{"fromInput":"name"}}, + "attachments":{"evidence":{"fromAttachment":"evidence"}}}]}}}, + "accessProfiles":{"clerk":{"default":true,"principalClaim":"sub", + "requiredScopes":["proposal:manage"],"requiredPurposes":["registry-administration"], + "permissions":{"actions":[{"action":"register","operations":["invoke"], + "results":["application"],"targets":[{"recordType":"application", + "rowBoundaries":"unrestricted"}]}]}}} + })) +} + +fn immediate_action_body() -> Value { + let bytes = b"synthetic-immediate-action-file"; + json!({ + "input":{"name":"Example application"}, + "attachments":{"evidence":{ + "contentType":"text/plain", + "sha256":hex::encode(sha2::Sha256::digest(bytes)), + "content":base64::engine::general_purpose::STANDARD.encode(bytes) + }} + }) +} + +async fn invoke_immediate_action( + client: &client_http::ClientHttp, + idempotency_key: &str, +) -> (StatusCode, Value) { + let response = reqwest::Client::new() + .post(format!("{}/v1/actions/register", client.base_url)) + .header("content-type", "application/json") + .header("idempotency-key", idempotency_key) + .body(serde_json::to_vec(&immediate_action_body()).unwrap()) + .send() + .await + .unwrap(); + let status = response.status(); + let body = response.json().await.unwrap(); + (status, body) +} + async fn start( fixture: &client_http::ClientFixture, value: &str, @@ -502,6 +561,82 @@ async fn s3_put_get_remove_and_exact_replay_without_storage_requests() { fixture.finish().await; } +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn immediate_action_s3_rollback_retry_and_exact_replay_converge() { + let s3 = S3Fixture::new().await; + let storage = s3.storage.clone(); + let fixture = client_http::ClientFixture::start_with_mutations( + immediate_action_registry(), + claims("synthetic-author", "zone-a"), + move |mutations| mutations.with_attachment_storage(storage), + ) + .await; + let faulted = fixture + .client_with_mutations( + claims("synthetic-author", "zone-a"), + (*fixture.mutations) + .clone() + .with_fault_for_test(MutationFaultPoint::BeforeCommit), + ) + .await; + + let (status, _) = invoke_immediate_action(&faulted, "immediate-s3-recovery").await; + assert_eq!(status, StatusCode::SERVICE_UNAVAILABLE); + assert_eq!(s3.state.puts.load(Ordering::SeqCst), 1); + let row = fixture + .database + .admin + .query_one( + "SELECT state, + (SELECT count(*) FROM registry_internal.registry_record_attachments) + FROM registry_internal.registry_attachment_blobs", + &[], + ) + .await + .unwrap(); + assert_eq!(row.get::<_, String>(0), "staged"); + assert_eq!(row.get::<_, i64>(1), 0); + assert_eq!(s3.state.bytes.lock().await.len(), 1); + + let (retry_status, retry) = + invoke_immediate_action(&fixture.http, "immediate-s3-recovery").await; + assert_eq!(retry_status, StatusCode::OK); + assert_eq!(s3.state.puts.load(Ordering::SeqCst), 2); + let application = &fixture.registry.entities()["application"]; + let row = fixture + .database + .admin + .query_one( + &format!( + "SELECT state, + (SELECT count(*) FROM registry_internal.registry_record_attachments + WHERE erased_at IS NULL), + (SELECT count(*) FROM registry_data.\"{}\") + FROM registry_internal.registry_attachment_blobs", + application.physical_table + ), + &[], + ) + .await + .unwrap(); + assert_eq!(row.get::<_, String>(0), "live"); + assert_eq!(row.get::<_, i64>(1), 1); + assert_eq!(row.get::<_, i64>(2), 1); + + let (replay_status, replay) = + invoke_immediate_action(&fixture.http, "immediate-s3-recovery").await; + assert_eq!(replay_status, StatusCode::OK); + assert_eq!(replay, retry, "the exact replay returns the first receipt"); + assert_eq!( + s3.state.puts.load(Ordering::SeqCst), + 2, + "the exact replay sends no second PUT after the committed retry" + ); + + drop(faulted); + fixture.finish().await; +} + /// An upload to a rejected Proposal answers 409 `proposal.rejected`, as it /// does with database storage, before any byte reaches S3. The review path to /// rejection is covered in `postgres_proposal`; this case marks the stored @@ -2066,3 +2201,334 @@ async fn a_pending_verdict_without_a_running_job_holds_back_worker_success() { assert!(pass.last_success().age().is_some()); fixture.finish().await; } + +/// Sets the verdict on the verified `bytes` under the configured policy. +async fn set_verdict(fixture: &client_http::ClientFixture, bytes: &[u8], verdict: &str) { + let changed = fixture + .database + .admin + .execute( + "UPDATE registry_internal.registry_attachment_verification SET verdict = $2 + WHERE sha256 = encode(sha256($1::bytea), 'hex')", + &[&bytes, &verdict], + ) + .await + .unwrap(); + assert_eq!(changed, 1); +} + +/// Live record references as `(record, slot, sha256)`. +async fn promoted_references( + fixture: &client_http::ClientFixture, +) -> BTreeSet<(uuid::Uuid, String, String)> { + fixture + .database + .admin + .query( + "SELECT record_id, slot_id, sha256 + FROM registry_internal.registry_record_attachments WHERE erased_at IS NULL", + &[], + ) + .await + .unwrap() + .iter() + .map(|row| (row.get(0), row.get(1), row.get(2))) + .collect() +} + +/// A promoted Proposal file reaches the record as a reference to the S3 +/// object the Proposal stored. The apply writes nothing to S3, the record +/// download reads that object, and Proposal erasure leaves it in place. A +/// file whose verdict turned pending or rejected after submission refuses +/// the apply with 412 `precondition.failed`, and nothing is promoted. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn promotion_references_the_verified_s3_object_and_refuses_unverified_bytes() { + use registry_breg_client::BRegProblemCode; + use sha2::{Digest, Sha256}; + const BYTES: &[u8] = b"promoted-exact-bytes"; + let s3 = S3Fixture::new().await; + let storage = s3.storage.clone(); + let verification = s3.config.activate_attachment_verification().unwrap(); + let configured_verification = verification.clone(); + let mut source = registry_source(false); + source["recordTypes"]["target"]["attachments"] = json!([{"id":"evidence","maximumBytes":4096, + "contentTypes":["text/plain"],"classification":"restricted","writeOnce":true}]); + source["accessProfiles"]["clerk"]["permissions"]["records"][0]["readableAttachments"] = + json!(["evidence"]); + source["actions"]["correct-name"]["plan"]["effects"][0]["attachments"] = + json!({"evidence":{"fromAttachment":"support"}}); + // Record reads use the same S3 storage, as startup configures them. + let fixture = client_http::ClientFixture::start_with_attachment_storage( + compile(source), + claims("synthetic-author", "zone-a"), + storage, + move |mutations| mutations.with_attachment_verification(configured_verification), + ) + .await; + let (audit, _capture) = + registry_breg::audit::test_support::capturing(verification_audit_profile()); + let worker = verification_worker(&fixture, &s3, &verification, &audit); + let client = &fixture.http.client; + let draft = start(&fixture, "After", "promotion-start").await; + let uploaded = client + .upload_proposal_attachment( + &draft, + "support", + "text/plain", + BYTES, + &key("promotion-upload"), + ) + .await + .unwrap() + .value; + assert!(worker.run_once().await.unwrap()); + let uploaded = client.read_proposal(&uploaded).await.unwrap().value; + let submit = client + .prepare_proposal(&uploaded, "submit", json!({}), &key("promotion-submit")) + .unwrap(); + let submitted = client.execute_proposal(&submit).await.unwrap().value; + let target: uuid::Uuid = fixture + .database + .admin + .query_one( + "SELECT DISTINCT record_id FROM registry_internal.registry_revisions", + &[], + ) + .await + .unwrap() + .get(0); + let blobs = || async { + fixture + .database + .admin + .query_one( + "SELECT count(*) FROM registry_internal.registry_attachment_blobs", + &[], + ) + .await + .unwrap() + .get::<_, i64>(0) + }; + assert_eq!(blobs().await, 1); + let puts = s3.state.puts.load(Ordering::SeqCst); + assert_eq!(puts, 1); + + for verdict in ["rejected", "pending"] { + set_verdict(&fixture, BYTES, verdict).await; + let apply = client + .prepare_proposal( + &submitted, + "apply", + json!({"submissionVersion":1,"effectDigest":submitted.effect_digest().unwrap(), + "reason":"promotion-reason"}), + &key(&format!("promotion-apply-{verdict}")), + ) + .unwrap(); + let refused = client + .execute_proposal(&apply) + .await + .expect_err("a file without an approved verdict is not promoted"); + assert_eq!(refused.status(), Some(412), "{verdict}"); + assert_eq!( + refused.problem_code(), + Some(BRegProblemCode::PreconditionFailed), + "{verdict}" + ); + assert!(promoted_references(&fixture).await.is_empty(), "{verdict}"); + } + + set_verdict(&fixture, BYTES, "approved").await; + let apply = client + .prepare_proposal( + &submitted, + "apply", + json!({"submissionVersion":1,"effectDigest":submitted.effect_digest().unwrap(), + "reason":"promotion-reason"}), + &key("promotion-apply-approved"), + ) + .unwrap(); + let applied = client.execute_proposal(&apply).await.unwrap().value; + let sha256 = hex::encode(Sha256::digest(BYTES)); + assert_eq!( + promoted_references(&fixture).await, + BTreeSet::from([(target, "evidence".to_owned(), sha256.clone())]) + ); + assert_eq!(blobs().await, 1, "the record refers to the Proposal's blob"); + assert_eq!( + s3.state.puts.load(Ordering::SeqCst), + puts, + "promotion copies nothing" + ); + let read_record = || async { + client + .download_record_attachment("targets", &target.to_string(), "evidence", Some("clerk")) + .await + .unwrap() + .value + }; + assert_eq!(read_record().await.as_bytes(), BYTES); + + let erased = cleanup(&fixture, s3.storage.clone()) + .with_verification_policy_for_test(verification.binding_digest()) + .erase( + registry_breg::proposal_retention::ProposalDetailErasureScope { + action_id: "correct-name", + proposal_id: uuid::Uuid::parse_str(applied.id()).unwrap(), + submission_version: 1, + }, + ) + .await + .unwrap(); + assert_eq!(erased.pending_external_deletions, 0); + let cleaned = cleanup(&fixture, s3.storage.clone()) + .with_verification_policy_for_test(verification.binding_digest()) + .cleanup_attachments() + .await + .unwrap(); + assert_eq!(cleaned.pending_external_deletions, 0); + assert_eq!(s3.state.deletes.load(Ordering::SeqCst), 0); + assert_eq!(s3.state.bytes.lock().await.len(), 1); + assert_eq!(blobs().await, 1); + assert_eq!(read_record().await.as_bytes(), BYTES); + fixture.finish().await; +} + +/// Apply checks the verdict when it rebuilds the file manifest, then writes +/// its effects, then promotes. A verdict that turns to rejected after the +/// manifest check is still caught: the promotion rechecks the frozen file +/// under the content-hash lock inside the apply transaction. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn promotion_rechecks_a_verdict_rejected_after_the_manifest_check() { + use registry_breg_client::BRegProblemCode; + const BYTES: &[u8] = b"promoted-recheck-bytes"; + const PAUSE: i64 = 732_995_221; + let s3 = S3Fixture::new().await; + let verification = s3.config.activate_attachment_verification().unwrap(); + let configured_verification = verification.clone(); + let mut source = registry_source(false); + source["recordTypes"]["target"]["attachments"] = json!([{"id":"evidence","maximumBytes":4096, + "contentTypes":["text/plain"],"classification":"restricted","writeOnce":true}]); + source["accessProfiles"]["clerk"]["permissions"]["records"][0]["readableAttachments"] = + json!(["evidence"]); + source["actions"]["correct-name"]["plan"]["effects"][0]["attachments"] = + json!({"evidence":{"fromAttachment":"support"}}); + let fixture = client_http::ClientFixture::start_with_attachment_storage( + compile(source), + claims("synthetic-author", "zone-a"), + s3.storage.clone(), + move |mutations| mutations.with_attachment_verification(configured_verification), + ) + .await; + let (audit, _capture) = + registry_breg::audit::test_support::capturing(verification_audit_profile()); + let worker = verification_worker(&fixture, &s3, &verification, &audit); + let client = &fixture.http.client; + let draft = start(&fixture, "After", "recheck-start").await; + let uploaded = client + .upload_proposal_attachment( + &draft, + "support", + "text/plain", + BYTES, + &key("recheck-upload"), + ) + .await + .unwrap() + .value; + assert!(worker.run_once().await.unwrap()); + let uploaded = client.read_proposal(&uploaded).await.unwrap().value; + let submit = client + .prepare_proposal(&uploaded, "submit", json!({}), &key("recheck-submit")) + .unwrap(); + let submitted = client.execute_proposal(&submit).await.unwrap().value; + let revisions = || async { + fixture + .database + .admin + .query_one( + "SELECT count(*) FROM registry_internal.registry_revisions", + &[], + ) + .await + .unwrap() + .get::<_, i64>(0) + }; + let revisions_before = revisions().await; + + // The patch effect waits on an advisory lock this test holds, after the + // manifest check has passed and before the promotion runs. + let table = &fixture.registry.entities()["target"].physical_table; + fixture + .database + .admin + .batch_execute(&format!( + "CREATE FUNCTION registry_data.pause_promotion_effect() RETURNS trigger + LANGUAGE plpgsql AS $body$ + BEGIN + PERFORM set_config('lock_timeout','10s',true); + PERFORM pg_advisory_xact_lock({PAUSE}); + RETURN NEW; + END $body$; + CREATE TRIGGER pause_promotion_effect BEFORE UPDATE ON registry_data.\"{table}\" + FOR EACH ROW EXECUTE FUNCTION registry_data.pause_promotion_effect()" + )) + .await + .unwrap(); + let (barrier, barrier_task) = fixture.database.connect_migration().await; + barrier + .execute("SELECT pg_advisory_lock($1)", &[&PAUSE]) + .await + .unwrap(); + let apply = client + .prepare_proposal( + &submitted, + "apply", + json!({"submissionVersion":1,"effectDigest":submitted.effect_digest().unwrap(), + "reason":"promotion-reason"}), + &key("recheck-apply"), + ) + .unwrap(); + let reject_while_paused = async { + tokio::time::timeout(Duration::from_secs(5), async { + loop { + let waiting: i64 = fixture + .database + .admin + .query_one( + "SELECT count(*) FROM pg_locks WHERE locktype='advisory' AND NOT granted + AND database=(SELECT oid FROM pg_database WHERE datname=current_database())", + &[], + ) + .await + .unwrap() + .get(0); + if waiting != 0 { + break; + } + tokio::time::sleep(Duration::from_millis(10)).await; + } + }) + .await + .expect("Apply reached the effect after its manifest check"); + set_verdict(&fixture, BYTES, "rejected").await; + barrier + .execute("SELECT pg_advisory_unlock($1)", &[&PAUSE]) + .await + .unwrap(); + }; + let (refused, ()) = tokio::join!(client.execute_proposal(&apply), reject_while_paused); + barrier_task.abort(); + let refused = refused.expect_err("a file rejected during apply is not promoted"); + assert_eq!(refused.status(), Some(412)); + assert_eq!( + refused.problem_code(), + Some(BRegProblemCode::PreconditionFailed) + ); + assert!(promoted_references(&fixture).await.is_empty()); + assert_eq!( + revisions().await, + revisions_before, + "the refused promotion rolls back the effect" + ); + fixture.finish().await; +} diff --git a/crates/registry-breg/tests/postgres_proposal_security.rs b/crates/registry-breg/tests/postgres_proposal_security.rs index dfaf8f93fb..8a0b1185d5 100644 --- a/crates/registry-breg/tests/postgres_proposal_security.rs +++ b/crates/registry-breg/tests/postgres_proposal_security.rs @@ -2542,3 +2542,575 @@ async fn frozen_changes_inspection_covers_patch_and_create_without_applying_or_r assert!(!concealed.to_string().contains("Computed frozen")); fixture.finish().await; } + +fn caller(subject: &str) -> VerifiedRequestClaims { + caller_in(subject, "zone-a") +} + +fn caller_in(subject: &str, jurisdiction: &str) -> VerifiedRequestClaims { + VerifiedRequestClaims::authenticated( + "registry_principal", + subject, + BTreeSet::from(["proposal:manage".into()]), + Some("registry-administration".into()), + BTreeMap::from([( + "jurisdiction".into(), + VerifiedClaimValue::direct_string(jurisdiction).unwrap(), + )]), + ) + .unwrap() +} + +/// The Proposal source plus record history, an immediate Action and a profile +/// that reads history but holds no Proposal grant. +fn link_source() -> Value { + let boundary = json!([{"field":"jurisdiction","claim":"jurisdiction","operator":"equals"}]); + let mut project = source(false); + let clerk = &mut project["accessProfiles"]["clerk"]["permissions"]; + clerk["records"][0]["operations"] = json!(["create", "get", "revisions"]); + clerk["records"][0]["revisionAccess"] = json!(true); + clerk["records"][2]["operations"] = json!(["create", "get", "revisions"]); + clerk["records"][2]["revisionAccess"] = json!(true); + clerk["actions"].as_array_mut().unwrap().push( + json!({"action":"rename-organization","operations":["invoke"], + "targets":[{"recordType":"organization","rowBoundaries":"unrestricted"}]}), + ); + clerk["proposals"][0]["operations"] + .as_array_mut() + .unwrap() + .push(json!("apply")); + project["actions"]["rename-organization"] = json!({"execution":{"mode":"immediate"}, + "inputs":[{"id":"organization","type":"reference","target":"organization","required":true,"classification":"internal"}, + {"id":"value","type":"string","required":true,"maximumLength":64,"classification":"internal"}], + "plan":{"type":"fixed","effects":[{"id":"rename","target":{"fromInput":"organization"}, + "operation":"patch","set":{"name":{"fromInput":"value"}}}]}}); + project["accessProfiles"]["history-only"] = json!({"principalClaim":"registry_principal", + "requiredScopes":["proposal:manage"],"requiredPurposes":["registry-administration"], + "permissions":{"records":[ + {"recordType":"target","operations":["revisions"],"revisionAccess":true, + "readableFields":["name","jurisdiction","organization"],"rowBoundaries":boundary}]}}); + project +} + +/// One organization renamed by an immediate Action, and one target whose +/// name changed through an applied Proposal. Returns (organization, target, +/// Proposal id). +async fn linked_history(fixture: &client_http::ClientFixture) -> (String, String, String) { + let (organization, target) = seed(fixture).await; + let (code, condition, _) = send( + &fixture.http, + Method::POST, + "/v1/actions/rename-organization/target-conditions?accessProfile=clerk", + json!({"input":{"organization":organization}}), + None, + None, + ) + .await; + assert_eq!(code, StatusCode::OK, "{condition}"); + let (code, renamed, _) = send( + &fixture.http, + Method::POST, + "/v1/actions/rename-organization?accessProfile=clerk", + json!({"input":{"organization":organization,"value":"Renamed"}, + "preconditions":condition["preconditions"]}), + Some("rename-organization"), + None, + ) + .await; + assert_eq!(code, StatusCode::OK, "{renamed}"); + let (code, draft, etag) = send( + &fixture.http, + Method::POST, + "/v1/actions/correct-name/proposals?accessProfile=clerk", + json!({"input":{"target":target,"value":"After"}}), + Some("link-start"), + None, + ) + .await; + assert_eq!(code, StatusCode::CREATED, "{draft}"); + let id = draft["id"].as_str().unwrap().to_owned(); + let (code, submitted, etag) = send( + &fixture.http, + Method::POST, + &format!("/v1/proposals/{id}/submit?accessProfile=clerk"), + json!({}), + Some("link-submit"), + etag.as_deref(), + ) + .await; + assert_eq!(code, StatusCode::OK, "{submitted}"); + let (code, applied, _) = send( + &fixture.http, + Method::POST, + &format!("/v1/proposals/{id}/apply?accessProfile=clerk"), + json!({"submissionVersion":submitted["submissionVersion"], + "effectDigest":submitted["effectDigest"]}), + Some("link-apply"), + etag.as_deref(), + ) + .await; + assert_eq!(code, StatusCode::OK, "{applied}"); + (organization, target, id) +} + +async fn history( + http: &client_http::ClientHttp, + route: &str, + record: &str, + profile: &str, +) -> Value { + let (code, value, _) = send( + http, + Method::GET, + &format!("/v1/records/{route}/{record}/revisions?accessProfile={profile}"), + Value::Null, + None, + None, + ) + .await; + assert_eq!(code, StatusCode::OK, "{value}"); + value +} + +fn proposal_member(id: &str) -> Value { + json!({"actionId":"correct-name","proposalId":id,"submissionVersion":1}) +} + +/// The response status and the exact body bytes, for byte comparisons. +async fn raw_get(http: &client_http::ClientHttp, path: &str) -> (StatusCode, String) { + let response = reqwest::Client::new() + .get(format!("{}{path}", http.base_url)) + .send() + .await + .unwrap(); + (response.status(), response.text().await.unwrap()) +} + +/// The revision paths a link appears on: the history list and the +/// single-revision read of the revision the Proposal wrote. +fn linked_paths(target: &str, profile: &str) -> [String; 2] { + [ + format!("/v1/records/targets/{target}/revisions?accessProfile={profile}"), + format!("/v1/records/targets/{target}/revisions/2?accessProfile={profile}"), + ] +} + +async fn assert_no_link(http: &client_http::ClientHttp, target: &str, profile: &str) { + for path in linked_paths(target, profile) { + let (code, value, _) = send(http, Method::GET, &path, Value::Null, None, None).await; + assert_eq!(code, StatusCode::OK, "{path}: {value}"); + assert!( + !value.to_string().contains("\"proposal\":"), + "{path}: {value}" + ); + } +} + +async fn assert_link(http: &client_http::ClientHttp, target: &str, profile: &str, id: &str) { + let [list, single] = linked_paths(target, profile); + let (code, value, _) = send(http, Method::GET, &list, Value::Null, None, None).await; + assert_eq!(code, StatusCode::OK, "{value}"); + assert_eq!( + value["items"][0]["proposal"], + proposal_member(id), + "{value}" + ); + let (code, value, _) = send(http, Method::GET, &single, Value::Null, None, None).await; + assert_eq!(code, StatusCode::OK, "{value}"); + assert_eq!(value["data"]["proposal"], proposal_member(id), "{value}"); +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn record_history_names_the_proposal_for_a_caller_who_can_read_it() { + let fixture = client_http::ClientFixture::start(compile(link_source()), clerk()).await; + let (_, target, id) = linked_history(&fixture).await; + let list = history(&fixture.http, "targets", &target, "clerk").await; + let items = list["items"].as_array().unwrap(); + assert_eq!(items.len(), 2, "{list}"); + assert_eq!(items[0]["revisionIdentifier"], "2"); + assert_eq!(items[0]["proposal"], proposal_member(&id), "{list}"); + assert!(items[1].get("proposal").is_none(), "{list}"); + let (code, detail, _) = send( + &fixture.http, + Method::GET, + &format!("/v1/records/targets/{target}/revisions/2?accessProfile=clerk"), + Value::Null, + None, + None, + ) + .await; + assert_eq!(code, StatusCode::OK, "{detail}"); + assert_eq!(detail["data"]["proposal"], proposal_member(&id), "{detail}"); + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn record_history_links_proposals_over_a_single_connection_pool() { + let fixture = + client_http::ClientFixture::start_with_pool(compile(link_source()), clerk(), 1, |m| m) + .await; + let (_, target, id) = linked_history(&fixture).await; + let list = history(&fixture.http, "targets", &target, "clerk").await; + assert_eq!( + list["items"][0]["proposal"], + proposal_member(&id), + "the record connection is back in the pool before the link check: {list}" + ); + let (code, detail, _) = send( + &fixture.http, + Method::GET, + &format!("/v1/records/targets/{target}/revisions/2?accessProfile=clerk"), + Value::Null, + None, + None, + ) + .await; + assert_eq!(code, StatusCode::OK, "{detail}"); + assert_eq!(detail["data"]["proposal"], proposal_member(&id), "{detail}"); + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn record_history_omits_the_proposal_from_a_profile_without_a_proposal_grant() { + let fixture = client_http::ClientFixture::start(compile(link_source()), clerk()).await; + let (_, target, id) = linked_history(&fixture).await; + let with_link = history(&fixture.http, "targets", &target, "clerk").await; + assert_eq!( + with_link["items"][0]["proposal"], + proposal_member(&id), + "the same fixture names the Proposal to a caller who can read it: {with_link}" + ); + let without = history(&fixture.http, "targets", &target, "history-only").await; + let mut expected = with_link["items"].clone(); + for item in expected.as_array_mut().unwrap() { + item.as_object_mut().unwrap().remove("proposal"); + } + assert_eq!( + without["items"], expected, + "a profile that cannot read the Proposal sees exactly the unlinked history" + ); + assert_no_link(&fixture.http, &target, "history-only").await; + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn record_history_omits_the_proposal_when_ownership_does_not_match() { + let fixture = client_http::ClientFixture::start(compile(link_source()), clerk()).await; + let (_, target, id) = linked_history(&fixture).await; + assert_link(&fixture.http, &target, "clerk", &id).await; + let other = fixture.client_for(caller("another-clerk")).await; + let list = history(&other, "targets", &target, "clerk").await; + assert_eq!(list["items"].as_array().unwrap().len(), 2, "{list}"); + assert_no_link(&other, &target, "clerk").await; + // The refused caller gets the exact bytes the owner gets, less the member. + let member = format!( + r#""proposal":{{"actionId":"correct-name","proposalId":"{id}","submissionVersion":1}}"# + ); + for path in linked_paths(&target, "clerk") { + let (code, linked) = raw_get(&fixture.http, &path).await; + assert_eq!(code, StatusCode::OK, "{linked}"); + let (code, unlinked) = raw_get(&other, &path).await; + assert_eq!(code, StatusCode::OK, "{unlinked}"); + assert_eq!(linked.matches(&member).count(), 1, "{path}: {linked}"); + let expected = if linked.contains(&format!(",{member}")) { + linked.replacen(&format!(",{member}"), "", 1) + } else { + linked.replacen(&format!("{member},"), "", 1) + }; + assert_eq!( + unlinked, expected, + "{path}: the omission is byte-identical to an unlinked revision" + ); + } + fixture.finish().await; +} + +/// The link source with a profile that reads every target's history and holds +/// a Proposal get grant bounded to the caller's jurisdiction. +fn row_boundary_link_source() -> Value { + let mut project = link_source(); + project["accessProfiles"]["auditor"] = json!({"principalClaim":"registry_principal", + "requiredScopes":["proposal:manage"],"requiredPurposes":["registry-administration"], + "permissions":{"records":[ + {"recordType":"target","operations":["get","revisions"],"revisionAccess":true, + "readableFields":["name","jurisdiction","organization"],"rowBoundaries":"unrestricted"}], + "proposals":[{"action":"correct-name","operations":["get"],"ownership":"caller", + "targets":[{"recordType":"target","rowBoundaries": + [{"field":"jurisdiction","claim":"jurisdiction","operator":"equals"}]}]}]}}); + project +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn record_history_omits_the_proposal_outside_the_proposal_row_boundary() { + let fixture = + client_http::ClientFixture::start(compile(row_boundary_link_source()), clerk()).await; + let (_, target, id) = linked_history(&fixture).await; + let inside = fixture.client_for(caller_in("author", "zone-a")).await; + assert_link(&inside, &target, "auditor", &id).await; + let outside = fixture.client_for(caller_in("author", "zone-b")).await; + let list = history(&outside, "targets", &target, "auditor").await; + assert_eq!( + list["items"].as_array().unwrap().len(), + 2, + "the record grant still shows the history: {list}" + ); + assert_no_link(&outside, &target, "auditor").await; + fixture.finish().await; +} + +/// The link source with the task-grant profile allowed to read target +/// history, so only the task-grant exclusion keeps the link from it. +fn task_grant_link_source() -> Value { + let mut project = link_source(); + let reader = &mut project["accessProfiles"]["task-reviewer"]["permissions"]["records"][0]; + reader["operations"] = json!(["get", "list", "revisions"]); + reader["revisionAccess"] = json!(true); + project +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn record_history_never_names_the_proposal_to_a_task_grant_caller() { + let status = Arc::new(Status { + active: AtomicBool::new(true), + calls: AtomicUsize::new(0), + }); + let checker = status.clone(); + let fixture = client_http::ClientFixture::start_with_mutations( + compile(task_grant_link_source()), + clerk(), + move |service| service.with_task_status(checker), + ) + .await; + let (_, target, id) = linked_history(&fixture).await; + assert_link(&fixture.http, &target, "clerk", &id).await; + let idp = MockIdp::start().await; + let auth = authenticator(&fixture.registry, &idp).await; + let agent = fixture + .client_for( + auth.authenticate(&idp.mint_token(token( + 9, + json!([ + {"collection":format!("proposal:{id}"),"operations":["get"]}, + {"collection":"targets","operations":["get","list","revisions"]} + ]), + ))) + .await + .unwrap(), + ) + .await; + let (code, proposal, _) = send( + &agent, + Method::GET, + &format!("/v1/proposals/{id}?accessProfile=task-reviewer"), + Value::Null, + None, + None, + ) + .await; + assert_eq!( + code, + StatusCode::OK, + "the task grant reads the Proposal itself: {proposal}" + ); + let list = history(&agent, "targets", &target, "task-reviewer").await; + assert_eq!(list["items"].as_array().unwrap().len(), 2, "{list}"); + assert_no_link(&agent, &target, "task-reviewer").await; + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn record_history_never_names_the_proposal_to_a_standing_agent() { + let fixture = client_http::ClientFixture::start(compile(link_source()), clerk()).await; + let (_, target, id) = linked_history(&fixture).await; + assert_link(&fixture.http, &target, "clerk", &id).await; + // The Proposal's own author acting as an agent without a task grant is a + // standing agent. Its profile still reads the history and owns the + // Proposal, so only the standing-agent ceiling keeps the link from it. + let agent = fixture + .client_for( + VerifiedRequestClaims::authenticated_with_actor_kind( + "registry_principal", + "author", + BTreeSet::from(["proposal:manage".into()]), + Some("registry-administration".into()), + BTreeMap::from([( + "jurisdiction".into(), + VerifiedClaimValue::direct_string("zone-a").unwrap(), + )]), + registry_platform_oidc::ActorKind::Agent, + ) + .unwrap(), + ) + .await; + let (code, proposal, _) = send( + &agent, + Method::GET, + &format!("/v1/proposals/{id}?accessProfile=clerk"), + Value::Null, + None, + None, + ) + .await; + assert_eq!( + code, + StatusCode::NOT_FOUND, + "a standing agent cannot read the Proposal itself: {proposal}" + ); + let list = history(&agent, "targets", &target, "clerk").await; + assert_eq!(list["items"].as_array().unwrap().len(), 2, "{list}"); + assert_no_link(&agent, &target, "clerk").await; + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn record_history_reads_the_link_while_another_session_locks_the_proposal_row() { + let fixture = client_http::ClientFixture::start(compile(link_source()), clerk()).await; + let (_, target, id) = linked_history(&fixture).await; + let (holder, holder_task) = fixture.database.connect_admin().await; + holder.batch_execute("BEGIN").await.unwrap(); + holder + .query_one( + "SELECT proposal_id FROM registry_internal.registry_proposal_state + WHERE proposal_id=$1 FOR UPDATE", + &[&uuid::Uuid::parse_str(&id).unwrap()], + ) + .await + .unwrap(); + assert_link(&fixture.http, &target, "clerk", &id).await; + holder.batch_execute("ROLLBACK").await.unwrap(); + drop(holder); + holder_task.await.unwrap(); + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn record_history_is_unavailable_when_the_proposal_link_check_fails() { + let fixture = client_http::ClientFixture::start(compile(link_source()), clerk()).await; + let (_, target, id) = linked_history(&fixture).await; + let (holder, holder_task) = fixture.database.connect_admin().await; + holder + .batch_execute( + "BEGIN; LOCK TABLE registry_internal.registry_proposal_state IN ACCESS EXCLUSIVE MODE", + ) + .await + .unwrap(); + for path in linked_paths(&target, "clerk") { + let (code, value, _) = + send(&fixture.http, Method::GET, &path, Value::Null, None, None).await; + assert_eq!( + code, + StatusCode::SERVICE_UNAVAILABLE, + "{path}: a failed link check fails the read instead of hiding the link: {value}" + ); + assert!(!value.to_string().contains("After"), "{path}: {value}"); + } + // A caller with no Proposal link access never reaches the locked table. + assert_no_link(&fixture.http, &target, "history-only").await; + holder.batch_execute("ROLLBACK").await.unwrap(); + drop(holder); + holder_task.await.unwrap(); + assert_link(&fixture.http, &target, "clerk", &id).await; + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn record_discovery_declares_the_proposal_link_only_to_a_caller_who_can_receive_it() { + let fixture = client_http::ClientFixture::start(compile(link_source()), clerk()).await; + let revision_operations = |profile: &'static str| { + let http = &fixture.http; + async move { + let (code, document, _) = send( + http, + Method::GET, + &format!("/openapi.json?accessProfile={profile}"), + Value::Null, + None, + None, + ) + .await; + assert_eq!(code, StatusCode::OK, "{profile}: {document}"); + let operations = document["paths"] + .as_object() + .unwrap() + .iter() + .filter(|(path, _)| path.starts_with("/v1/records/targets/")) + .filter(|(path, _)| path.contains("/revisions")) + .map(|(path, item)| (path.clone(), item["get"].to_string())) + .collect::>(); + assert_eq!(operations.len(), 2, "{profile}: {document}"); + operations + } + }; + for (path, operation) in revision_operations("clerk").await { + assert!( + operation.contains("\"proposal\":"), + "{path}: a caller who receives the link sees it declared: {operation}" + ); + } + for (path, operation) in revision_operations("history-only").await { + assert!( + !operation.contains("\"proposal\":"), + "{path}: a caller without Proposal link access never sees it declared: {operation}" + ); + } + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn record_history_has_no_proposal_on_immediate_action_revisions() { + let fixture = client_http::ClientFixture::start(compile(link_source()), clerk()).await; + let (organization, _, _) = linked_history(&fixture).await; + let list = history(&fixture.http, "organizations", &organization, "clerk").await; + let items = list["items"].as_array().unwrap(); + assert_eq!(items.len(), 2, "{list}"); + assert_eq!(items[0]["domainData"]["name"], "Renamed", "{list}"); + assert!(!list.to_string().contains("\"proposal\":"), "{list}"); + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn record_history_keeps_the_proposal_after_operator_erasure() { + let fixture = client_http::ClientFixture::start(compile(link_source()), clerk()).await; + let (_, target, id) = linked_history(&fixture).await; + use registry_breg::postgres::{ExpectedManagedCatalog, RegistryLockKey}; + registry_breg::proposal_retention::ProposalRetentionOperatorService::new_for_test( + (*fixture.registry).clone(), + fixture.identity.clone(), + ExpectedManagedCatalog::compiled(&fixture.registry), + RegistryLockKey::derive(fixture.registry.registry_id()).unwrap(), + fixture.database.migration_config.clone(), + fixture.database.migration_role.clone(), + fixture.database.runtime_role.clone(), + fixture.database.activation_audit(), + ) + .with_attachment_storage_for_test( + registry_breg::attachment_storage::AttachmentStorage::Database, + ) + .erase( + registry_breg::proposal_retention::ProposalDetailErasureScope { + action_id: "correct-name", + proposal_id: uuid::Uuid::parse_str(&id).unwrap(), + submission_version: 1, + }, + ) + .await + .unwrap(); + let list = history(&fixture.http, "targets", &target, "clerk").await; + assert_eq!( + list["items"][0]["proposal"], + proposal_member(&id), + "the identifier and link survive erasure of the Proposal detail: {list}" + ); + let (code, proposal, _) = send( + &fixture.http, + Method::GET, + &format!("/v1/proposals/{id}?accessProfile=clerk"), + Value::Null, + None, + None, + ) + .await; + assert_eq!(code, StatusCode::OK, "{proposal}"); + assert_eq!(proposal["state"], "applied", "{proposal}"); + fixture.finish().await; +} diff --git a/crates/registry-breg/tests/postgres_record_attachments.rs b/crates/registry-breg/tests/postgres_record_attachments.rs new file mode 100644 index 0000000000..6345d4a989 --- /dev/null +++ b/crates/registry-breg/tests/postgres_record_attachments.rs @@ -0,0 +1,2983 @@ +// SPDX-License-Identifier: Apache-2.0 +//! Record attachment slots: an immediate Action create writes one file with +//! its record, a granted profile reads it inside its row boundary, and +//! retention removes references before it removes bytes. +#![cfg(feature = "postgres-test")] +#[path = "support/client_http.rs"] +#[allow(dead_code)] +mod client_http; +#[path = "support/postgres_harness.rs"] +#[allow(dead_code)] +mod postgres_harness; + +use axum::body::{to_bytes, Body}; +use axum::http::{HeaderMap, Request, StatusCode}; +use base64::Engine as _; +use registry_breg::api::{VerifiedClaimValue, VerifiedRequestClaims}; +use registry_breg::compiler::{compile_project, CompileProfile}; +use registry_breg::contract::parse_project_json; +use registry_breg::field_encryption_backfill::{ + erase_field_encryption_history, FieldEncryptionHistoryErasureRequest, +}; +use registry_breg::history_erasure::{ + erase_record_history, HistoryErasureError, HistoryErasureOutcome, HistoryErasureRequest, + HistoryErasureTimeouts, RecordHistoryErasureTarget, +}; +use registry_breg::mutation::{MutationError, MutationFaultPoint}; +use registry_breg::postgres::RegistryLockKey; +use registry_breg_client::{ + BRegCreateRequest, BRegDirectWrite, BRegIdempotencyKey, BRegProposalState, BRegRecordFormat, +}; +use registry_platform_audit::AuditProfile; +use serde_json::{json, Value}; +use sha2::Digest as _; +use std::collections::{BTreeMap, BTreeSet}; +use std::time::Duration; +use tower::util::ServiceExt as _; +use uuid::Uuid; + +const EVIDENCE: &[u8] = b"synthetic-evidence"; +const FILE_CANARY: &[u8] = b"record-file-canary"; + +fn claims(subject: &str, jurisdiction: &str, scope: &str) -> VerifiedRequestClaims { + VerifiedRequestClaims::authenticated_with_actor_kind( + "sub", + subject, + BTreeSet::from([scope.to_owned()]), + Some("registry-administration".into()), + BTreeMap::from([( + "jurisdiction".into(), + VerifiedClaimValue::direct_string(jurisdiction).unwrap(), + )]), + registry_platform_oidc::ActorKind::Human, + ) + .unwrap() +} +fn clerk(jurisdiction: &str) -> VerifiedRequestClaims { + claims("clerk", jurisdiction, "application:manage") +} +fn key(value: &str) -> BRegIdempotencyKey { + BRegIdempotencyKey::parse(value).unwrap() +} +fn sha256_hex(bytes: &[u8]) -> String { + hex::encode(sha2::Sha256::digest(bytes)) +} +fn repr_digest(bytes: &[u8]) -> String { + format!( + "sha-256=:{}:", + base64::engine::general_purpose::STANDARD.encode(sha2::Sha256::digest(bytes)) + ) +} + +fn jurisdiction_boundary() -> Value { + json!([{"field":"jurisdiction","claim":"jurisdiction","operator":"equals"}]) +} + +fn record_source() -> Value { + json!({"apiVersion":"id.registrystack.org/formats/breg/project/v1alpha1","kind":"BRegProject", + "project":{"id":"record-attachment-test","version":"1","defaultLanguage":"en", + "canonicalBaseIri":"https://record-attachment.example.test"}, + "datasets":{"directory":{}}, + "recordTypes":{ + "programme":{"primaryDataset":"directory","route":"programmes","mutationMode":"mutable", + "fields":[{"id":"open","type":"boolean","required":true,"classification":"internal"}, + {"id":"jurisdiction","type":"string","required":true,"maximumLength":64,"classification":"internal"}]}, + "application":{"primaryDataset":"directory","route":"applications","mutationMode":"mutable", + "fields":[{"id":"name","type":"string","required":true,"maximumLength":64,"classification":"internal"}, + {"id":"jurisdiction","type":"string","required":true,"maximumLength":64,"classification":"internal"}, + {"id":"programme","type":"reference","target":"programme","required":true,"classification":"internal"}], + "attachments":[{"id":"evidence","maximumBytes":64,"contentTypes":["text/plain","application/pdf"], + "classification":"restricted","writeOnce":true}], + "hooks":[{"phase":"after","id":"application-created","trigger":"created","projection":["name"]}]}}, + "actions":{ + "register":{"execution":{"mode":"immediate"}, + "inputs":[{"id":"name","type":"string","required":true,"maximumLength":64,"classification":"internal"}, + {"id":"jurisdiction","type":"string","required":true,"maximumLength":64,"classification":"internal"}, + {"id":"programme","type":"reference","target":"programme","required":true,"classification":"internal"}], + "commitGuards":{"targets":[{"input":"programme","field":"open","equals":true}]}, + "plan":{"type":"fixed","effects":[{"id":"application","target":{"recordType":"application"}, + "operation":"create","set":{"name":{"fromInput":"name"},"jurisdiction":{"fromInput":"jurisdiction"}, + "programme":{"fromInput":"programme"}}, + "attachments":{"evidence":{"fromAttachment":"evidence"}}}]}}, + "rename":{"execution":{"mode":"proposal","proposal":{"review":{"type":"none"}, + "application":{"mode":"manual"},"retention":{"mode":"operator-erase"}, + "attachments":[{"id":"support","required":false,"maximumBytes":4096, + "contentTypes":["text/plain"],"classification":"restricted"}]}}, + "inputs":[{"id":"target","type":"reference","target":"application","required":true,"classification":"internal"}, + {"id":"value","type":"string","required":true,"maximumLength":64,"classification":"internal"}], + "commitGuards":{"targets":[{"input":"target","revision":"unchanged"}]}, + "plan":{"type":"fixed","effects":[{"id":"name","target":{"fromInput":"target"},"operation":"patch", + "set":{"name":{"fromInput":"value"}}}]}}, + // The built-in executor applies `enrol`, so its promotion runs on + // the automatic path. `note` is a Proposal file nothing promotes. + "enrol":{"execution":{"mode":"proposal","proposal":{"review":{"type":"none"}, + "application":{"mode":"automatic","maximumAttempts":3},"retention":{"mode":"operator-erase"}, + "attachments":[{"id":"document","required":false,"maximumBytes":64, + "contentTypes":["text/plain"],"classification":"restricted"}, + {"id":"note","required":false,"maximumBytes":64, + "contentTypes":["text/plain"],"classification":"restricted"}]}}, + "inputs":[{"id":"name","type":"string","required":true,"maximumLength":64,"classification":"internal"}, + {"id":"jurisdiction","type":"string","required":true,"maximumLength":64,"classification":"internal"}, + {"id":"programme","type":"reference","target":"programme","required":true,"classification":"internal"}], + "plan":{"type":"fixed","effects":[{"id":"application","target":{"recordType":"application"}, + "operation":"create","set":{"name":{"fromInput":"name"},"jurisdiction":{"fromInput":"jurisdiction"}, + "programme":{"fromInput":"programme"}}, + "attachments":{"evidence":{"fromAttachment":"document"}}}]}}, + // A caller applies `amend`. One file fills the slot of the record + // it creates and the slot of the record it updates. + "amend":{"execution":{"mode":"proposal","proposal":{"review":{"type":"none"}, + "application":{"mode":"manual"},"retention":{"mode":"operator-erase"}, + "attachments":[{"id":"document","required":true,"maximumBytes":64, + "contentTypes":["text/plain"],"classification":"restricted"}]}}, + "inputs":[{"id":"target","type":"reference","target":"application","required":true,"classification":"internal"}, + {"id":"name","type":"string","required":true,"maximumLength":64,"classification":"internal"}, + {"id":"jurisdiction","type":"string","required":true,"maximumLength":64,"classification":"internal"}, + {"id":"programme","type":"reference","target":"programme","required":true,"classification":"internal"}], + "commitGuards":{"targets":[{"input":"target","revision":"unchanged"}]}, + "plan":{"type":"fixed","effects":[ + {"id":"copy","target":{"recordType":"application"},"operation":"create", + "set":{"name":{"fromInput":"name"},"jurisdiction":{"fromInput":"jurisdiction"}, + "programme":{"fromInput":"programme"}}, + "attachments":{"evidence":{"fromAttachment":"document"}}}, + {"id":"original","target":{"fromInput":"target"},"operation":"patch", + "set":{"name":{"fromInput":"name"}}, + "attachments":{"evidence":{"fromAttachment":"document"}}}]}}}, + "accessProfiles":{ + "clerk":{"default":true,"principalClaim":"sub","requiredScopes":["application:manage"], + "requiredPurposes":["registry-administration"],"permissions":{ + "records":[{"recordType":"application","operations":["get","list"], + "readableFields":["name","jurisdiction","programme"],"readableAttachments":["evidence"], + "rowBoundaries":jurisdiction_boundary()}, + {"recordType":"programme","operations":["get","list"],"readableFields":["open","jurisdiction"], + "rowBoundaries":jurisdiction_boundary()}], + "actions":[{"action":"register","operations":["invoke"],"results":["application"],"targets":[ + {"recordType":"programme","rowBoundaries":jurisdiction_boundary()}, + {"recordType":"application","rowBoundaries":jurisdiction_boundary()}]}, + {"action":"rename","operations":["start"],"targets":[ + {"recordType":"application","rowBoundaries":jurisdiction_boundary()}]}, + {"action":"enrol","operations":["start"],"targets":[ + {"recordType":"programme","rowBoundaries":jurisdiction_boundary()}, + {"recordType":"application","rowBoundaries":jurisdiction_boundary()}]}, + {"action":"amend","operations":["start"],"targets":[ + {"recordType":"programme","rowBoundaries":jurisdiction_boundary()}, + {"recordType":"application","rowBoundaries":jurisdiction_boundary()}]}], + "proposals":[{"action":"rename","operations":["get","list","edit","submit","apply"], + "ownership":"caller","readableAttachments":["support"],"writableAttachments":["support"], + "targets":[{"recordType":"application","rowBoundaries":jurisdiction_boundary()}]}, + {"action":"enrol","operations":["get","list","edit","submit"], + "ownership":"caller","readableAttachments":["document","note"], + "writableAttachments":["document","note"],"targets":[ + {"recordType":"programme","rowBoundaries":jurisdiction_boundary()}, + {"recordType":"application","rowBoundaries":jurisdiction_boundary()}]}, + {"action":"amend","operations":["get","list","edit","submit","apply"], + "ownership":"caller","readableAttachments":["document"], + "writableAttachments":["document"],"targets":[ + {"recordType":"programme","rowBoundaries":jurisdiction_boundary()}, + {"recordType":"application","rowBoundaries":jurisdiction_boundary()}]}]}}, + "auditor":{"principalClaim":"sub","requiredScopes":["application:audit"], + "requiredPurposes":["registry-administration"],"permissions":{ + "records":[{"recordType":"application","operations":["get"],"readableFields":["name"], + "readableAttachments":["evidence"],"rowBoundaries":"unrestricted"}]}}, + "viewer":{"principalClaim":"sub","requiredScopes":["application:view"], + "requiredPurposes":["registry-administration"],"permissions":{ + "records":[{"recordType":"application","operations":["get"],"readableFields":["name"], + "rowBoundaries":"unrestricted"}]}}}}) +} + +fn compile(source: Value) -> Result { + let project = parse_project_json(&serde_json::to_vec(&source).unwrap()) + .map_err(|error| format!("{error:?}"))?; + compile_project(&project, &[], CompileProfile::Authoring).map_err(|error| format!("{error:?}")) +} +fn registry() -> registry_breg::CompiledRegistry { + compile(record_source()).expect("record attachment fixture compiles") +} + +struct Exchange { + status: StatusCode, + headers: HeaderMap, + body: Vec, +} +impl Exchange { + fn json(&self) -> Value { + serde_json::from_slice(&self.body).unwrap_or(Value::Null) + } + fn code(&self) -> String { + self.json()["code"].as_str().unwrap_or_default().to_owned() + } +} + +async fn send( + fixture: &client_http::ClientFixture, + claims: VerifiedRequestClaims, + mut request: Request, +) -> Exchange { + request.extensions_mut().insert(claims); + let response = registry_breg::api::router(fixture.service()) + .oneshot(request) + .await + .unwrap(); + let status = response.status(); + let headers = response.headers().clone(); + let body = to_bytes(response.into_body(), 1024 * 1024) + .await + .unwrap() + .to_vec(); + Exchange { + status, + headers, + body, + } +} + +fn file(content_type: &str, bytes: &[u8]) -> Value { + json!({"contentType":content_type,"sha256":sha256_hex(bytes), + "content":base64::engine::general_purpose::STANDARD.encode(bytes)}) +} + +async fn invoke( + fixture: &client_http::ClientFixture, + claims: VerifiedRequestClaims, + idempotency_key: &str, + input: Value, + attachments: Option, +) -> Exchange { + let mut body = json!({"input":input}); + if let Some(attachments) = attachments { + body["attachments"] = attachments; + } + send( + fixture, + claims, + Request::builder() + .method("POST") + .uri("/v1/actions/register") + .header("content-type", "application/json") + .header("idempotency-key", idempotency_key) + .body(Body::from(serde_json::to_vec(&body).unwrap())) + .unwrap(), + ) + .await +} + +fn register_input(programme: Uuid) -> Value { + json!({"name":"Synthetic applicant","jurisdiction":"zone-a","programme":programme.to_string()}) +} + +async fn register( + fixture: &client_http::ClientFixture, + programme: Uuid, + idempotency_key: &str, + bytes: &[u8], +) -> Uuid { + let response = invoke( + fixture, + clerk("zone-a"), + idempotency_key, + register_input(programme), + Some(json!({"evidence":file("text/plain", bytes)})), + ) + .await; + assert_eq!( + response.status, + StatusCode::OK, + "{}", + String::from_utf8_lossy(&response.body) + ); + let id = response.json()["results"]["application"]["recordId"] + .as_str() + .expect("the granted result names the created record") + .to_owned(); + Uuid::parse_str(&id).unwrap() +} + +async fn download( + fixture: &client_http::ClientFixture, + claims: VerifiedRequestClaims, + record: &str, + slot: &str, + profile: Option<&str>, +) -> Exchange { + let query = profile.map_or_else(String::new, |profile| format!("?accessProfile={profile}")); + send( + fixture, + claims, + Request::builder() + .method("GET") + .uri(format!( + "/v1/records/applications/{record}/attachments/{slot}{query}" + )) + .body(Body::empty()) + .unwrap(), + ) + .await +} + +async fn insert_programme( + fixture: &client_http::ClientFixture, + open: bool, + jurisdiction: &str, +) -> Uuid { + let programme = &fixture.registry.entities()["programme"]; + let id = Uuid::new_v4(); + fixture + .database + .admin + .execute( + &format!( + "INSERT INTO registry_data.\"{}\" (record_id, record_revision, record_lifecycle, + active_package_revision, \"{}\", \"{}\") VALUES ($1, 1, 'active', $2, $3, $4)", + programme.physical_table, + programme.fields["open"].physical_name, + programme.fields["jurisdiction"].physical_name + ), + &[&id, &fixture.identity.activation_id, &open, &jurisdiction], + ) + .await + .unwrap(); + id +} + +struct Counts { + applications: i64, + references: i64, + live_references: i64, + blobs: i64, + outbox: i64, +} + +async fn counts(fixture: &client_http::ClientFixture) -> Counts { + let application = &fixture.registry.entities()["application"]; + let row = fixture + .database + .admin + .query_one( + &format!( + "SELECT (SELECT count(*) FROM registry_data.\"{}\"), + (SELECT count(*) FROM registry_internal.registry_record_attachments), + (SELECT count(*) FROM registry_internal.registry_record_attachments + WHERE erased_at IS NULL), + (SELECT count(*) FROM registry_internal.registry_attachment_blobs), + (SELECT count(*) FROM registry_internal.registry_outbox)", + application.physical_table + ), + &[], + ) + .await + .unwrap(); + Counts { + applications: row.get(0), + references: row.get(1), + live_references: row.get(2), + blobs: row.get(3), + outbox: row.get(4), + } +} + +async fn erase_history( + fixture: &client_http::ClientFixture, + record: Uuid, +) -> HistoryErasureOutcome { + erase_history_through(fixture, record, 1).await +} + +async fn erase_history_through( + fixture: &client_http::ClientFixture, + record: Uuid, + revision: i64, +) -> HistoryErasureOutcome { + try_erase_history(fixture, record, revision, &[]) + .await + .expect("history erasure succeeds") +} + +async fn erase_history_and_files( + fixture: &client_http::ClientFixture, + record: Uuid, +) -> HistoryErasureOutcome { + try_erase_history(fixture, record, 1, &["evidence".to_owned()]) + .await + .expect("named file erasure succeeds") +} + +async fn try_erase_history( + fixture: &client_http::ClientFixture, + record: Uuid, + revision: i64, + slots: &[String], +) -> Result { + let target = RecordHistoryErasureTarget::new("application", record, revision) + .with_erase_files(&fixture.registry, slots)?; + let (mut migration, task) = fixture.database.connect_migration().await; + let result = erase_record_history( + &mut migration, + HistoryErasureRequest { + expected: &fixture.identity, + migration_role: &fixture.database.migration_role, + lock_key: RegistryLockKey::derive(fixture.registry.registry_id()).unwrap(), + timeouts: HistoryErasureTimeouts::new(Duration::from_secs(5), Duration::from_secs(5)) + .unwrap(), + audit: &fixture + .database + .audit(AuditProfile::production_from_secret_bytes(vec![0x71; 32].into()).unwrap()), + operator_reference: "operator-reference", + reason: "retention-request", + target, + }, + ) + .await; + drop(migration); + task.abort(); + result +} + +fn assert_erasure_audit(fixture: &client_http::ClientFixture, outcome: &HistoryErasureOutcome) { + let entries = fixture.database.audit_entries(); + let terminal = entries + .iter() + .rev() + .find(|entry| { + entry["schema"] == registry_breg::history_erasure::HISTORY_ERASURE_AUDIT_SCHEMA + && entry["record"]["outcome"] == "committed" + }) + .expect("the erasure has a committed audit entry"); + assert_eq!( + terminal["record"]["erasedFileReferenceCount"], + outcome.erased_file_reference_count + ); + assert_eq!( + terminal["record"]["keptFileReferenceCount"], + outcome.kept_file_reference_count + ); + assert_eq!( + terminal["record"]["removedProposalLinkCount"], + outcome.removed_proposal_link_count + ); +} + +fn assert_file(response: &Exchange, bytes: &[u8]) { + assert_eq!(response.status, StatusCode::OK); + assert_eq!(response.body, bytes); + assert_eq!(response.headers["content-type"], "text/plain"); + assert_eq!(response.headers["repr-digest"], repr_digest(bytes).as_str()); + assert_eq!(response.headers["x-content-type-options"], "nosniff"); + assert_eq!(response.headers["cache-control"], "no-store"); + assert!(response.headers["content-disposition"] + .to_str() + .unwrap() + .starts_with("attachment")); +} + +fn enrol_input(programme: Uuid, name: &str) -> Value { + json!({"name":name,"jurisdiction":"zone-a","programme":programme.to_string()}) +} + +fn amend_input(target: Uuid, programme: Uuid, name: &str) -> Value { + json!({"target":target.to_string(),"name":name,"jurisdiction":"zone-a", + "programme":programme.to_string()}) +} + +/// Starts a Proposal of `action_id`, uploads each `(slot, bytes)` file as +/// text and submits it. +async fn submit_proposal( + fixture: &client_http::ClientFixture, + action_id: &str, + input: Value, + files: &[(&str, &[u8])], + prefix: &str, +) -> registry_breg_client::BRegProposal { + let client = &fixture.http.client; + let metadata = client.registry_contract(Some("clerk")).await.unwrap(); + let action = metadata.value.select_action(action_id, "clerk").unwrap(); + let request = registry_breg_client::BRegActionInvocationRequest::new( + &action, + input.as_object().unwrap().clone(), + None, + ) + .unwrap(); + let mut proposal = client + .start_proposal(&action, &request, &key(&format!("{prefix}-start"))) + .await + .unwrap() + .value; + for (slot, bytes) in files { + proposal = client + .upload_proposal_attachment( + &proposal, + slot, + "text/plain", + bytes, + &key(&format!("{prefix}-upload-{slot}")), + ) + .await + .unwrap() + .value; + } + let submit = client + .prepare_proposal( + &proposal, + "submit", + json!({}), + &key(&format!("{prefix}-submit")), + ) + .unwrap(); + client.execute_proposal(&submit).await.unwrap().value +} + +async fn apply_proposal( + fixture: &client_http::ClientFixture, + submitted: ®istry_breg_client::BRegProposal, + prefix: &str, +) -> Result { + let client = &fixture.http.client; + let apply = client + .prepare_proposal( + submitted, + "apply", + json!({"submissionVersion":1,"effectDigest":submitted.effect_digest().unwrap(), + "reason":"promotion-reason"}), + &key(&format!("{prefix}-apply")), + ) + .unwrap(); + client + .execute_proposal(&apply) + .await + .map(|complete| complete.value) +} + +/// Runs the built-in executor once and returns the job's state and last +/// error code. +async fn run_automatic( + fixture: &client_http::ClientFixture, + proposal: ®istry_breg_client::BRegProposal, +) -> (String, Option) { + assert!(fixture + .mutations + .run_automatic_proposal_once_for_test() + .await + .unwrap()); + let row = fixture + .database + .admin + .query_one( + "SELECT state,last_error_code FROM registry_internal.registry_proposal_application_jobs + WHERE proposal_id=$1", + &[&Uuid::parse_str(proposal.id()).unwrap()], + ) + .await + .unwrap(); + (row.get(0), row.get(1)) +} + +async fn revisions(fixture: &client_http::ClientFixture) -> i64 { + fixture + .database + .admin + .query_one( + "SELECT count(*) FROM registry_internal.registry_revisions", + &[], + ) + .await + .unwrap() + .get(0) +} + +/// Live record references as `(record, slot, sha256, attached revision)`. +async fn record_references( + fixture: &client_http::ClientFixture, +) -> BTreeSet<(Uuid, String, String, i64)> { + fixture + .database + .admin + .query( + "SELECT record_id,slot_id,sha256,attached_revision + FROM registry_internal.registry_record_attachments WHERE erased_at IS NULL", + &[], + ) + .await + .unwrap() + .into_iter() + .map(|row| (row.get(0), row.get(1), row.get(2), row.get(3))) + .collect() +} + +async fn blob_hashes(fixture: &client_http::ClientFixture) -> BTreeSet { + fixture + .database + .admin + .query( + "SELECT sha256 FROM registry_internal.registry_attachment_blobs", + &[], + ) + .await + .unwrap() + .into_iter() + .map(|row| row.get(0)) + .collect() +} + +async fn application_ids(fixture: &client_http::ClientFixture, name: &str) -> BTreeSet { + let application = &fixture.registry.entities()["application"]; + fixture + .database + .admin + .query( + &format!( + "SELECT record_id FROM registry_data.\"{}\" WHERE \"{}\"=$1", + application.physical_table, application.fields["name"].physical_name + ), + &[&name], + ) + .await + .unwrap() + .into_iter() + .map(|row| row.get(0)) + .collect() +} + +async fn erase_proposal( + fixture: &client_http::ClientFixture, + action_id: &str, + proposal: ®istry_breg_client::BRegProposal, +) -> u64 { + let (mut migration, task) = fixture.database.connect_migration().await; + let erasure = registry_breg::proposal_retention::erase_proposal_detail( + &mut migration, + &fixture.registry, + registry_breg::proposal_retention::ProposalDetailErasureScope { + action_id, + proposal_id: Uuid::parse_str(proposal.id()).unwrap(), + submission_version: 1, + }, + ) + .await + .unwrap(); + drop(migration); + task.abort(); + erasure.attachment_references +} + +/// The operation a record slot download audits and logs under. +const DOWNLOAD_OPERATION: &str = "records.application.get:attachment:evidence"; + +/// The phase, outcome and operation of each audit entry since `before`. +fn audited_since( + fixture: &client_http::ClientFixture, + before: usize, +) -> Vec<(String, String, String)> { + fixture.audit_capture.entries()[before..] + .iter() + .map(|entry| { + let field = |name: &str| { + entry["record"][name] + .as_str() + .unwrap_or_default() + .to_owned() + }; + (field("phase"), field("outcome"), field("operationId")) + }) + .collect() +} + +fn audited(phase: &str, outcome: &str) -> (String, String, String) { + ( + phase.to_owned(), + outcome.to_owned(), + DOWNLOAD_OPERATION.to_owned(), + ) +} + +async fn access_log_operations(fixture: &client_http::ClientFixture, record: Uuid) -> Vec { + fixture + .database + .admin + .query( + "SELECT operation_id FROM registry_internal.registry_subject_access_log + WHERE entity_id = 'application' AND record_id = $1 ORDER BY accessed_at, event_id", + &[&record], + ) + .await + .unwrap() + .iter() + .map(|row| row.get(0)) + .collect() +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn an_action_with_attachments_can_check_its_target_before_invocation() { + let mut source = record_source(); + source["actions"]["register"]["commitGuards"]["targets"] + .as_array_mut() + .unwrap() + .push(json!({"input":"programme","revision":"unchanged"})); + let fixture = + client_http::ClientFixture::start(compile(source).unwrap(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let request = |path, body: Value| { + Request::builder() + .method("POST") + .uri(path) + .header("content-type", "application/json") + .body(Body::from(body.to_string())) + .unwrap() + }; + let availability = send( + &fixture, + clerk("zone-a"), + request( + "/v1/actions/register/availability", + json!({"targetInput":"programme","input":{"programme":programme.to_string()}}), + ), + ) + .await; + assert_eq!( + availability.status, + StatusCode::OK, + "{}", + availability.json() + ); + assert_eq!(availability.json()["availability"]["available"], true); + + let conditions = send( + &fixture, + clerk("zone-a"), + request( + "/v1/actions/register/target-conditions", + json!({"input":{"programme":programme.to_string()}}), + ), + ) + .await; + assert_eq!(conditions.status, StatusCode::OK, "{}", conditions.json()); + assert!(conditions.json()["preconditions"]["programme"]["ifMatch"].is_string()); + assert_eq!(counts(&fixture).await.applications, 0); + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn record_and_file_commit_together_and_every_granted_profile_reads_the_same_bytes() { + // The subject access log is on, so every released file is logged. + let mut source = record_source(); + source["recordTypes"]["application"]["accessLog"] = json!({"subjectField":"name"}); + let registry = compile(source).expect("record attachment fixture with an access log compiles"); + let fixture = client_http::ClientFixture::start(registry, clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let before = counts(&fixture).await; + let record = register(&fixture, programme, "register-first", FILE_CANARY).await; + let after = counts(&fixture).await; + assert_eq!(after.applications, before.applications + 1); + assert_eq!(after.references, 1); + assert_eq!(after.blobs, 1); + let stored = fixture + .database + .admin + .query_one( + "SELECT reference.sha256, reference.content_type, reference.byte_size, + reference.attached_revision, blob.state + FROM registry_internal.registry_record_attachments AS reference + JOIN registry_internal.registry_attachment_blobs AS blob USING (sha256) + WHERE reference.entity_id = 'application' AND reference.record_id = $1 + AND reference.slot_id = 'evidence'", + &[&record], + ) + .await + .unwrap(); + assert_eq!(stored.get::<_, String>(0), sha256_hex(FILE_CANARY)); + assert_eq!(stored.get::<_, String>(1), "text/plain"); + assert_eq!(stored.get::<_, i64>(2), FILE_CANARY.len() as i64); + assert_eq!(stored.get::<_, i64>(3), 1); + assert_eq!(stored.get::<_, String>(4), "live"); + + let replay = invoke( + &fixture, + clerk("zone-a"), + "register-first", + register_input(programme), + Some(json!({"evidence":file("text/plain", FILE_CANARY)})), + ) + .await; + assert_eq!(replay.status, StatusCode::OK); + assert_eq!( + replay.json()["results"]["application"]["recordId"], + record.to_string() + ); + assert_eq!( + counts(&fixture).await.references, + 1, + "a replay attaches nothing" + ); + let reused = invoke( + &fixture, + clerk("zone-a"), + "register-first", + register_input(programme), + Some(json!({"evidence":file("text/plain", b"other bytes")})), + ) + .await; + assert_eq!( + reused.status, + StatusCode::CONFLICT, + "a different file is a different request" + ); + + // A download is audited as an attempt and a Returned terminal under the + // slot's own operation, and the subject access log records it once. + let audit_before = fixture.audit_capture.entries().len(); + let logged = access_log_operations(&fixture, record).await; + assert_file( + &download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None, + ) + .await, + FILE_CANARY, + ); + assert_eq!( + audited_since(&fixture, audit_before), + [audited("attempt", ""), audited("terminal", "returned")] + ); + assert_eq!( + access_log_operations(&fixture, record).await, + [logged.clone(), vec![DOWNLOAD_OPERATION.to_owned()]].concat() + ); + // The concealed 404 of a record the caller cannot see is audited as a + // Refused terminal and logs nothing. + let audit_before = fixture.audit_capture.entries().len(); + let absent = Uuid::new_v4(); + assert_eq!( + download( + &fixture, + clerk("zone-a"), + &absent.to_string(), + "evidence", + None + ) + .await + .status, + StatusCode::NOT_FOUND + ); + assert_eq!( + audited_since(&fixture, audit_before), + [audited("attempt", ""), audited("terminal", "refused")] + ); + assert!(access_log_operations(&fixture, absent).await.is_empty()); + + for _ in 0..2 { + assert_file( + &download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None, + ) + .await, + FILE_CANARY, + ); + } + assert_file( + &download( + &fixture, + claims("auditor", "zone-z", "application:audit"), + &record.to_string(), + "evidence", + Some("auditor"), + ) + .await, + FILE_CANARY, + ); + + let downloaded = fixture + .http + .client + .download_record_attachment("applications", &record.to_string(), "evidence", None) + .await + .unwrap() + .value; + assert_eq!(downloaded.as_bytes(), FILE_CANARY); + assert_eq!(downloaded.media_type(), "text/plain"); + assert_eq!( + downloaded.representation_digest().unwrap().as_str(), + repr_digest(FILE_CANARY) + ); + + // Hooks project declared fields only. The outbox never carries the file. + let payloads = fixture + .database + .admin + .query( + "SELECT payload::text FROM registry_internal.registry_outbox", + &[], + ) + .await + .unwrap(); + assert!(!payloads.is_empty(), "the created hook wrote an event"); + let encoded = base64::engine::general_purpose::STANDARD.encode(FILE_CANARY); + for row in payloads { + let payload: Option = row.get(0); + let payload = payload.unwrap_or_default(); + assert!(!payload.contains("record-file-canary")); + assert!(!payload.contains(&encoded)); + assert!(!payload.contains("evidence")); + } + + // The service never releases stored bytes that no longer match the + // digest recorded when the file was attached. + let mut corrupt = FILE_CANARY.to_vec(); + corrupt[0] = b'X'; + fixture + .database + .admin + .execute( + "UPDATE registry_internal.registry_attachment_blobs SET content = $1", + &[&corrupt], + ) + .await + .unwrap(); + let audit_before = fixture.audit_capture.entries().len(); + let logged = access_log_operations(&fixture, record).await; + assert_eq!( + download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None + ) + .await + .status, + StatusCode::SERVICE_UNAVAILABLE, + "stored bytes that no longer match their digest are never released" + ); + // A store failure after the attempt still ends in a Refused terminal, + // and a file that was not released is not logged. + assert_eq!( + audited_since(&fixture, audit_before), + [audited("attempt", ""), audited("terminal", "refused")] + ); + assert_eq!(access_log_operations(&fixture, record).await, logged); + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn profiles_without_the_grant_or_outside_the_row_boundary_cannot_read() { + let fixture = client_http::ClientFixture::start(registry(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let record = register(&fixture, programme, "register-boundary", EVIDENCE).await; + let record = record.to_string(); + let viewer = || claims("viewer", "zone-a", "application:view"); + let viewed = send( + &fixture, + viewer(), + Request::builder() + .uri(format!( + "/v1/records/applications/{record}?accessProfile=viewer" + )) + .body(Body::empty()) + .unwrap(), + ) + .await; + assert_eq!( + viewed.status, + StatusCode::OK, + "the viewer may read the record" + ); + assert!(!String::from_utf8_lossy(&viewed.body).contains("evidence")); + let refusals = [ + download(&fixture, viewer(), &record, "evidence", Some("viewer")).await, + download(&fixture, clerk("zone-b"), &record, "evidence", None).await, + download(&fixture, clerk("zone-a"), &record, "missing", None).await, + download( + &fixture, + clerk("zone-a"), + &Uuid::new_v4().to_string(), + "evidence", + None, + ) + .await, + download(&fixture, clerk("zone-a"), "not-a-record", "evidence", None).await, + download( + &fixture, + claims("viewer", "zone-a", "application:view"), + &record, + "evidence", + Some("auditor"), + ) + .await, + ]; + for refusal in refusals { + assert_eq!(refusal.status, StatusCode::NOT_FOUND); + assert!(!refusal.body.windows(EVIDENCE.len()).any(|w| w == EVIDENCE)); + assert!(refusal.headers.get("repr-digest").is_none()); + } + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn early_download_refusals_audit_the_attachment_operation_without_caller_values() { + let mut source = record_source(); + source["accessProfiles"]["auditor"]["requireAccessReason"] = json!(true); + let fixture = + client_http::ClientFixture::start(compile(source).unwrap(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let record = register(&fixture, programme, "early-download-refusals", EVIDENCE).await; + let actor = || claims("attachment-audit-actor", "zone-a", "application:manage"); + let mut observed = Vec::new(); + let cases = [ + ( + claims("viewer", "zone-a", "application:view"), + record.to_string(), + "evidence", + "?accessProfile=viewer", + StatusCode::NOT_FOUND, + DOWNLOAD_OPERATION, + ), + ( + actor(), + "invalid-record-canary".to_owned(), + "evidence", + "", + StatusCode::NOT_FOUND, + DOWNLOAD_OPERATION, + ), + ( + claims("ungranted", "zone-a", "ungranted:scope"), + record.to_string(), + "evidence", + "", + StatusCode::NOT_FOUND, + DOWNLOAD_OPERATION, + ), + ( + actor(), + record.to_string(), + "evidence", + "?unexpected=query-canary", + StatusCode::BAD_REQUEST, + DOWNLOAD_OPERATION, + ), + ( + claims("auditor", "zone-a", "application:audit"), + record.to_string(), + "evidence", + "?accessProfile=auditor", + StatusCode::BAD_REQUEST, + DOWNLOAD_OPERATION, + ), + ( + actor(), + record.to_string(), + "slot-name-canary", + "", + StatusCode::NOT_FOUND, + "records.application.get:attachment", + ), + ]; + for (claims, record, slot, query, expected_status, operation) in cases { + let before = fixture.audit_capture.entries().len(); + let response = send( + &fixture, + claims, + Request::builder() + .uri(format!( + "/v1/records/applications/{record}/attachments/{slot}{query}" + )) + .body(Body::empty()) + .unwrap(), + ) + .await; + assert_eq!(response.status, expected_status); + assert!(response.headers.get("repr-digest").is_none()); + observed.push((audited_since(&fixture, before), operation)); + } + let audit = serde_json::to_string(&fixture.audit_capture.entries()).unwrap(); + fixture.finish().await; + for canary in [ + "attachment-audit-actor", + "invalid-record-canary", + "query-canary", + "slot-name-canary", + &record.to_string(), + ] { + assert!(!audit.contains(canary)); + } + for (entries, operation) in observed { + assert_eq!( + entries, + [("refusal".to_owned(), String::new(), operation.to_owned())] + ); + } +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn a_tombstoned_record_and_its_file_have_the_same_concealed_read() { + let mut source = record_source(); + source["recordTypes"]["application"]["tombstone"] = json!(true); + let fixture = + client_http::ClientFixture::start(compile(source).unwrap(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let record = register(&fixture, programme, "lifecycle-file", EVIDENCE).await; + assert_file( + &download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None, + ) + .await, + EVIDENCE, + ); + let entity = &fixture.registry.entities()["application"]; + fixture.database.admin.execute(&format!( + "UPDATE registry_data.\"{}\" SET record_lifecycle='tombstoned', record_revision=record_revision+1 WHERE record_id=$1", + entity.physical_table), &[&record]).await.unwrap(); + let (status, body) = get_json( + &fixture, + clerk("zone-a"), + &format!("/v1/records/applications/{record}"), + ) + .await; + let file = download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None, + ) + .await; + assert_eq!(status, StatusCode::NOT_FOUND); + assert_eq!(file.status, status); + assert_eq!(file.json()["code"], body["code"]); + assert!(file.headers.get("repr-digest").is_none()); + assert!(!file + .body + .windows(EVIDENCE.len()) + .any(|bytes| bytes == EVIDENCE)); + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn a_record_disclosure_condition_conceals_its_file_under_the_same_get_relation() { + let mut source = record_source(); + source["recordTypes"]["application"] + .as_object_mut() + .unwrap() + .remove("hooks"); + source["recordTypes"]["application"]["disclosureConditions"] = json!({ + "withhold-application":{"when":[{"type":"field-in","field":"name","values":["Withheld applicant"]}], + "withhold":"record","exemptProfiles":["clerk"]}}); + let fixture = + client_http::ClientFixture::start(compile(source).unwrap(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let record = register(&fixture, programme, "disclosure-file", EVIDENCE).await; + let reader = || claims("auditor", "zone-a", "application:audit"); + let uri = format!("/v1/records/applications/{record}?accessProfile=auditor"); + assert_eq!(get_json(&fixture, reader(), &uri).await.0, StatusCode::OK); + assert_file( + &download( + &fixture, + reader(), + &record.to_string(), + "evidence", + Some("auditor"), + ) + .await, + EVIDENCE, + ); + let entity = &fixture.registry.entities()["application"]; + fixture + .database + .admin + .execute( + &format!( + "UPDATE registry_data.\"{}\" SET \"{}\"='Withheld applicant' WHERE record_id=$1", + entity.physical_table, entity.fields["name"].physical_name + ), + &[&record], + ) + .await + .unwrap(); + let (status, body) = get_json(&fixture, reader(), &uri).await; + let file = download( + &fixture, + reader(), + &record.to_string(), + "evidence", + Some("auditor"), + ) + .await; + assert_eq!(status, StatusCode::NOT_FOUND); + assert_eq!(file.status, status); + assert_eq!(file.json()["code"], body["code"]); + assert!(file.headers.get("repr-digest").is_none()); + assert!(!file + .body + .windows(EVIDENCE.len()) + .any(|bytes| bytes == EVIDENCE)); + assert_file( + &download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None, + ) + .await, + EVIDENCE, + ); + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn immediate_action_refuses_a_completed_rejected_verdict_and_keeps_approved_and_unseen_files() +{ + use registry_breg::attachment_verification::AttachmentVerification; + use registry_platform_config::{AttachmentVerifierConfig, SecretProvider, SecretResolver}; + use registry_platform_objectstore::{HttpVerifierSettings, VerifierNamespace}; + + const REJECTED: &[u8] = b"synthetic-rejected-file"; + const APPROVED: &[u8] = b"synthetic-approved-file"; + const UNSEEN: &[u8] = b"synthetic-unseen-file"; + let secrets = tempfile::tempdir().unwrap(); + let credential = secrets.path().join("verifier"); + std::fs::write(&credential, b"synthetic-verifier-token").unwrap(); + #[cfg(unix)] + { + use std::os::unix::fs::PermissionsExt; + std::fs::set_permissions(&credential, std::fs::Permissions::from_mode(0o600)).unwrap(); + } + let resolver = SecretResolver::new([SecretProvider::File], secrets.path()).unwrap(); + let config: AttachmentVerifierConfig = serde_json::from_value(json!({ + "url":"http://127.0.0.1:1/verify", "policyId":"synthetic-policy", + "authorizationRef":"secret:file/verifier", "attemptTimeoutMilliseconds":2000 + })) + .unwrap(); + let verification = AttachmentVerification::Http(std::sync::Arc::new( + HttpVerifierSettings::from_config(&config) + .unwrap() + .activate( + VerifierNamespace { + binding_domain: "breg-attachment-verification-http-v1", + max_content_bytes: registry_breg::contract::MAX_ATTACHMENT_BYTES as u64, + }, + &resolver, + ) + .unwrap(), + )); + let policy = verification.binding_digest(); + let fixture = client_http::ClientFixture::start_with_mutations( + registry(), + clerk("zone-a"), + move |mutations| mutations.with_attachment_verification(verification), + ) + .await; + let programme = insert_programme(&fixture, true, "zone-a").await; + fixture + .database + .admin + .execute( + "INSERT INTO registry_internal.registry_attachment_storage_binding + (singleton, backend_id, verification_policy) VALUES (true, 'database', $1)", + &[&policy], + ) + .await + .unwrap(); + // Synthetic stored files whose verification has already completed. + for (bytes, verdict) in [(REJECTED, "rejected"), (APPROVED, "approved")] { + let hash = sha256_hex(bytes); + fixture + .database + .admin + .execute( + "INSERT INTO registry_internal.registry_attachment_blobs + (sha256, byte_size, backend_id, content, state) + VALUES ($1, $2, 'database', $3, 'live')", + &[&hash, &(bytes.len() as i64), &bytes], + ) + .await + .unwrap(); + fixture + .database + .admin + .execute( + "INSERT INTO registry_internal.registry_attachment_verification + (sha256, policy_digest, content_type, verdict) VALUES ($1, $2, 'text/plain', $3)", + &[&hash, &policy, &verdict], + ) + .await + .unwrap(); + } + let before = counts(&fixture).await; + let refused = invoke( + &fixture, + clerk("zone-a"), + "register-rejected", + register_input(programme), + Some(json!({"evidence":file("text/plain", REJECTED)})), + ) + .await; + let after = counts(&fixture).await; + let observed = ( + refused.status, + refused.code(), + after.applications, + after.references, + after.live_references, + after.blobs, + after.outbox, + ); + + let approved = register(&fixture, programme, "register-approved", APPROVED).await; + let unseen = register(&fixture, programme, "register-unseen", UNSEEN).await; + assert_file( + &download( + &fixture, + clerk("zone-a"), + &approved.to_string(), + "evidence", + None, + ) + .await, + APPROVED, + ); + assert_eq!( + download( + &fixture, + clerk("zone-a"), + &unseen.to_string(), + "evidence", + None + ) + .await + .status, + StatusCode::NOT_FOUND, + "an unseen file still commits and waits for verification" + ); + let pending: String = fixture + .database + .admin + .query_one( + "SELECT verdict FROM registry_internal.registry_attachment_verification + WHERE sha256=$1 AND policy_digest=$2 AND content_type='text/plain'", + &[&sha256_hex(UNSEEN), &policy], + ) + .await + .unwrap() + .get(0); + assert_eq!(pending, "pending"); + fixture.finish().await; + assert_eq!( + observed, + ( + StatusCode::PRECONDITION_FAILED, + "precondition.failed".to_owned(), + before.applications, + before.references, + before.live_references, + before.blobs, + before.outbox + ) + ); +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn a_file_waiting_for_or_refused_by_verification_is_concealed() { + let fixture = client_http::ClientFixture::start(registry(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let record = register(&fixture, programme, "register-verified", EVIDENCE) + .await + .to_string(); + // Pin a verification policy over the stored file, as a binding that + // turns verification on does. No verdict means the file is pending. + let policy = format!("sha256:{}", "a".repeat(64)); + fixture + .database + .admin + .execute( + "UPDATE registry_internal.registry_attachment_storage_binding + SET verification_policy = $1", + &[&policy], + ) + .await + .unwrap(); + let concealed = |response: Exchange| { + assert_eq!(response.status, StatusCode::NOT_FOUND); + assert!(!response.body.windows(EVIDENCE.len()).any(|w| w == EVIDENCE)); + assert!(response.headers.get("repr-digest").is_none()); + }; + concealed(download(&fixture, clerk("zone-a"), &record, "evidence", None).await); + let verdict = |verdict: &'static str| { + let admin = &fixture.database.admin; + let policy = policy.clone(); + async move { + admin + .execute( + "INSERT INTO registry_internal.registry_attachment_verification + (sha256, policy_digest, content_type, verdict) + VALUES ($1, $2, 'text/plain', $3) + ON CONFLICT (sha256, policy_digest, content_type) + DO UPDATE SET verdict = EXCLUDED.verdict", + &[&sha256_hex(EVIDENCE), &policy, &verdict], + ) + .await + .unwrap(); + } + }; + verdict("approved").await; + assert_file( + &download(&fixture, clerk("zone-a"), &record, "evidence", None).await, + EVIDENCE, + ); + verdict("rejected").await; + concealed(download(&fixture, clerk("zone-a"), &record, "evidence", None).await); + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn a_failed_commit_leaves_neither_the_record_nor_the_file() { + for fault in [ + MutationFaultPoint::BeforeTerminalAudit, + MutationFaultPoint::BeforeIdempotency, + MutationFaultPoint::BeforeCommit, + ] { + let fixture = + client_http::ClientFixture::start_with_mutations(registry(), clerk("zone-a"), |m| { + m.with_fault_for_test(fault) + }) + .await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let response = invoke( + &fixture, + clerk("zone-a"), + "register-fault", + register_input(programme), + Some(json!({"evidence":file("text/plain", EVIDENCE)})), + ) + .await; + // The fault fired inside the write, not at request validation. + assert_eq!( + response.status, + StatusCode::SERVICE_UNAVAILABLE, + "{fault:?}: {}", + String::from_utf8_lossy(&response.body) + ); + let after = counts(&fixture).await; + assert_eq!(after.applications, 0, "{fault:?}"); + assert_eq!(after.references, 0, "{fault:?}"); + assert_eq!(after.blobs, 0, "{fault:?}"); + assert_eq!(after.outbox, 0, "{fault:?}"); + fixture.finish().await; + } + // The same request without a fault commits the record, the file and the + // outbox row together. + let fixture = client_http::ClientFixture::start(registry(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + register(&fixture, programme, "register-fault", EVIDENCE).await; + let after = counts(&fixture).await; + assert_eq!(after.applications, 1); + assert_eq!(after.references, 1); + assert_eq!(after.blobs, 1); + assert!(after.outbox > 0); + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn every_refusal_leaves_no_record_and_no_file() { + let fixture = client_http::ClientFixture::start(registry(), clerk("zone-a")).await; + let open = insert_programme(&fixture, true, "zone-a").await; + let closed = insert_programme(&fixture, false, "zone-a").await; + let mut wrong_digest = file("text/plain", EVIDENCE); + wrong_digest["sha256"] = json!(sha256_hex(b"different")); + let mut empty = file("text/plain", b""); + empty["sha256"] = json!(sha256_hex(b"")); + let cases = [ + ( + "content-type", + open, + Some(json!({"evidence":file("image/png", EVIDENCE)})), + StatusCode::UNSUPPORTED_MEDIA_TYPE, + "attachment.content-type", + ), + ( + "too-large", + open, + Some(json!({"evidence":file("text/plain", &[b'a'; 65])})), + StatusCode::PAYLOAD_TOO_LARGE, + "attachment.too-large", + ), + // Far past the slot, the body itself outgrows what the Action reads. + // It is the same refusal, not a malformed request. + ( + "far-too-large", + open, + Some(json!({"evidence":file("text/plain", &vec![b'a'; 3 * 1024 * 1024])})), + StatusCode::PAYLOAD_TOO_LARGE, + "attachment.too-large", + ), + ( + "digest", + open, + Some(json!({"evidence":wrong_digest})), + StatusCode::UNPROCESSABLE_ENTITY, + "attachment.digest-mismatch", + ), + ("missing", open, None, StatusCode::BAD_REQUEST, ""), + ( + "unknown", + open, + Some( + json!({"evidence":file("text/plain", EVIDENCE),"other":file("text/plain", EVIDENCE)}), + ), + StatusCode::BAD_REQUEST, + "", + ), + ( + "empty", + open, + Some(json!({"evidence":empty})), + StatusCode::BAD_REQUEST, + "", + ), + ( + "guard", + closed, + Some(json!({"evidence":file("text/plain", EVIDENCE)})), + StatusCode::PRECONDITION_FAILED, + "action.guard_failed", + ), + ]; + for (name, programme, attachments, status, code) in cases { + let response = invoke( + &fixture, + clerk("zone-a"), + &format!("refusal-{name}"), + register_input(programme), + attachments, + ) + .await; + assert_eq!( + response.status, + status, + "{name}: {}", + String::from_utf8_lossy(&response.body) + ); + if !code.is_empty() { + assert_eq!(response.code(), code, "{name}"); + } + let after = counts(&fixture).await; + assert_eq!(after.applications, 0, "{name}"); + assert_eq!(after.references, 0, "{name}"); + assert_eq!(after.blobs, 0, "{name}"); + } + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn a_write_once_slot_refuses_a_second_file_even_after_erasure() { + let fixture = client_http::ClientFixture::start(registry(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let record = register(&fixture, programme, "register-once", EVIDENCE).await; + // The storage layer is the only second writer part A has: a create + // effect cannot reach an existing record. It runs as the table owner. + let second = |bytes: &'static [u8]| { + let database = &fixture.database; + async move { + let (mut migration, task) = database.connect_migration().await; + let result = registry_breg::attachment_store::test_support::attach_record( + &mut migration, + "application", + record, + "evidence", + "text/plain", + bytes, + 2, + ) + .await; + drop(migration); + task.abort(); + result + } + }; + assert!(matches!( + second(b"replacement").await, + Err(MutationError::AttachmentSlotWriteOnce) + )); + assert!(matches!( + second(EVIDENCE).await, + Err(MutationError::AttachmentSlotWriteOnce) + )); + let outcome = erase_history_and_files(&fixture, record).await; + assert_eq!(outcome.erased_file_reference_count, 1); + assert_eq!(outcome.kept_file_reference_count, 0); + assert!(matches!( + second(b"replacement").await, + Err(MutationError::AttachmentSlotWriteOnce) + )); + let after = counts(&fixture).await; + assert_eq!(after.references, 1); + assert_eq!(after.live_references, 0); + assert_eq!(after.blobs, 0, "refused writes leave no bytes behind"); + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn history_erasure_keeps_current_files_and_clears_their_attribution() { + let fixture = client_http::ClientFixture::start(registry(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let record = register(&fixture, programme, "keep-history-file", EVIDENCE).await; + let rename = submit_proposal( + &fixture, + "rename", + json!({"target":record.to_string(),"value":"Renamed applicant"}), + &[], + "keep-history-rename", + ) + .await; + apply_proposal(&fixture, &rename, "keep-history-rename") + .await + .unwrap(); + let outcome = erase_history_through(&fixture, record, 1).await; + assert_eq!(outcome.erased_file_reference_count, 0); + assert_eq!(outcome.kept_file_reference_count, 1); + assert_eq!(outcome.removed_proposal_link_count, 0); + assert_erasure_audit(&fixture, &outcome); + let response = download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None, + ) + .await; + let metadata = fixture + .database + .admin + .query_one( + "SELECT erased_at IS NULL, attached_at IS NULL, attached_by IS NULL + FROM registry_internal.registry_record_attachments WHERE record_id=$1", + &[&record], + ) + .await + .unwrap(); + let state = ( + metadata.get::<_, bool>(0), + metadata.get::<_, bool>(1), + metadata.get::<_, bool>(2), + ); + fixture.finish().await; + assert_file(&response, EVIDENCE); + assert_eq!(state, (true, true, true)); +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn record_erasure_removes_the_reference_then_the_bytes_nothing_else_refers_to() { + let fixture = client_http::ClientFixture::start(registry(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let first = register(&fixture, programme, "register-shared-a", EVIDENCE).await; + let second = register(&fixture, programme, "register-shared-b", EVIDENCE).await; + let shared = counts(&fixture).await; + assert_eq!(shared.references, 2); + assert_eq!(shared.blobs, 1, "equal bytes are stored once"); + + let outcome = erase_history_and_files(&fixture, first).await; + assert_eq!(outcome.erased_file_reference_count, 1); + assert_eq!(outcome.kept_file_reference_count, 0); + assert_erasure_audit(&fixture, &outcome); + let after_first = counts(&fixture).await; + assert_eq!(after_first.live_references, 1); + assert_eq!( + after_first.blobs, 1, + "the other record still refers to the bytes" + ); + assert_eq!( + download( + &fixture, + clerk("zone-a"), + &first.to_string(), + "evidence", + None + ) + .await + .status, + StatusCode::NOT_FOUND + ); + assert_file( + &download( + &fixture, + clerk("zone-a"), + &second.to_string(), + "evidence", + None, + ) + .await, + EVIDENCE, + ); + let erased = fixture + .database + .admin + .query_one( + "SELECT erased_at IS NOT NULL, attached_by IS NULL, attached_at IS NULL, + sha256 IS NULL AND content_type IS NULL AND byte_size IS NULL + AND attached_revision IS NULL + FROM registry_internal.registry_record_attachments WHERE record_id = $1", + &[&first], + ) + .await + .unwrap(); + assert!(erased.get::<_, bool>(0)); + assert!(erased.get::<_, bool>(1)); + assert!(erased.get::<_, bool>(2)); + let marker_is_scrubbed = erased.get::<_, bool>(3); + + erase_history_and_files(&fixture, second).await; + let after_second = counts(&fixture).await; + assert_eq!(after_second.live_references, 0); + assert_eq!(after_second.blobs, 0, "unreferenced bytes are removed"); + let digest = sha256_hex(EVIDENCE); + for entries in [ + fixture.database.audit_entries(), + fixture.audit_capture.entries(), + ] { + assert!( + !serde_json::to_string(&entries).unwrap().contains(&digest), + "the audit holds no file digest" + ); + } + let retained: i64 = fixture + .database + .admin + .query_one( + "SELECT (SELECT count(*) FROM registry_internal.registry_outbox + WHERE position($1::text in payload::text)>0) + + (SELECT count(*) FROM registry_internal.registry_idempotency + WHERE position($1::text in convert_from(response_body, 'UTF8'))>0)", + &[&digest], + ) + .await + .unwrap() + .get(0); + assert_eq!( + retained, 0, + "outbox and held responses retain no file digest" + ); + let invalid_live = fixture.database.admin.execute( + "UPDATE registry_internal.registry_record_attachments SET erased_at=NULL WHERE record_id=$1", + &[&first], + ).await.expect_err("a live reference requires file metadata"); + assert_eq!( + invalid_live.code(), + Some(&tokio_postgres::error::SqlState::CHECK_VIOLATION) + ); + fixture.finish().await; + assert!( + marker_is_scrubbed, + "an erased slot retains only its key and erasure time" + ); +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn a_retained_file_can_be_erased_after_its_history_is_gone() { + let fixture = client_http::ClientFixture::start(registry(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let record = register(&fixture, programme, "erase-file-later", EVIDENCE).await; + let first = erase_history(&fixture, record).await; + assert!(first.coverage_ready); + assert_eq!(first.kept_file_reference_count, 1); + assert_file( + &download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None, + ) + .await, + EVIDENCE, + ); + let second = try_erase_history(&fixture, record, 1, &["evidence".to_owned()]).await; + if let Ok(outcome) = &second { + assert_eq!(outcome.erased_revision_count, 0); + assert_eq!(outcome.erased_file_reference_count, 1); + assert_eq!(outcome.kept_file_reference_count, 0); + assert_eq!(outcome.removed_proposal_link_count, 0); + assert_eq!(outcome.coverage_ready, first.coverage_ready); + assert_eq!( + outcome.unavailable_after_position, + first.unavailable_after_position + ); + assert_erasure_audit(&fixture, outcome); + assert_eq!( + download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None + ) + .await + .status, + StatusCode::NOT_FOUND + ); + assert_eq!( + try_erase_history(&fixture, record, 1, &["evidence".to_owned()]).await, + Err(HistoryErasureError::TargetUnavailable), + "a repeated file-only no-op stays refused" + ); + assert_eq!( + try_erase_history(&fixture, record, 1, &[]).await, + Err(HistoryErasureError::TargetUnavailable), + "empty history without a selected file stays refused" + ); + } + fixture.finish().await; + second.expect("the same acknowledged operation can erase a named current file later"); +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn history_erasure_refuses_an_undeclared_file_slot_before_any_erasure() { + let fixture = client_http::ClientFixture::start(registry(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let record = register(&fixture, programme, "unknown-erase-slot", EVIDENCE).await; + let before = revisions(&fixture).await; + let audit_before = fixture.database.audit_entries().len(); + for slots in [ + vec!["undeclared".to_owned()], + vec!["evidence".to_owned(), "evidence".to_owned()], + ] { + let result = try_erase_history(&fixture, record, 1, &slots).await; + assert_eq!(result, Err(HistoryErasureError::InvalidInput)); + } + assert_eq!(revisions(&fixture).await, before); + assert_eq!(fixture.database.audit_entries().len(), audit_before); + assert_eq!(counts(&fixture).await.live_references, 1); + assert_file( + &download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None, + ) + .await, + EVIDENCE, + ); + fixture.finish().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn proposal_erasure_never_removes_bytes_a_record_refers_to() { + let fixture = client_http::ClientFixture::start(registry(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let record = register(&fixture, programme, "register-proposal", EVIDENCE).await; + let client = &fixture.http.client; + let metadata = client.registry_contract(Some("clerk")).await.unwrap(); + let action = metadata.value.select_action("rename", "clerk").unwrap(); + let input = registry_breg_client::BRegActionInvocationRequest::new( + &action, + json!({"target":record.to_string(),"value":"Renamed"}) + .as_object() + .unwrap() + .clone(), + None, + ) + .unwrap(); + let draft = client + .start_proposal(&action, &input, &key("rename-start")) + .await + .unwrap() + .value; + // The storage layer stores equal bytes once, so this Proposal reference + // and the record reference share one blob row. + let uploaded = client + .upload_proposal_attachment( + &draft, + "support", + "text/plain", + EVIDENCE, + &key("rename-upload"), + ) + .await + .unwrap() + .value; + assert_eq!(counts(&fixture).await.blobs, 1); + let submit = client + .prepare_proposal(&uploaded, "submit", json!({}), &key("rename-submit")) + .unwrap(); + let submitted = client.execute_proposal(&submit).await.unwrap().value; + let apply = client + .prepare_proposal( + &submitted, + "apply", + json!({"submissionVersion":1,"effectDigest":submitted.effect_digest().unwrap(), + "reason":"rename-reason"}), + &key("rename-apply"), + ) + .unwrap(); + let applied = client.execute_proposal(&apply).await.unwrap().value; + assert_eq!(applied.state(), BRegProposalState::Applied); + let (mut migration, task) = fixture.database.connect_migration().await; + let erasure = registry_breg::proposal_retention::erase_proposal_detail( + &mut migration, + &fixture.registry, + registry_breg::proposal_retention::ProposalDetailErasureScope { + action_id: "rename", + proposal_id: Uuid::parse_str(applied.id()).unwrap(), + submission_version: 1, + }, + ) + .await + .unwrap(); + assert_eq!(erasure.attachment_references, 1); + drop(migration); + task.abort(); + let scrubbed: bool = fixture + .database + .admin + .query_one( + "SELECT erased_at IS NOT NULL AND sha256 IS NULL AND content_type IS NULL + AND byte_size IS NULL AND uploaded_at IS NULL AND uploaded_by IS NULL + FROM registry_internal.registry_proposal_attachments WHERE proposal_id=$1", + &[&Uuid::parse_str(applied.id()).unwrap()], + ) + .await + .unwrap() + .get(0); + let state = fixture + .database + .admin + .query_one( + "SELECT state FROM registry_internal.registry_attachment_blobs WHERE sha256 = $1", + &[&sha256_hex(EVIDENCE)], + ) + .await + .unwrap(); + assert_eq!(state.get::<_, String>(0), "live"); + assert_file( + &download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None, + ) + .await, + EVIDENCE, + ); + fixture.finish().await; + assert!( + scrubbed, + "an erased Proposal file retains only its slot identity and erasure time" + ); +} + +/// The built-in executor applies `enrol`. Its create effect promotes the +/// `document` file by reference to the bytes the Proposal stored. Erasing +/// the Proposal keeps those bytes and removes the `note` file nothing +/// promoted. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn an_applied_proposal_promotes_its_file_by_reference_and_erasure_keeps_it() { + let fixture = client_http::ClientFixture::start(registry(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let submitted = submit_proposal( + &fixture, + "enrol", + enrol_input(programme, "Enrolled applicant"), + &[("document", EVIDENCE), ("note", FILE_CANARY)], + "enrol-promote", + ) + .await; + let before = counts(&fixture).await; + assert_eq!(before.blobs, 2); + assert_eq!(before.references, 0); + + assert_eq!( + run_automatic(&fixture, &submitted).await, + ("applied".to_owned(), None) + ); + let record = *application_ids(&fixture, "Enrolled applicant") + .await + .first() + .expect("the applied Proposal created the record"); + let after = counts(&fixture).await; + assert_eq!(after.applications, before.applications + 1); + assert_eq!(after.blobs, before.blobs, "promotion copies no bytes"); + assert_eq!( + record_references(&fixture).await, + BTreeSet::from([(record, "evidence".to_owned(), sha256_hex(EVIDENCE), 1)]) + ); + assert_file( + &download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None, + ) + .await, + EVIDENCE, + ); + + assert_eq!(erase_proposal(&fixture, "enrol", &submitted).await, 2); + assert_eq!( + blob_hashes(&fixture).await, + BTreeSet::from([sha256_hex(EVIDENCE)]), + "the promoted bytes stay and the unpromoted bytes are gone" + ); + assert_eq!(counts(&fixture).await.blobs, 1); + assert_file( + &download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None, + ) + .await, + EVIDENCE, + ); + + fixture.finish().await; +} + +/// The record source with the clerk reading application history. +fn history_source() -> Value { + let mut source = record_source(); + let application = &mut source["accessProfiles"]["clerk"]["permissions"]["records"][0]; + application["operations"] = json!(["get", "list", "revisions"]); + application["revisionAccess"] = json!(true); + source +} + +async fn get_json( + fixture: &client_http::ClientFixture, + claims: VerifiedRequestClaims, + uri: &str, +) -> (StatusCode, Value) { + let response = send( + fixture, + claims, + Request::builder() + .method("GET") + .uri(uri) + .body(Body::empty()) + .unwrap(), + ) + .await; + (response.status, response.json()) +} + +/// The Proposal ids record history links, newest revision first. +async fn history_links(fixture: &client_http::ClientFixture, record: Uuid) -> Vec { + let (status, history) = get_json( + fixture, + clerk("zone-a"), + &format!("/v1/records/applications/{record}/revisions"), + ) + .await; + assert_eq!(status, StatusCode::OK, "{history}"); + history["items"] + .as_array() + .unwrap() + .iter() + .map(|item| item["proposal"]["proposalId"].clone()) + .collect() +} + +/// `enrol` creates a record and promotes its file at revision 1, and a +/// `rename` Proposal writes revision 2. History erasure through revision 1 +/// keeps the promoted file and removes the link to the Proposal that wrote +/// that revision. Each Proposal still reads, only `rename` names a revision, +/// and the Record keeps the file after `enrol` detail is erased. After history +/// erasure through revision 2, a current read of `rename` names no revision, +/// while a retry of its apply returns the receipt as first issued. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn history_erasure_keeps_a_promoted_file_and_removes_the_link_to_the_erased_revision() { + let fixture = + client_http::ClientFixture::start(compile(history_source()).unwrap(), clerk("zone-a")) + .await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let enrol = submit_proposal( + &fixture, + "enrol", + enrol_input(programme, "Erased applicant"), + &[("document", EVIDENCE)], + "erase-enrol", + ) + .await; + assert_eq!( + run_automatic(&fixture, &enrol).await, + ("applied".to_owned(), None) + ); + let record = *application_ids(&fixture, "Erased applicant") + .await + .first() + .expect("the applied Proposal created the record"); + let rename = submit_proposal( + &fixture, + "rename", + json!({"target":record.to_string(),"value":"Renamed applicant"}), + &[], + "erase-rename", + ) + .await; + let renamed = apply_proposal(&fixture, &rename, "erase-rename") + .await + .unwrap(); + assert_eq!(renamed.state(), BRegProposalState::Applied); + assert_eq!( + history_links(&fixture, record).await, + vec![json!(rename.id()), json!(enrol.id())], + "each Proposal-written revision links its Proposal before erasure" + ); + + let outcome = erase_history(&fixture, record).await; + assert_eq!(outcome.erased_file_reference_count, 0); + assert_eq!(outcome.kept_file_reference_count, 1); + assert_eq!(outcome.removed_proposal_link_count, 1); + assert_erasure_audit(&fixture, &outcome); + + assert!( + !record_references(&fixture).await.is_empty(), + "the promoted file is current state of the Record" + ); + assert_file( + &download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None, + ) + .await, + EVIDENCE, + ); + assert_eq!( + blob_hashes(&fixture).await, + BTreeSet::from([sha256_hex(EVIDENCE)]), + "the enrol Proposal still refers to the bytes" + ); + assert_eq!( + history_links(&fixture, record).await, + vec![json!(rename.id())], + "history keeps the surviving revision's link and names no erased revision" + ); + let (status, erased) = get_json( + &fixture, + clerk("zone-a"), + &format!("/v1/records/applications/{record}/revisions/1"), + ) + .await; + assert_eq!(status, StatusCode::NOT_FOUND, "{erased}"); + let (status, enrolled) = get_json( + &fixture, + clerk("zone-a"), + &format!("/v1/proposals/{}", enrol.id()), + ) + .await; + assert_eq!(status, StatusCode::OK, "{enrolled}"); + assert_eq!(enrolled["state"], "applied", "{enrolled}"); + assert_eq!( + enrolled["application"]["resultLinks"], + json!([]), + "the Proposal names no erased revision" + ); + let (status, current) = get_json( + &fixture, + clerk("zone-a"), + &format!("/v1/proposals/{}", rename.id()), + ) + .await; + assert_eq!(status, StatusCode::OK, "{current}"); + assert_eq!( + current["application"]["resultLinks"], + json!([{"recordType":"application","recordId":record.to_string(),"revision":2}]), + "{current}" + ); + let client = &fixture.http.client; + let retained = client.read_proposal(&enrol).await.unwrap().value; + assert_eq!( + client + .download_proposal_attachment(&retained, "document") + .await + .expect("the Proposal keeps its own file") + .value + .as_bytes(), + EVIDENCE + ); + + assert_eq!(erase_proposal(&fixture, "enrol", &enrol).await, 1); + // `retained` still carries the download link read before this erasure. + let error = client + .download_proposal_attachment(&retained, "document") + .await + .expect_err("erasing the Proposal's detail ends the file download"); + assert_eq!(error.status(), Some(404)); + assert_eq!( + blob_hashes(&fixture).await, + BTreeSet::from([sha256_hex(EVIDENCE)]), + "the Record keeps the bytes after the Proposal is erased" + ); + let (status, enrolled) = get_json( + &fixture, + clerk("zone-a"), + &format!("/v1/proposals/{}", enrol.id()), + ) + .await; + assert_eq!(status, StatusCode::OK, "{enrolled}"); + assert_eq!(enrolled["state"], "applied", "{enrolled}"); + + let outcome = erase_history_through(&fixture, record, 2).await; + assert_eq!(outcome.kept_file_reference_count, 1); + assert_eq!(outcome.removed_proposal_link_count, 1); + assert_erasure_audit(&fixture, &outcome); + assert_file( + &download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None, + ) + .await, + EVIDENCE, + ); + + let (status, current) = get_json( + &fixture, + clerk("zone-a"), + &format!("/v1/proposals/{}", rename.id()), + ) + .await; + assert_eq!(status, StatusCode::OK, "{current}"); + assert_eq!( + current["application"]["resultLinks"], + json!([]), + "{current}" + ); + let replayed = apply_proposal(&fixture, &rename, "erase-rename") + .await + .expect("the same caller retries the apply with its key"); + assert_eq!( + serde_json::to_value(replayed.application()).unwrap(), + serde_json::to_value(renamed.application()).unwrap(), + "the receipt answers as first issued" + ); + fixture.finish().await; +} + +async fn create_programme(fixture: &client_http::ClientFixture) -> Uuid { + let client = &fixture.http.client; + let metadata = client.registry_contract(Some("clerk")).await.unwrap(); + let BRegDirectWrite::Create(create) = metadata + .value + .select_direct_write("records.programme.create", "clerk") + .unwrap() + else { + panic!("records.programme.create is a create binding") + }; + let Value::Object(data) = json!({"open":true,"jurisdiction":"zone-a"}) else { + unreachable!("create payload is an object") + }; + let created = client + .create_record( + &create, + &BRegCreateRequest::new(data).unwrap(), + &key("rebaseline-programme"), + BRegRecordFormat::Json, + ) + .await + .unwrap(); + created.value.data.record_identifier.parse().unwrap() +} + +/// Records that `application.name` was flipped with `erase-and-rebaseline` +/// by a later activation, so the revisions written so far are the pre-flip +/// ones. It writes the two ledger rows the lifecycle reads and encrypts nothing. +async fn record_erase_and_rebaseline_flip( + fixture: &client_http::ClientFixture, + migration: &tokio_postgres::Client, +) { + let boundary = Uuid::from_u128(0xF11F).to_string(); + migration + .execute( + "INSERT INTO registry_internal.registry_migrations + (activation_id, apply_order, package_digest, predecessor_package_digest, + registry_revision, plan_kind, migration_kind, statement_checksums, + artifact_paths, artifact_checksums, outcome, completed_at, applied_at, + role_mode, runtime_role) + SELECT $1::text::uuid, apply_order + 1, $2, package_digest, registry_revision, + 'successor', 'metadata-only', ARRAY[]::text[], ARRAY[]::text[], + ARRAY[]::text[], 'applied', transaction_timestamp(), + transaction_timestamp(), role_mode, runtime_role + FROM registry_internal.registry_migrations + WHERE activation_id::text = $3", + &[ + &boundary, + &format!("sha256:{}", sha256_hex(boundary.as_bytes())), + &fixture.identity.activation_id, + ], + ) + .await + .expect("the boundary activation inserts"); + migration + .execute( + "INSERT INTO registry_internal.registry_field_encryption_flips + (entity_id, field_id, boundary_package_revision, history_choice, + history_commit_position, sealed_row_count, sealed_journal_row_count, + accepted_plaintext_journal_row_count, + accepted_proposal_target_row_count, + accepted_proposal_submission_row_count, + accepted_idempotency_row_count, accepted_outbox_row_count) + SELECT 'application', 'name', $1, 'erase-and-rebaseline', latest_position + 1, + 0, 0, 0, 0, 0, 0, 0 + FROM registry_internal.registry_commit_head WHERE singleton", + &[&boundary], + ) + .await + .expect("the flip inserts"); +} + +/// The `erase-and-rebaseline` lifecycle erases the pre-flip revision an +/// applied Proposal wrote and completes. That Proposal stays applied and names +/// no erased revision, and the record keeps its file. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn erase_and_rebaseline_erases_a_revision_a_proposal_wrote() { + // The rebaseline checks each live row against its journal, so the + // programme is created through the API instead of by `insert_programme`. + let mut source = history_source(); + let grant = &mut source["accessProfiles"]["clerk"]["permissions"]["records"][1]; + grant["operations"] = json!(["create", "get", "list"]); + grant["writableFields"] = json!(["open", "jurisdiction"]); + let fixture = + client_http::ClientFixture::start(compile(source).unwrap(), clerk("zone-a")).await; + let programme = create_programme(&fixture).await; + let enrol = submit_proposal( + &fixture, + "enrol", + enrol_input(programme, "Rebaselined applicant"), + &[("document", EVIDENCE)], + "rebaseline-enrol", + ) + .await; + assert_eq!( + run_automatic(&fixture, &enrol).await, + ("applied".to_owned(), None) + ); + let record = *application_ids(&fixture, "Rebaselined applicant") + .await + .first() + .expect("the applied Proposal created the record"); + + let (mut migration, task) = fixture.database.connect_migration().await; + record_erase_and_rebaseline_flip(&fixture, &migration).await; + // The rebaseline keeps the live record's newest revision, so `rename` + // writes one past the flip, as sealing the live values does. + let rename = submit_proposal( + &fixture, + "rename", + json!({"target":record.to_string(),"value":"Renamed applicant"}), + &[], + "rebaseline-rename", + ) + .await; + apply_proposal(&fixture, &rename, "rebaseline-rename") + .await + .unwrap(); + let outcome = erase_field_encryption_history( + &mut migration, + FieldEncryptionHistoryErasureRequest { + expected: &fixture.identity, + migration_role: &fixture.database.migration_role, + lock_key: RegistryLockKey::derive(fixture.registry.registry_id()).unwrap(), + timeouts: HistoryErasureTimeouts::new(Duration::from_secs(5), Duration::from_secs(5)) + .unwrap(), + audit: &fixture + .database + .audit(AuditProfile::production_from_secret_bytes(vec![0x71; 32].into()).unwrap()), + operator_reference: "operator-reference", + reason: "retention-request", + registry: &fixture.registry, + }, + ) + .await + .expect("the lifecycle completes"); + drop(migration); + task.abort(); + assert_eq!(outcome.erased_record_count, 1); + assert_eq!(outcome.erased_revision_count, 1); + + assert_eq!( + history_links(&fixture, record).await, + vec![json!(rename.id())] + ); + let (status, enrolled) = get_json( + &fixture, + clerk("zone-a"), + &format!("/v1/proposals/{}", enrol.id()), + ) + .await; + assert_eq!(status, StatusCode::OK, "{enrolled}"); + assert_eq!(enrolled["state"], "applied", "{enrolled}"); + assert_eq!( + enrolled["application"]["resultLinks"], + json!([]), + "{enrolled}" + ); + assert_file( + &download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None, + ) + .await, + EVIDENCE, + ); + fixture.finish().await; +} + +/// The record source with an `overseer` profile that reads an `enrol` +/// Proposal only when the record it created is inside its row boundary. The +/// programme the Proposal names is unrestricted, so only the created record +/// bounds the read. +fn overseer_source() -> Value { + let mut source = record_source(); + source["accessProfiles"]["overseer"] = json!({"principalClaim":"sub", + "requiredScopes":["application:oversee"],"requiredPurposes":["registry-administration"], + "permissions":{"proposals":[{"action":"enrol","operations":["get"],"ownership":"caller", + "targets":[{"recordType":"programme","rowBoundaries":"unrestricted"}, + {"recordType":"application","rowBoundaries":jurisdiction_boundary()}]}]}}); + source +} + +/// An applied Proposal reads only for a caller whose row boundary holds each +/// record it wrote. Erasing the revision it wrote removes the link, not +/// that check. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn an_applied_proposal_stays_bounded_by_a_record_whose_revision_was_erased() { + let fixture = + client_http::ClientFixture::start(compile(overseer_source()).unwrap(), clerk("zone-a")) + .await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let enrol = submit_proposal( + &fixture, + "enrol", + enrol_input(programme, "Bounded applicant"), + &[("document", EVIDENCE)], + "bounded-enrol", + ) + .await; + assert_eq!( + run_automatic(&fixture, &enrol).await, + ("applied".to_owned(), None) + ); + let record = *application_ids(&fixture, "Bounded applicant") + .await + .first() + .expect("the applied Proposal created the record"); + let path = format!("/v1/proposals/{}?accessProfile=overseer", enrol.id()); + let inside = || claims("clerk", "zone-a", "application:oversee"); + let outside = || claims("clerk", "zone-b", "application:oversee"); + let (status, read) = get_json(&fixture, inside(), &path).await; + assert_eq!(status, StatusCode::OK, "{read}"); + let (status, refused) = get_json(&fixture, outside(), &path).await; + assert_eq!(status, StatusCode::NOT_FOUND, "{refused}"); + + erase_history(&fixture, record).await; + + let (status, read) = get_json(&fixture, inside(), &path).await; + assert_eq!(status, StatusCode::OK, "{read}"); + assert_eq!(read["application"]["resultLinks"], json!([]), "{read}"); + let (status, still_refused) = get_json(&fixture, outside(), &path).await; + assert_eq!( + (status, &still_refused["code"]), + (StatusCode::NOT_FOUND, &refused["code"]), + "{still_refused}" + ); + fixture.finish().await; +} + +/// An optional Proposal slot left empty leaves the record slot empty, and +/// the apply succeeds. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn an_empty_optional_source_leaves_the_record_slot_empty() { + let fixture = client_http::ClientFixture::start(registry(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let submitted = submit_proposal( + &fixture, + "enrol", + enrol_input(programme, "Applicant without file"), + &[], + "enrol-empty", + ) + .await; + assert_eq!( + run_automatic(&fixture, &submitted).await, + ("applied".to_owned(), None) + ); + let record = *application_ids(&fixture, "Applicant without file") + .await + .first() + .expect("the applied Proposal created the record"); + assert!(record_references(&fixture).await.is_empty()); + assert_eq!(counts(&fixture).await.blobs, 0); + assert_eq!( + download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None + ) + .await + .status, + StatusCode::NOT_FOUND + ); + fixture.finish().await; +} + +/// A caller applies `amend` over HTTP. Its create and patch effects both +/// reference the one stored copy of the Proposal file, and the patch fills +/// the empty slot at the record's new revision. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn create_and_patch_effects_reference_one_stored_copy() { + let fixture = client_http::ClientFixture::start(registry(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let enrolled = submit_proposal( + &fixture, + "enrol", + enrol_input(programme, "Applicant to amend"), + &[], + "amend-target", + ) + .await; + assert_eq!( + run_automatic(&fixture, &enrolled).await, + ("applied".to_owned(), None) + ); + let target = *application_ids(&fixture, "Applicant to amend") + .await + .first() + .unwrap(); + let submitted = submit_proposal( + &fixture, + "amend", + amend_input(target, programme, "Amended applicant"), + &[("document", EVIDENCE)], + "amend-empty", + ) + .await; + let before = counts(&fixture).await; + assert_eq!(before.blobs, 1); + let applied = apply_proposal(&fixture, &submitted, "amend-empty") + .await + .expect("both empty slots take the file"); + assert_eq!(applied.state(), BRegProposalState::Applied); + let after = counts(&fixture).await; + assert_eq!(after.blobs, before.blobs, "promotion copies no bytes"); + let records = application_ids(&fixture, "Amended applicant").await; + assert_eq!(records.len(), 2); + let copy = *records.iter().find(|record| **record != target).unwrap(); + assert_eq!( + record_references(&fixture).await, + BTreeSet::from([ + (copy, "evidence".to_owned(), sha256_hex(EVIDENCE), 1), + (target, "evidence".to_owned(), sha256_hex(EVIDENCE), 2), + ]) + ); + for record in [copy, target] { + assert_file( + &download( + &fixture, + clerk("zone-a"), + &record.to_string(), + "evidence", + None, + ) + .await, + EVIDENCE, + ); + } + fixture.finish().await; +} + +/// A second file for a filled write-once slot answers 409 +/// `attachment.slot-write-once` over HTTP. The apply rolls back as a whole: +/// the record its create effect wrote, that record's reference and every +/// revision are gone, and the Proposal stays submitted. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn promotion_into_a_filled_slot_answers_409_and_rolls_back_the_whole_apply() { + let fixture = client_http::ClientFixture::start(registry(), clerk("zone-a")).await; + let programme = insert_programme(&fixture, true, "zone-a").await; + let target = register(&fixture, programme, "register-filled", EVIDENCE).await; + let submitted = submit_proposal( + &fixture, + "amend", + amend_input(target, programme, "Refused amendment"), + &[("document", FILE_CANARY)], + "amend-filled", + ) + .await; + let before = counts(&fixture).await; + let before_revisions = revisions(&fixture).await; + let before_references = record_references(&fixture).await; + + let error = apply_proposal(&fixture, &submitted, "amend-filled") + .await + .expect_err("the filled slot refuses the second file"); + assert_eq!(error.status(), Some(409)); + assert_eq!( + error.problem_code(), + Some(registry_breg_client::BRegProblemCode::AttachmentSlotWriteOnce) + ); + + let after = counts(&fixture).await; + assert_eq!(after.applications, before.applications); + assert_eq!(after.references, before.references); + assert_eq!(after.blobs, before.blobs); + assert_eq!(after.outbox, before.outbox); + assert_eq!(revisions(&fixture).await, before_revisions); + assert_eq!(record_references(&fixture).await, before_references); + assert!(application_ids(&fixture, "Refused amendment") + .await + .is_empty()); + assert_file( + &download( + &fixture, + clerk("zone-a"), + &target.to_string(), + "evidence", + None, + ) + .await, + EVIDENCE, + ); + let current = fixture + .http + .client + .read_proposal(&submitted) + .await + .unwrap() + .value; + assert_eq!(current.state(), BRegProposalState::Submitted); + fixture.finish().await; +} + +/// The fixture plus `pair`, a Proposal Action whose two create effects each +/// promote a different Proposal file, `left` from `first` and `right` from +/// `second`. +fn paired_promotion_source() -> Value { + let mut source = record_source(); + let slot = |id: &str| { + json!({"id":id,"required":true,"maximumBytes":64,"contentTypes":["text/plain"], + "classification":"restricted"}) + }; + let create = |id: &str, from: &str| { + json!({"id":id,"target":{"recordType":"application"},"operation":"create", + "set":{"name":{"fromInput":"name"},"jurisdiction":{"fromInput":"jurisdiction"}, + "programme":{"fromInput":"programme"}}, + "attachments":{"evidence":{"fromAttachment":from}}}) + }; + source["actions"]["pair"] = json!({"execution":{"mode":"proposal","proposal":{ + "review":{"type":"none"},"application":{"mode":"manual"}, + "retention":{"mode":"operator-erase"},"attachments":[slot("first"), slot("second")]}}, + "inputs":source["actions"]["enrol"]["inputs"].clone(), + "plan":{"type":"fixed","effects":[create("left", "first"), create("right", "second")]}}); + let targets = json!([ + {"recordType":"programme","rowBoundaries":jurisdiction_boundary()}, + {"recordType":"application","rowBoundaries":jurisdiction_boundary()}]); + let clerk = &mut source["accessProfiles"]["clerk"]["permissions"]; + clerk["actions"] + .as_array_mut() + .unwrap() + .push(json!({"action":"pair","operations":["start"],"targets":targets.clone()})); + clerk["proposals"] + .as_array_mut() + .unwrap() + .push(json!({"action":"pair", + "operations":["get","list","edit","submit","apply"],"ownership":"caller", + "readableAttachments":["first","second"],"writableAttachments":["first","second"], + "targets":targets})); + source +} + +/// Calls a session advisory lock `function` on the key the content-hash lock +/// of `bytes` takes, and returns its answer. +async fn hash_lock(client: &tokio_postgres::Client, function: &str, bytes: &[u8]) -> bool { + client + .query_one( + &format!("SELECT {function}(hashtextextended($1, 960))"), + &[&sha256_hex(bytes)], + ) + .await + .unwrap() + .get(0) +} + +/// Promotions lock content hashes in hash order, as the immediate path does, +/// so two applies that share files cannot each hold the hash the other +/// waits for. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn promotions_lock_content_hashes_in_hash_order() { + let fixture = client_http::ClientFixture::start( + compile(paired_promotion_source()).unwrap(), + clerk("zone-a"), + ) + .await; + let programme = insert_programme(&fixture, true, "zone-a").await; + // `left` runs first and promotes the higher hash, so effect order and + // hash order disagree. + let (high, low): (&[u8], &[u8]) = if sha256_hex(b"paired-one") > sha256_hex(b"paired-two") { + (b"paired-one", b"paired-two") + } else { + (b"paired-two", b"paired-one") + }; + let submitted = submit_proposal( + &fixture, + "pair", + enrol_input(programme, "Paired"), + &[("first", high), ("second", low)], + "pair", + ) + .await; + // Another apply holds the lower hash. + let (holder, holder_task) = fixture.database.connect_migration().await; + assert!(hash_lock(&holder, "pg_try_advisory_lock", low).await); + let probe = async { + tokio::time::timeout(Duration::from_secs(5), async { + loop { + let waiting: i64 = fixture + .database + .admin + .query_one( + "SELECT count(*) FROM pg_locks WHERE locktype='advisory' AND NOT granted + AND database=(SELECT oid FROM pg_database WHERE datname=current_database())", + &[], + ) + .await + .unwrap() + .get(0); + if waiting != 0 { + break; + } + tokio::time::sleep(Duration::from_millis(10)).await; + } + }) + .await + .expect("the apply waits for the lower hash"); + // While it waits, the apply must not hold the higher hash. + let (prober, prober_task) = fixture.database.connect_migration().await; + let free = hash_lock(&prober, "pg_try_advisory_lock", high).await; + if free { + assert!(hash_lock(&prober, "pg_advisory_unlock", high).await); + } + drop(prober); + prober_task.abort(); + assert!(hash_lock(&holder, "pg_advisory_unlock", low).await); + free + }; + let (applied, higher_free) = tokio::join!(apply_proposal(&fixture, &submitted, "pair"), probe); + holder_task.abort(); + assert!( + higher_free, + "an apply waiting for the lower hash holds no higher hash" + ); + applied.expect("the apply completes once the lower hash is free"); + assert_eq!(counts(&fixture).await.references, 2); + fixture.finish().await; +} + +#[test] +fn declarations_grants_and_effects_are_validated() { + let refused = |mutate: &dyn Fn(&mut Value), code: &str| { + let mut source = record_source(); + mutate(&mut source); + let error = compile(source).expect_err(code); + assert!(error.contains(code), "{code}: {error}"); + }; + refused( + &|source| { + source["recordTypes"]["application"]["attachments"][0] + .as_object_mut() + .unwrap() + .remove("writeOnce"); + }, + "writeOnce", + ); + refused( + &|source| { + source["recordTypes"]["application"]["attachments"][0]["writeOnce"] = json!(false) + }, + "breg.attachment.write-once-required", + ); + refused( + &|source| { + source["accessProfiles"]["viewer"]["permissions"]["records"][0] + ["readableAttachments"] = json!(["missing"]); + }, + "breg.access-profile.attachment-grant-invalid", + ); + refused( + &|source| { + let grant = &mut source["accessProfiles"]["clerk"]["permissions"]["records"][0]; + grant["operations"] = json!(["list"]); + }, + "breg.access-profile.attachment-grant-invalid", + ); + refused( + &|source| { + source["actions"]["register"]["plan"]["effects"][0]["attachments"] = + json!({"missing":{"fromAttachment":"evidence"}}); + }, + "breg.action.attachment-invalid", + ); + refused( + &|source| { + source["actions"]["register"]["plan"]["effects"][0]["attachments"] = + json!({"evidence":{"fromAttachment":"name"}}); + }, + "breg.action.attachment-invalid", + ); + // `rename` declares only the `support` Proposal slot, so there is no + // `evidence` file to promote. + refused( + &|source| { + source["actions"]["rename"]["plan"]["effects"][0]["attachments"] = + json!({"evidence":{"fromAttachment":"evidence"}}); + }, + "breg.action.attachment-invalid", + ); + // As a Proposal Action, `register` declares no Proposal slot, so its + // effect names a file nothing can promote. + refused( + &|source| { + source["actions"]["register"]["execution"] = json!({"mode":"proposal","proposal":{"review":{"type":"none"}, + "application":{"mode":"manual"},"retention":{"mode":"operator-erase"}}}); + source["accessProfiles"]["clerk"]["permissions"]["actions"][0]["operations"] = + json!(["start"]); + }, + "breg.action.attachment-invalid", + ); +} + +#[test] +fn generated_contracts_publish_the_slot_download_and_the_invoke_file_member() { + let compiled = registry(); + let artifact = |path: &str| -> Value { + serde_json::from_slice(&compiled.artifacts().get(path).expect(path).bytes).unwrap() + }; + let openapi = artifact("generated/openapi.json"); + let download = + &openapi["paths"]["/v1/records/applications/{record_id}/attachments/evidence"]["get"]; + assert_eq!( + download["operationId"], + "records.application.get.attachment.evidence" + ); + assert_eq!(download["x-registry-attachmentSlot"], "evidence"); + // Only the profiles whose grant names the slot are listed. + assert_eq!( + download["x-registry-accessProfiles"], + json!(["auditor", "clerk"]) + ); + let content = download["responses"]["200"]["content"].as_object().unwrap(); + assert_eq!( + content.keys().cloned().collect::>(), + BTreeSet::from(["application/pdf".to_owned(), "text/plain".to_owned()]) + ); + assert_eq!(content["text/plain"]["schema"]["maxLength"], 64); + assert!(download["responses"]["200"]["headers"]["Repr-Digest"].is_object()); + // A record type with no slot has no download path. + assert!(openapi["paths"] + .as_object() + .unwrap() + .keys() + .all( + |path| !path.starts_with("/v1/records/programmes/") || !path.contains("/attachments/") + )); + + let invoke = artifact("generated/action-schemas/register.invoke.input.schema.json"); + assert!(invoke["required"] + .as_array() + .unwrap() + .contains(&json!("attachments"))); + let files = &invoke["properties"]["attachments"]; + assert_eq!(files["required"], json!(["evidence"])); + assert_eq!(files["additionalProperties"], json!(false)); + let evidence = &files["properties"]["evidence"]; + assert_eq!( + evidence["required"], + json!(["contentType", "sha256", "content"]) + ); + assert_eq!( + evidence["properties"]["contentType"]["enum"] + .as_array() + .unwrap() + .iter() + .map(|value| value.as_str().unwrap().to_owned()) + .collect::>(), + BTreeSet::from(["application/pdf".to_owned(), "text/plain".to_owned()]) + ); + assert_eq!(evidence["x-registry-attachmentSlot"], "evidence"); + let validator = jsonschema::JSONSchema::options() + .with_draft(jsonschema::Draft::Draft202012) + .compile(&invoke) + .unwrap(); + let programme = Uuid::nil(); + assert!( + validator.is_valid(&json!({"input":register_input(programme), + "attachments":{"evidence":file("text/plain", EVIDENCE)}})) + ); + assert!(!validator.is_valid(&json!({"input":register_input(programme)}))); + assert!( + !validator.is_valid(&json!({"input":register_input(programme), + "attachments":{"evidence":file("image/png", EVIDENCE)}})) + ); + // A Proposal-mode Action carries no record file member. + let start = artifact("generated/action-schemas/rename.invoke.input.schema.json"); + assert!(start["properties"].get("attachments").is_none()); +} + +#[test] +fn the_invoke_operation_documents_every_file_refusal() { + let compiled = registry(); + let openapi: Value = serde_json::from_slice( + &compiled + .artifacts() + .get("generated/openapi.json") + .unwrap() + .bytes, + ) + .unwrap(); + let examples = |path: &str, status: &str| -> BTreeSet { + openapi["paths"][path]["post"]["responses"][status]["content"]["application/problem+json"] + ["examples"] + .as_object() + .map(|examples| examples.keys().cloned().collect()) + .unwrap_or_default() + }; + for (status, code) in [ + ("413", "attachment.too-large"), + ("415", "attachment.content-type"), + ("422", "attachment.digest-mismatch"), + ("409", "attachment.slot-write-once"), + ] { + assert!( + examples("/v1/actions/register", status).contains(code), + "{status} {code}" + ); + // An Action that takes no request files answers none of them. + assert!( + !examples("/v1/actions/rename", status).contains(code), + "{status} {code}" + ); + } + assert_eq!( + openapi["paths"]["/v1/actions/register"]["post"]["responses"]["413"]["content"] + ["application/problem+json"]["examples"]["attachment.too-large"]["value"]["title"], + "Content Too Large" + ); +} diff --git a/crates/registry-breg/tests/postgres_record_timers/action_guard_regressions.rs b/crates/registry-breg/tests/postgres_record_timers/action_guard_regressions.rs index fc306ac469..d283da46b5 100644 --- a/crates/registry-breg/tests/postgres_record_timers/action_guard_regressions.rs +++ b/crates/registry-breg/tests/postgres_record_timers/action_guard_regressions.rs @@ -80,6 +80,49 @@ async fn create_only_timer_executes_when_the_anchor_guard_allows_it() { harness.database.cleanup().await; } +/// A timer has no request to carry files, so `bregctl check` refuses a timer +/// Action that fills a record slot. A compiled registry that binds a file to +/// one anyway must not commit the record without it. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn a_create_whose_declared_file_never_arrived_commits_nothing() { + let mut source = create_only_guard_source("status", "scheduled"); + source["recordTypes"]["activation-log"]["attachments"] = json!([{"id":"evidence", + "maximumBytes":64,"contentTypes":["text/plain"],"classification":"internal", + "writeOnce":true}]); + let mut wire = serde_json::to_value(compile_registry(source)).unwrap(); + let action = wire["actionInventory"]["actions"] + .as_array_mut() + .unwrap() + .iter_mut() + .find(|action| action["id"] == "activate-service") + .expect("the timer Action is compiled"); + action["attachments"] = json!({"evidence":{"effectId":"activation-log", + "recordType":"activation-log","slotId":"evidence","maximumBytes":64, + "contentTypes":["text/plain"]}}); + let registry: registry_breg::CompiledRegistry = serde_json::from_value(wire).unwrap(); + let harness = timer_outcome_harness(registry, "record-timer-undelivered-file", 0x6e).await; + let created = create_outcome_service( + &harness, + "undelivered-file", + "scheduled", + Utc::now() - chrono::Duration::seconds(1), + None, + None, + ) + .await; + let record_id = response_id(&created); + timer_occurrence(&harness.database, &record_id).await; + let before = create_only_effect_counts(&harness).await; + + let ran = harness.worker(Duration::from_secs(2)).run_once().await; + assert_eq!( + create_only_effect_counts(&harness).await, + before, + "a create whose declared file never arrived commits nothing: {ran:?}" + ); + harness.database.cleanup().await; +} + fn create_only_guard_source(field: &str, expected: &str) -> Value { let mut source = timer_project_source(); source["datasets"] diff --git a/crates/registry-breg/tests/schema_fingerprint_rehearsal.rs b/crates/registry-breg/tests/schema_fingerprint_rehearsal.rs index 1260376520..bf91d2593f 100644 --- a/crates/registry-breg/tests/schema_fingerprint_rehearsal.rs +++ b/crates/registry-breg/tests/schema_fingerprint_rehearsal.rs @@ -33,10 +33,13 @@ const SOURCE_REVISION: &str = "rehearsal-source-revision"; // the always-present Record timer ledger, retention function, bounded state/block // observation index, partial activation-preview index, the hand-off // refusal code column, and the subject access log access-reason and -// access-kind columns. The migration ledger bounds statement checksums at -// 4,096 entries. +// access-kind columns, the index of Proposal results by target revision, the +// registry_record_attachments table of record file references, and the +// record attachment live-reference index, and nullable file metadata with +// live/erased shape constraints for stripped Record/Proposal attachment +// erasure markers. The migration ledger bounds statement checksums at 4,096 entries. const PORTABLE_SCHEMA_FINGERPRINT: &str = - "sha256:f982a1bdde2a0532f7b9c2e43f05d1ac7261cda6e6c7907cb16bb946b8ca2c79"; + "sha256:c58b5cd1466d9b41b9a9d71caac5076abc285cd4567861d15a048659d518bf1b"; const FIXTURE_JOURNEYS: &[u8] = br#"apiVersion: id.registrystack.org/formats/breg/journeys/v1 kind: BRegJourneys journeys: [] diff --git a/crates/registry-breg/tests/support/client_http.rs b/crates/registry-breg/tests/support/client_http.rs index 838d4e8482..5e092bc54b 100644 --- a/crates/registry-breg/tests/support/client_http.rs +++ b/crates/registry-breg/tests/support/client_http.rs @@ -89,12 +89,56 @@ impl ClientFixture { registry: registry_breg::CompiledRegistry, claims: VerifiedRequestClaims, configure: impl FnOnce(PostgresRecordMutationService) -> PostgresRecordMutationService, + ) -> Self { + Self::start_with_pool(registry, claims, 8, configure).await + } + + /// The same services with record reads and writes bound to one + /// attachment storage, as startup binds them. `configure` adds the rest + /// of the mutation setup. + pub async fn start_with_attachment_storage( + registry: registry_breg::CompiledRegistry, + claims: VerifiedRequestClaims, + storage: registry_breg::attachment_storage::AttachmentStorage, + configure: impl FnOnce(PostgresRecordMutationService) -> PostgresRecordMutationService, + ) -> Self { + let mutation_storage = storage.clone(); + Self::start_with_services(registry, claims, 8, storage, move |mutations| { + configure(mutations.with_attachment_storage(mutation_storage)) + }) + .await + } + + /// The same services over a runtime pool of `pool_size` connections, for + /// proving that one request never holds two pooled connections at once. + pub async fn start_with_pool( + registry: registry_breg::CompiledRegistry, + claims: VerifiedRequestClaims, + pool_size: usize, + configure: impl FnOnce(PostgresRecordMutationService) -> PostgresRecordMutationService, + ) -> Self { + Self::start_with_services( + registry, + claims, + pool_size, + registry_breg::attachment_storage::AttachmentStorage::Database, + configure, + ) + .await + } + + async fn start_with_services( + registry: registry_breg::CompiledRegistry, + claims: VerifiedRequestClaims, + pool_size: usize, + read_storage: registry_breg::attachment_storage::AttachmentStorage, + configure: impl FnOnce(PostgresRecordMutationService) -> PostgresRecordMutationService, ) -> Self { assert!( !registry.ddl().requires_postgis, "spatial SDK tests use SpatialHarness" ); - let database = TestDatabase::create(8).await; + let database = TestDatabase::create(pool_size).await; if registry.ddl().requires_btree_gist { database .admin @@ -137,7 +181,8 @@ impl ClientFixture { Duration::from_secs(2), audit.clone(), cursors.clone(), - ); + ) + .with_attachment_storage(read_storage); let mutations = Arc::new(configure(PostgresRecordMutationService::new( pool.clone(), registry.clone(), diff --git a/crates/registry-bregctl/src/history_erasure_lifecycle.rs b/crates/registry-bregctl/src/history_erasure_lifecycle.rs index 174edfb8c4..23119aebcb 100644 --- a/crates/registry-bregctl/src/history_erasure_lifecycle.rs +++ b/crates/registry-bregctl/src/history_erasure_lifecycle.rs @@ -68,6 +68,9 @@ pub(crate) struct HistoryErasureLifecycleOutcome { pub scrubbed_proposal_target_count: u64, pub scrubbed_proposal_submission_count: u64, pub removed_descriptor_count: u64, + pub erased_file_reference_count: u64, + pub kept_file_reference_count: u64, + pub removed_proposal_link_count: u64, } pub(crate) fn run( @@ -84,6 +87,13 @@ pub(crate) fn run( let package = config .load_active_package() .map_err(HistoryErasureLifecycleError::Package)?; + let target = RecordHistoryErasureTarget::new( + &erasure.entity_id, + record_id, + erasure.erase_through_revision, + ) + .with_erase_files(package.registry(), &erasure.erase_files) + .map_err(HistoryErasureLifecycleError::Erasure)?; let migration_connection = config .migration_database_connection_config() .map_err(|_| HistoryErasureLifecycleError::DatabaseConfiguration)?; @@ -117,11 +127,7 @@ pub(crate) fn run( audit: &audit, operator_reference: &erasure.operator_reference, reason: &erasure.reason, - target: RecordHistoryErasureTarget::new( - &erasure.entity_id, - record_id, - erasure.erase_through_revision, - ), + target, }, )) .map_err(HistoryErasureLifecycleError::Erasure)?; @@ -146,6 +152,9 @@ fn outcome_report( scrubbed_proposal_target_count: outcome.scrubbed_proposal_target_count, scrubbed_proposal_submission_count: outcome.scrubbed_proposal_submission_count, removed_descriptor_count: outcome.removed_descriptor_count, + erased_file_reference_count: outcome.erased_file_reference_count, + kept_file_reference_count: outcome.kept_file_reference_count, + removed_proposal_link_count: outcome.removed_proposal_link_count, } } @@ -163,6 +172,8 @@ struct RawHistoryErasureRequest { entity_id: String, record_id: String, erase_through_revision: i64, + #[serde(default)] + erase_files: Vec, operator_reference: String, reason: String, } @@ -251,6 +262,9 @@ mod tests { scrubbed_proposal_target_count: 2, scrubbed_proposal_submission_count: 1, removed_descriptor_count: 0, + erased_file_reference_count: 1, + kept_file_reference_count: 2, + removed_proposal_link_count: 3, }, ); assert_eq!(report.package_revision, "pkg-1"); @@ -262,6 +276,9 @@ mod tests { assert_eq!(report.scrubbed_ingestion_receipt_count, 1); assert_eq!(report.scrubbed_proposal_target_count, 2); assert_eq!(report.scrubbed_proposal_submission_count, 1); + assert_eq!(report.erased_file_reference_count, 1); + assert_eq!(report.kept_file_reference_count, 2); + assert_eq!(report.removed_proposal_link_count, 3); } #[test] @@ -278,6 +295,17 @@ mod tests { .expect("complete request parses"); assert_eq!(parsed.entity_id, "membership"); assert_eq!(parsed.erase_through_revision, 1); + assert!(parsed.erase_files.is_empty()); + let selected = parse_erasure_request_bytes( + br#"{ + "recordType":"membership", + "recordId":"018feaa0-68f9-4a45-b9e3-58436df07af7", + "eraseThroughRevision":1, "eraseFiles":["evidence"], + "operatorReference":"ops-ticket-1", "reason":"retention request" + }"#, + ) + .expect("explicit file selection parses"); + assert_eq!(selected.erase_files, ["evidence"]); let valid = serde_json::json!({ "recordType": "membership", @@ -287,6 +315,9 @@ mod tests { "reason": "retention request" }); for mutate in [ + |request: &mut serde_json::Value| request["eraseFiles"] = serde_json::Value::Null, + |request: &mut serde_json::Value| request["eraseFiles"] = serde_json::json!("evidence"), + |request: &mut serde_json::Value| request["eraseFiles"] = serde_json::json!([1]), |request: &mut serde_json::Value| request["extra"] = serde_json::json!("refused"), |request: &mut serde_json::Value| request["recordType"] = serde_json::json!(""), |request: &mut serde_json::Value| request["recordType"] = serde_json::Value::Null, diff --git a/crates/registry-bregctl/src/lib.rs b/crates/registry-bregctl/src/lib.rs index e9ef6754d4..86844ad5a0 100644 --- a/crates/registry-bregctl/src/lib.rs +++ b/crates/registry-bregctl/src/lib.rs @@ -14224,6 +14224,18 @@ fn write_history_erase_success( "erased revisions", report.outcome.erased_revision_count.to_string(), ), + ( + "erased file references", + report.outcome.erased_file_reference_count.to_string(), + ), + ( + "kept file references", + report.outcome.kept_file_reference_count.to_string(), + ), + ( + "removed Proposal links", + report.outcome.removed_proposal_link_count.to_string(), + ), ( "erased commit members", report.outcome.erased_commit_member_count.to_string(), @@ -17363,6 +17375,9 @@ mod tests { scrubbed_proposal_target_count: 1, scrubbed_proposal_submission_count: 0, removed_descriptor_count: 0, + erased_file_reference_count: 1, + kept_file_reference_count: 2, + removed_proposal_link_count: 3, }, }; let mut stdout = Vec::new(); @@ -17376,9 +17391,27 @@ mod tests { assert!(rendered.contains("\"command\": \"history erase\"")); assert!(rendered.contains("\"scrubbedCachedResponseCount\": 1")); assert!(rendered.contains("\"scrubbedIngestionReceiptCount\": 1")); + assert!(rendered.contains("\"erasedFileReferenceCount\": 1")); + assert!(rendered.contains("\"keptFileReferenceCount\": 2")); + assert!(rendered.contains("\"removedProposalLinkCount\": 3")); assert!(!rendered.contains("018feaa0-68f9-4a45-b9e3-58436df07af7")); assert!(!rendered.contains("operator")); assert!(!rendered.contains("reason")); + let mut human = Vec::new(); + assert_eq!( + write_history_erase_success(&report, OutputFormat::Human, &mut human, &mut stderr), + ExitCode::SUCCESS + ); + let human = String::from_utf8(human).unwrap(); + for (label, count) in [ + ("erased file references", "1"), + ("kept file references", "2"), + ("removed Proposal links", "3"), + ] { + assert!(human + .lines() + .any(|line| line.contains(label) && line.trim_end().ends_with(count))); + } } #[test] diff --git a/crates/registry-bregctl/tests/tool_schema.rs b/crates/registry-bregctl/tests/tool_schema.rs index b4802bebfa..4e3231e606 100644 --- a/crates/registry-bregctl/tests/tool_schema.rs +++ b/crates/registry-bregctl/tests/tool_schema.rs @@ -610,9 +610,9 @@ fn the_reader_accepts_every_word_the_migration_descriptor_schema_enumerates() { checked += 1; } } - // 3 change classes, 66 change codes, 15 target kinds, 1 recovery, + // 3 change classes, 69 change codes, 16 target kinds, 1 recovery, // 2 history choices, 4 object kinds, and 1 cursor protocol. - assert_eq!(checked, 92); + assert_eq!(checked, 96); let steps = &definitions["ReviewedMigrationStepDescriptor"]["oneOf"]; let types: Vec<&str> = steps diff --git a/crates/registry-stack-client-node/breg/client.d.ts b/crates/registry-stack-client-node/breg/client.d.ts index da5e091a9a..4c283e7481 100644 --- a/crates/registry-stack-client-node/breg/client.d.ts +++ b/crates/registry-stack-client-node/breg/client.d.ts @@ -953,6 +953,8 @@ export declare class BaseRegistryClient { registryContract(accessProfile?: string | null, request?: ReadRequestOptions): Promise recordSchema(recordTypeIdentifier: string, accessProfile?: string | null, request?: ReadRequestOptions): Promise recordRevisions(recordRoute: string, recordIdentifier: string, accessProfile?: string | null, request?: ReadRequestOptions): Promise + /** Download one record attachment slot. The bytes are returned only when they match the service's `Repr-Digest`. */ + downloadRecordAttachment(recordRoute: string, recordIdentifier: string, slot: string, accessProfile?: string | null): Promise getRecordRevision(recordRoute: string, recordIdentifier: string, revision: SafeInteger, options?: RecordProjectionOptions | null, request?: ReadRequestOptions): Promise getRecord(recordRoute: string, recordIdentifier: string, options?: RecordOptions | null, request?: ReadRequestOptions): Promise> listRecords(recordRoute: string, options?: ListOptions | null, request?: ReadRequestOptions): Promise diff --git a/crates/registry-stack-client-node/breg/client.js b/crates/registry-stack-client-node/breg/client.js index 3de127454f..c5af4483ca 100644 --- a/crates/registry-stack-client-node/breg/client.js +++ b/crates/registry-stack-client-node/breg/client.js @@ -294,6 +294,7 @@ for (const [method, jsonIndexes, requiredIndexes] of [ ['patchRecord', [3], [3]], ['batchRecords', [1], [1]], ['tombstoneRecord'], ['startProposal', [1], [1]], ['readProposal'], ['readProposalSubmission'], ['getProposal'], ['listProposals', [1], [1]], ['executeProposal'], ['listProposalsJson'], ['downloadProposalAttachment'], ['uploadProposalAttachment'], ['deleteProposalAttachment'], + ['downloadRecordAttachment'], ['readProposalReviewStatus'], ['readProposalReviewStatusWithProgress'], ['readProposalReviewContext'], ['readProposalReviewContextBatch', [1], [1]], ['readProposalReviewById'], ['downloadProposalReviewDocument', [1], [1]], diff --git a/crates/registry-stack-client-node/breg/index.d.ts b/crates/registry-stack-client-node/breg/index.d.ts index 7966651caa..2d308a4fbd 100644 --- a/crates/registry-stack-client-node/breg/index.d.ts +++ b/crates/registry-stack-client-node/breg/index.d.ts @@ -20,6 +20,11 @@ export declare class BaseRegistryClient { recordSchema(recordTypeIdentifier: string, accessProfile?: string | undefined | null, cancellation?: ReadCancellation | undefined | null): Promise /** Retrieve one bounded first page of record revisions as inert JSON. */ recordRevisions(recordRoute: string, recordIdentifier: string, accessProfile?: string | undefined | null, cancellation?: ReadCancellation | undefined | null): Promise + /** + * Download the file in one record attachment slot. The bytes are + * returned only when they match the service's `Repr-Digest`. + */ + downloadRecordAttachment(recordRoute: string, recordIdentifier: string, slot: string, accessProfile?: string | undefined | null): Promise /** Retrieve one exact retained revision as validated inert record JSON. */ getRecordRevision(recordRoute: string, recordIdentifier: string, revision: number, options?: any | undefined | null, cancellation?: ReadCancellation | undefined | null): Promise /** diff --git a/docs/site/scripts/breg-api-reference.test.mjs b/docs/site/scripts/breg-api-reference.test.mjs index 5e2fd1bf23..4a64fbccc3 100644 --- a/docs/site/scripts/breg-api-reference.test.mjs +++ b/docs/site/scripts/breg-api-reference.test.mjs @@ -38,6 +38,7 @@ test('routes include governed access-log, native Proposal attachment, and GIS su const rows = new Map(routes.rows.map((row) => [row[0], row])); const expected = [ ['`GET /v1/records/{route}/{record_id}/access-log`', ['declares `accessLog`', 'current subject']], + ['`GET /v1/records/{route}/{record_id}/attachments/{slot_id}`', ['declares the slot in `attachments`', '`readableAttachments`']], ['`GET /v1/proposals/{proposal_id}/attachments/{slot_id}`', ['declares the slot', 'caller-authorized download']], ['`PATCH /v1/proposals/{proposal_id}/attachments/{slot_id}`', ['Draft Proposal', 'caller-authorized upload']], ['`DELETE /v1/proposals/{proposal_id}/attachments/{slot_id}`', ['Draft Proposal', 'caller-authorized removal']], @@ -91,5 +92,7 @@ test('native Action and Proposal route families agree with the canonical generat } assert.ok(!JSON.stringify(tables).includes('changeRequest')); assert.ok(!JSON.stringify(tables).includes('submit-request')); - assert.ok(!table('routes').rows.some((row) => /records.*attachments/.test(row[0]))); + // A record slot is written only by an immediate Action create effect, so no + // direct record route writes or removes a file. + assert.ok(!table('routes').rows.some((row) => /^`(POST|PATCH|PUT|DELETE) \/v1\/records.*attachments/.test(row[0]))); }); diff --git a/docs/site/src/content/docs/configure/breg-proposals.mdx b/docs/site/src/content/docs/configure/breg-proposals.mdx index 4a2b32b9fd..29615ebaa2 100644 --- a/docs/site/src/content/docs/configure/breg-proposals.mdx +++ b/docs/site/src/content/docs/configure/breg-proposals.mdx @@ -642,6 +642,58 @@ The facility template combines supporting-document display with current Record a {/* Evidence: crates/registry-breg/tests/postgres_facility_proposal.rs supporting-document; crates/registry-breg/src/compiler/review_context.rs review_context. */} +## Keep a supporting document on the record + +A Proposal file can stay with the record that the Proposal writes. +The record type declares a file slot, as [Keep a file with a Record](../breg/#keep-a-file-with-a-record) explains. +A create or patch effect then names the Proposal slot that fills it: + +```yaml + plan: + type: fixed + effects: + - id: application + target: {fromInput: application} + operation: patch + set: {status: {fromInput: status}} + attachments: + evidence: {fromAttachment: supporting-document} +``` + +The key is the record slot. `fromAttachment` names the Proposal slot. +Applying the Proposal promotes the file it froze at submission. +The record slot then refers to the same stored bytes, so nothing is copied. +The reference commits with the record revision the effect writes, or nothing commits. +An optional Proposal slot that was empty at submission leaves the record slot empty. + +`bregctl check` refuses a promotion when: + +- the Action does not declare the Proposal slot +- the target record type does not declare the record slot +- the Proposal slot accepts a media type that the record slot does not +- the Proposal slot accepts files larger than the record slot's `maximumBytes` +- the record slot's `classification` is less restricted than the Proposal slot's, such as `internal` for a `restricted` file +- two promotions fill one slot of one record + +Each refusal is `breg.action.attachment-invalid`. + +Record slots are write-once. +When the record slot already holds a file, Apply answers `409 attachment.slot-write-once`. +When verification of the Proposal file is pending or has rejected it, Apply answers `412 precondition.failed`. +In both cases nothing from the apply commits. + +Callers read the promoted file through the record, under the record grant's `readableAttachments`. +Operator erasure of the Proposal keeps bytes that a record refers to. + +{/* Evidence: crates/registry-breg/src/immediate_actions.rs, compile_attachment_promotions; + crates/registry-breg/src/mutation/proposal.rs, promote_proposal_attachments; + crates/registry-breg/tests/attachment_promotion_compiler.rs; + crates/registry-breg/tests/postgres_record_attachments.rs, + an_applied_proposal_promotes_its_file_by_reference_and_erasure_keeps_it, + promotion_into_a_filled_slot_answers_409_and_rolls_back_the_whole_apply; + crates/registry-breg/tests/postgres_proposal_s3.rs, + promotion_references_the_verified_s3_object_and_refuses_unverified_bytes. */} + ## Retain or erase detail `retain` keeps detail. diff --git a/docs/site/src/content/docs/configure/breg.mdx b/docs/site/src/content/docs/configure/breg.mdx index 91c86f8f1b..5cdc13c02b 100644 --- a/docs/site/src/content/docs/configure/breg.mdx +++ b/docs/site/src/content/docs/configure/breg.mdx @@ -153,6 +153,102 @@ delivery. {/* Evidence: crates/registry-breg/src/contract.rs (RegistryProject, PermissionsSource); products/breg/generated/authoring/registry-project.schema.json. */} +## Keep a file with a Record + +A Record type can keep a file, such as a signed form, beside its fields. +Declare each file slot under `attachments` on the Record type: + +```yaml + application: + route: applications + primaryDataset: directory + mutationMode: mutable + attachments: + - id: evidence + maximumBytes: 1048576 + contentTypes: [application/pdf] + classification: restricted + writeOnce: true +``` + +A slot declares its byte limit, its accepted media types and its classification. +A Record type declares at most eight slots, each up to 16 MiB with at most 16 media types. +A slot ID cannot reuse a field ID. +`writeOnce: true` is required, because nothing replaces a file once a slot holds one. +A successor package can add slots, but it must keep every existing slot ID and definition unchanged. + +Two things fill a slot: the create effect of an immediate Action, or an applied Proposal that promotes one of its files. +[Keep a supporting document on the record](../breg-proposals/#keep-a-supporting-document-on-the-record) covers the Proposal path. +An immediate Action's effect names the slot and the request file that fills it: + +```yaml + plan: + type: fixed + effects: + - id: application + target: {recordType: application} + operation: create + set: {name: {fromInput: name}} + attachments: + evidence: {fromAttachment: evidence} +``` + +`bregctl check` refuses a request file on a patch effect, an Action with Evidence and a timer Action. +A file name cannot reuse an Action input ID or `apiName`. + +Send `Content-Type: application/json`. +The request carries every file the Action names in `attachments`, beside `input`. +Each file has its media type, its SHA-256 digest in lowercase hexadecimal and its base64 content: + +```json +{ + "input": {"name": "Example applicant"}, + "attachments": { + "evidence": {"contentType": "application/pdf", "sha256": "", "content": ""} + } +} +``` + +BReg checks every file before it writes anything: + +| Problem | Status | Cause | +| --- | --- | --- | +| `attachment.content-type` | 415 | The media type is not one the slot declares. | +| `attachment.too-large` | 413 | The file is larger than the slot's `maximumBytes`. | +| `attachment.digest-mismatch` | 422 | The digest does not match the bytes. | +| `action.guard_failed` | 412 | A commit guard failed, so nothing was written. | +| `attachment.slot-write-once` | 409 | The slot already holds a file. | + +The record, its history, the file reference, the idempotency receipt and any hook event commit together, or none of them commits. +Hook events never carry file bytes. + +Reading a file needs its own grant. +The slot's classification label does not restrict downloads. +List the slot in `readableAttachments` on a record grant that includes `get`: + +```yaml +records: + - recordType: application + operations: [get] + readableFields: [name] + readableAttachments: [evidence] +``` + +The caller downloads the file from `GET /v1/records/applications/{record_id}/attachments/evidence`. +The response has the stored media type and a `Repr-Digest` header with the stored SHA-256 digest. +A profile without the grant gets 404. +So do a record outside the profile's row boundaries, an empty slot and a file that verification has not approved. +When the Record type keeps an [access log](../../operate/breg-access-log/), each download is recorded in it. +History erasure keeps a current file by default. +To erase it, name its slot in `eraseFiles`, as [Erase retained history](../../operate/breg-retention/#erase-retained-history) explains. +History erasure removes Proposal links to erased revisions even when the current file remains. + +{/* Evidence: crates/registry-breg/src/contract.rs (RecordAttachmentSlotSource, EffectAttachmentSource); + crates/registry-breg/src/compiler/attachments.rs validate_record_slots(); + crates/registry-breg/src/api/record_attachments.rs; + crates/registry-breg/src/attachment_store.rs, load_record_attachment; + crates/registry-breg/tests/postgres_record_attachments.rs. */} + ## Generate business identifiers The UUID in each Record envelope remains the stable Record identity. diff --git a/docs/site/src/content/docs/operate/breg-changes.mdx b/docs/site/src/content/docs/operate/breg-changes.mdx index a715f3a035..880f167012 100644 --- a/docs/site/src/content/docs/operate/breg-changes.mdx +++ b/docs/site/src/content/docs/operate/breg-changes.mdx @@ -542,7 +542,8 @@ bregctl field-encryption erase-history --runtime-config /etc/breg/runtime.yaml \ The request names no Record or field: its scope is the recorded `erase-and-rebaseline` flips, and a file with any other key, or one other users can read, is refused before a connection opens. For each affected Record it uses the same erasure as [`history erase`](../breg-retention/#erase-retained-history), -then restores snapshot coverage with one rebaseline, which blocks reads and writes until it commits; +including its effect on applied Proposals, and keeps the Record's files. It then restores snapshot +coverage with one rebaseline, which blocks reads and writes until it commits; run it in a maintenance window as [restore snapshot coverage](../breg-retention/#restore-snapshot-coverage-after-an-erasure) describes. Backups taken before the flip still hold plaintext until you retire them. diff --git a/docs/site/src/content/docs/operate/breg-monitor.mdx b/docs/site/src/content/docs/operate/breg-monitor.mdx index a63975dadb..991f8bb634 100644 --- a/docs/site/src/content/docs/operate/breg-monitor.mdx +++ b/docs/site/src/content/docs/operate/breg-monitor.mdx @@ -345,7 +345,7 @@ Branch on the schema, because a historical schema version keeps its historical m These event classes use these schemas: - Requests, terminal responses, refusals, unfinished responses, and Review recovery: `breg-audit/v3`. -- History erasure: `breg-history-erasure-audit/v3`. +- History erasure: `breg-history-erasure-audit/v4`. - History rebaseline: `breg-history-rebaseline-audit/v3`. - Field encryption maintenance: `breg-field-encryption-audit/v3`. - Attachment verification: `breg-attachment-verification-audit/v3`. @@ -359,7 +359,7 @@ These event classes use these schemas: {/* Evidence: crates/registry-breg/tests/fixtures/audit-identity-goldens.json; crates/registry-breg/tests/support/postgres_harness.rs; crates/registry-breg/src/audit.rs, breg-audit/v3 and breg-hook-audit/v1; - crates/registry-breg/src/history_erasure.rs, breg-history-erasure-audit/v3; + crates/registry-breg/src/history_erasure.rs, breg-history-erasure-audit/v4; crates/registry-breg/src/history_rebaseline.rs, breg-history-rebaseline-audit/v3; crates/registry-breg/src/field_encryption_backfill.rs, breg-field-encryption-audit/v3; crates/registry-breg/src/attachment_verification_worker.rs, breg-attachment-verification-audit/v3; diff --git a/docs/site/src/content/docs/operate/breg-retention.mdx b/docs/site/src/content/docs/operate/breg-retention.mdx index 390e99ef9e..ee85756cda 100644 --- a/docs/site/src/content/docs/operate/breg-retention.mdx +++ b/docs/site/src/content/docs/operate/breg-retention.mdx @@ -17,8 +17,8 @@ tutorial_test: skip: Every command needs an active registry on your own PostgreSQL and the migration credential from its runtime file. --- -You run an active registry under an institutional retention policy and hold its migration -credential. This page shows you how to erase retained record history and Proposal detail, restore +You run a Base Registry Engine (BReg) registry under an institutional retention policy. +You hold its migration credential. This page shows you how to erase retained record history and Proposal detail, restore snapshot coverage afterwards, drop expired Evidence and idempotency material, and keep the audit journal. @@ -34,9 +34,9 @@ The examples use the record types and Actions of the facility template. | Command | Removes for good | Leaves in place | | --- | --- | --- | -| `history erase` | The retained revisions of one record up to a revision number, the correction context and outbox payloads that referenced them, and the held responses that could replay them. | The current record, every later revision, the audit journal, and each spent idempotency key. | +| `history erase` | Retained revisions through the boundary, their correction context and outbox payloads, held record responses, Proposal links to erased revisions, and files explicitly named in `eraseFiles`. | The current record, unnamed files, later revisions, applied Proposals and their apply receipts, the audit journal, spent keys, and bytes another reference needs. | | `proposal-retention erase` | The payload detail of one Proposal submission version: frozen snapshots, draft input, application reasons, Review payloads, held responses, and attachment references. | The Proposal's value-free state history, record history, and each spent idempotency key. | -| `proposal-retention cleanup-attachments` | Unreferenced attachment bytes in external storage that are waiting for deletion. | Live attachment references, Proposal detail, and deletion tombstones. | +| `proposal-retention cleanup-attachments` | Unreferenced attachment bytes in external storage that are waiting for deletion, from Proposals and from records. | Live attachment references, Proposal detail, and deletion tombstones. | | `evidence-retention erase-expired` | The signed Evidence responses and verification context an Action kept, once their 24-hour window has closed. | Assertions still inside their window, and the receipts of the Actions that used them. | | `idempotency-retention erase-expired` | Held responses past their horizon, with the raw issuer, principal value, and key each was sent under. | Every spent key, as a digest, so a retry is still refused rather than run. | @@ -89,27 +89,30 @@ bregctl history erase \ --acknowledge-irreversible ``` -```text -Erased the requested history. 1 commit affected. - package revision sha256:1d38a738597da4a8254a53f3cb5ad6889243374134eb9c0c4dda1768fd78750b - coverage ready true - unavailable after position 0 - affected commits 1 - erased revisions 1 - erased commit members 1 - scrubbed change contexts 0 - scrubbed outbox payloads 0 - scrubbed cached responses 1 - scrubbed Proposal targets 0 - scrubbed Proposal submissions 0 - removed descriptors 0 -``` +The report and audit entry count erased file references, kept file references and removed Proposal links. -One run erases at most 10,000 revisions in one transaction. It replaces each held response that -could replay an erased revision with a refusal, so a retry of that key answers +One run erases at most 10,000 revisions in one transaction. It replaces each held record or batch +response that could replay an erased revision with a refusal, so a retry of that key answers `409 idempotency.key-reused` instead of returning the erased body. A request file that is not owner-only is refused before any connection opens. Live reads and writes continue. +A revision that an applied Proposal wrote is erased like any other revision. The Proposal keeps +its state and application. A current read of the Proposal leaves the erased revision out of +`resultLinks`, and record history shows no Proposal link for it. + +History erasure keeps the receipt of the original apply, which is a separate held response. The +same authorised caller can retry that apply with the same idempotency key. While the registry +[holds the response](#drop-expired-idempotency-responses), the retry returns the receipt as first +issued. Its `resultLinks` still name the record and the revision number. They carry no field values. + +The Proposal also still holds the values it froze and any file it carried. You can remove those and +the held receipt when your retention decision calls for it and the Action's retention mode allows +it. Follow [erase Proposal detail](#erase-proposal-detail) for that Proposal. Run +`bregctl proposal-retention dry-run` first, then `bregctl proposal-retention erase`. +Erasing a Record slot does not erase a Proposal that still holds the same file. +That Proposal's detail and held responses can still contain its digest. +Erase its detail separately when your retention decision requires both scopes. + Snapshot references at or after the earliest erased commit become unavailable, and erasing a record's baseline data makes all snapshot coverage unavailable. The next package still activates when the only gap is an erasure the database recorded as committed. Any other gap refuses a @@ -119,9 +122,58 @@ package again afterwards. {/* Evidence: crates/registry-bregctl/src/history_erasure_lifecycle.rs, RawHistoryErasureRequest (recordType) and load_erasure_request; crates/registry-bregctl/src/lib.rs, HistoryEraseArgs; - crates/registry-breg/src/history_erasure.rs, MAX_ERASURE_REVISIONS; + crates/registry-breg/src/history_erasure.rs, MAX_ERASURE_REVISIONS and + delete_proposal_result_links; crates/registry-breg/src/postgres/interlock.rs, history_coverage_admits_successor; - crates/registry-breg/tests/postgres_history_erasure.rs. */} + crates/registry-breg/src/mutation/proposal.rs, preflight_proposal_apply; + crates/registry-breg/src/proposal_retention.rs; + crates/registry-breg/tests/postgres_history_erasure.rs; + crates/registry-breg/tests/postgres_record_attachments.rs, + history_erasure_keeps_a_promoted_file_and_removes_the_link_to_the_erased_revision. */} + +### Files kept with the record + +A file belongs to the current record. +History erasure keeps its reference and bytes, so the download still works. +When the boundary reaches the revision that filled the slot, BReg clears who attached the file and when. + +To erase a file, add `eraseFiles` to the same request file and name its declared slot: + +```json +{"eraseFiles": ["evidence"]} +``` + +BReg checks every name against the verified active Record type before erasing anything. +An undeclared or repeated name is refused. +Omitting `eraseFiles` keeps every file. +You can name a file after its history is gone while history coverage remains ready. +That run reports zero erased revisions. +Without retained history or a live selected file, BReg refuses the request. + +:::caution[Erasing a live record's file is permanent] +A named slot loses its file reference in the erasure transaction. +Its download answers 404 and the slot cannot be filled again. +::: + +The erased slot keeps only its Record type, record ID, slot ID and erasure timestamp. +It keeps no digest, media type, size, attachment revision or attaching actor. +Bytes go once no other record and no Proposal refers to them. +The Proposal that promoted a file still refers to it, so those bytes stay until you erase the +Proposal's detail. +Database bytes go at once. +External bytes wait for [external attachment cleanup](#retry-external-attachment-cleanup). +An `erase-and-rebaseline` field-encryption migration keeps the record's files. + +{/* Evidence: crates/registry-breg/src/attachment_store.rs, erase_record_attachments and + retire_unreferenced; + crates/registry-breg/src/history_erasure.rs; + crates/registry-breg/tests/postgres_record_attachments.rs, + history_erasure_keeps_current_files_and_clears_their_attribution, + history_erasure_refuses_an_undeclared_file_slot_before_any_erasure, + a_retained_file_can_be_erased_after_its_history_is_gone, + record_erasure_removes_the_reference_then_the_bytes_nothing_else_refers_to, + history_erasure_keeps_a_promoted_file_and_removes_the_link_to_the_erased_revision, + erase_and_rebaseline_erases_a_revision_a_proposal_wrote. */} ## Restore snapshot coverage after an erasure @@ -244,13 +296,17 @@ Erased the retained Proposal. Listing again shows `"detailErased":true`. A pinned version, or an Action in `retain` mode, is refused and left intact: finish the Proposal under its ordinary authority first. Identical -attachment bytes stay while another retained reference needs them. A Review still waiting on -remote recovery keeps the exact request and acceptance that recovery needs. +attachment bytes stay while another retained reference needs them, including a record's file. So a file that the +applied Proposal promoted to a record stays readable through the record. A Review still waiting on remote recovery keeps +the exact request and acceptance that recovery needs. +Erased Proposal file references keep their slot identity and erasure timestamp, but no digest, media type, size or uploader metadata. {/* Evidence: crates/registry-breg/src/proposal_retention.rs, detail_is_pinned (draft, submitted), the cancelled/applied/rejected draft-input rule, RetainMode, and ActiveDetailPinned; crates/registry-breg/src/proposal_store.rs, Proposal states; - crates/registry-bregctl/src/lib.rs, ProposalRetentionCommand and ProposalRetentionExactArgs. */} + crates/registry-bregctl/src/lib.rs, ProposalRetentionCommand and ProposalRetentionExactArgs; + crates/registry-breg/tests/postgres_record_attachments.rs, + an_applied_proposal_promotes_its_file_by_reference_and_erasure_keeps_it. */} ## Retry external attachment cleanup diff --git a/docs/site/src/content/docs/reference/breg-api.mdx b/docs/site/src/content/docs/reference/breg-api.mdx index 47d76957c6..acc0e90a62 100644 --- a/docs/site/src/content/docs/reference/breg-api.mdx +++ b/docs/site/src/content/docs/reference/breg-api.mdx @@ -498,6 +498,21 @@ a batch appears only when the `revisions` grant lists `provenanceFields` (from ` `reasonCode`, `reasonText`, `sourceReferences`) and every revision that batch produced is visible to the caller. +A revision written by applying a Proposal carries an optional `proposal` member, +`{"actionId", "proposalId", "submissionVersion"}`, on list items and on revision detail. It names the +Proposal submission that produced the revision. The member appears only when the access profile +that reads the history could also read that Proposal: it needs a `proposals` grant with `get` for +the Action, the same ownership and row boundaries a Proposal read applies, and a plain (not task) +grant. Otherwise the member is absent and the response is the same as one for a revision no +Proposal produced. A revision written by an immediate Action, a direct write, a batch or an import +never carries it. Operator erasure of a Proposal's detail (`bregctl proposal-retention erase`) keeps +the link: the identifier and state survive, and the Proposal read reports that its detail was +erased. The member disappears once a record the Proposal targeted is tombstoned, because a Proposal +read sees only active target records. If the check cannot finish, the read answers +`503 source.unavailable` instead of leaving out the member. The generated OpenAPI document declares +`proposal` only for a registry with a Proposal Action, and the caller-filtered `/openapi.json` +declares it only on the revision routes where the caller would receive it. + A temporal Record type, one with `temporal.startField` and `temporal.endField`, gains `:current`, the records whose interval contains now, and `:as-of`, the records whose interval contains `asOf`. Intervals include the start and exclude the end; a null end is open. A `date` interval whose @@ -544,6 +559,10 @@ whose two-second database budget runs out answers `503 source.unavailable`. crates/registry-breg/src/query.rs, ParsedSnapshotQuery; crates/registry-breg/src/postgres/history_read.rs; crates/registry-breg/src/postgres/revision_read.rs; + crates/registry-breg/src/postgres/proposal.rs, proposal_link_readable; + crates/registry-breg/tests/postgres_proposal_security.rs, record_history_names_the_proposal_for_a_caller_who_can_read_it; + crates/registry-breg/tests/postgres_proposal_security.rs, record_history_is_unavailable_when_the_proposal_link_check_fails; + crates/registry-breg/tests/compiler_contract.rs, revision_schemas_declare_the_proposal_link_only_for_a_registry_with_proposal_actions; crates/registry-breg/src/history_erasure.rs; crates/registry-breg/tests/postgres_historical.rs. */} @@ -602,6 +621,14 @@ When `requiredConditionKeys` is empty, the descriptor advertises no target-condi the Invoke schema and runtime allow `preconditions` to be omitted or supplied as an empty object. Prefer to omit the member for such an Action. +Send `Content-Type: application/json`. +When the Action declares files, include every declared file in an `attachments` object beside `input`. +Each file has `contentType`, a lowercase hexadecimal `sha256` digest and base64 `content`. +The [record slot configuration](../../configure/breg/#keep-a-file-with-a-record) shows the request format. +Availability and target-condition requests refuse an `attachments` member. +An Invoke refuses a file whose stored verification verdict is already rejected with `412 precondition.failed`. +An unseen or pending file can commit, but downloads stay concealed until verification approves it. + Effects, revisions, audit, receipt, and outbox commit together or not at all; resend the original request with its original key when the outcome is uncertain. See [Actions and Proposals](../../configure/breg-actions/) for the model. diff --git a/docs/site/src/content/docs/reference/breg-client-capabilities.mdx b/docs/site/src/content/docs/reference/breg-client-capabilities.mdx index 472f3290e2..262e22771c 100644 --- a/docs/site/src/content/docs/reference/breg-client-capabilities.mdx +++ b/docs/site/src/content/docs/reference/breg-client-capabilities.mdx @@ -203,6 +203,12 @@ whose mode is Proposal Start. Then: - `uploadProposalAttachment`, `downloadProposalAttachment`, and `deleteProposalAttachment` work on one declared slot. Submitting freezes the attachment digests, so changed bytes cannot inherit an earlier approval. +- `downloadRecordAttachment(recordRoute, recordIdentifier, slot, accessProfile)` reads the file in a + record slot, whether an immediate Action wrote it or an applied Proposal promoted it. The bytes are + returned only when they match the service's `Repr-Digest`. A slot holds up to 16 MiB, and the + clients read 8 MiB by default, so raise the maximum response size to download larger files. +- The clients cannot yet send request files, so an immediate Action that declares attachments is + not invocable from them. To show the applicant's current review stage, call `readProposalReviewStatusWithProgress(proposal)` in Node or diff --git a/docs/site/src/content/docs/security/breg.mdx b/docs/site/src/content/docs/security/breg.mdx index 5e38bec918..c670557581 100644 --- a/docs/site/src/content/docs/security/breg.mdx +++ b/docs/site/src/content/docs/security/breg.mdx @@ -229,6 +229,8 @@ The compiler refuses the key on a profile that grants an operation that does not BReg writes no subject-log entry for a Proposal attachment download or a Proposal review read, even when the review shows fields of a Record type with `accessLog`. Those reads are recorded only in BReg's [audit records](../../operate/breg-monitor/#read-audit-records). +A Record attachment download records a returned read in the subject access log when its Record type has `accessLog`. +It also writes a read audit record. See obligation 22 and `BREG-RES-27` for what remains. {/* Evidence: crates/registry-breg/src/disclosure.rs, plan, record_guard_sql, refuses_write; @@ -247,6 +249,167 @@ See obligation 22 and `BREG-RES-27` for what remains. crates/registry-breg/tests/disclosure_compile.rs, a_read_path_cannot_filter_or_sort_a_withheld_target_field. */} +### Record history and Proposals + +A revision written by applying a Proposal carries an optional `proposal` member with the Action +identifier, the Proposal identifier and the submission version. +The member discloses a Proposal identifier only under Proposal read authorization. +BReg resolves the link from the Proposal's stored application results, then keeps it only when the +selected access profile could read that Proposal: the same grant, ownership and row-boundary check a +Proposal read applies, run by the same code. +A profile that reads the Record's history but holds no `get` grant on the Proposal, a caller who does +not own a caller-owned Proposal, a caller whose row boundaries exclude a target, a caller under +a task grant and a standing agent all receive the revision without the member. +That response is the one a revision no Proposal produced would get. +Operator erasure of a Proposal's detail keeps the link, because the identifier and state survive and +the Proposal read already reports that its detail was erased. +History erasure removes the link with the revision it erases. +The Proposal keeps its state and application, and a current Proposal read leaves that revision out +of `resultLinks`. +The receipt of the original apply is not rewritten. +While the registry holds that response, a retry by the same authorised caller with the same +idempotency key returns the receipt as first issued. +It names the record and the revision number, and carries no field values. +`bregctl proposal-retention erase` for that Proposal removes the held response with the rest of the +Proposal's detail, where the Action's retention mode allows it. +A Proposal read still checks every record the application wrote, including a record whose revision +was erased. +The check reads the Proposal without locking its row, because an applied Proposal no longer changes. +All the checks of one read share one deadline. +If a check cannot finish, because of a conflict, a store failure or that deadline, the read answers +`503 source.unavailable` instead of leaving out the member. +The caller-filtered OpenAPI document declares the member only on the revision routes where the +caller would receive it. + +The link has these known limits: + +- A caller who holds a Proposal `get` grant for the Action but fails its ownership or row-boundary + check makes BReg run one extra short transaction for each linked Proposal. + That caller may infer from the response time that a Proposal wrote a revision. +- The check writes no Proposal-read audit entry. + Only the revision read is audited. +- The member disappears once a record the Proposal targeted is tombstoned, because the Proposal + target check sees only active records. +- Each distinct Proposal on a page costs one short read transaction, up to 100 on a full page. + +{/* Evidence: crates/registry-breg/src/postgres/proposal.rs, proposal_link_readable; + crates/registry-breg/src/postgres/revision_read.rs, resolve_proposal_links; + crates/registry-breg/src/proposal_ddl.rs, record_lifecycle = 'active'; + crates/registry-breg/src/api/mod.rs, openapi; + crates/registry-breg/tests/postgres_proposal_security.rs, + record_history_names_the_proposal_for_a_caller_who_can_read_it, + record_history_links_proposals_over_a_single_connection_pool, + record_history_omits_the_proposal_from_a_profile_without_a_proposal_grant, + record_history_omits_the_proposal_when_ownership_does_not_match, + record_history_omits_the_proposal_outside_the_proposal_row_boundary, + record_history_never_names_the_proposal_to_a_task_grant_caller, + record_history_never_names_the_proposal_to_a_standing_agent, + record_history_reads_the_link_while_another_session_locks_the_proposal_row, + record_history_is_unavailable_when_the_proposal_link_check_fails, + record_discovery_declares_the_proposal_link_only_to_a_caller_who_can_receive_it, + record_history_keeps_the_proposal_after_operator_erasure; + crates/registry-breg/src/history_erasure.rs, delete_proposal_result_links; + crates/registry-breg/src/mutation/proposal.rs, authorize_proposal_document; + crates/registry-breg/tests/postgres_record_attachments.rs, + history_erasure_keeps_a_promoted_file_and_removes_the_link_to_the_erased_revision, + an_applied_proposal_stays_bounded_by_a_record_whose_revision_was_erased; + products/breg/contracts/security-invariant-matrix.yaml, BREG-SEC-217. */} + +### Record files + +A Record type's file slot is written once. +The create effect of an immediate Action writes it, or an applied Proposal promotes one of its files into it. +The file commits in the transaction that writes the record, its history, the idempotency receipt and +any hook event. +BReg checks the media type, the size and the SHA-256 digest before it writes anything. +A slot that already holds a file refuses a second one with `409 attachment.slot-write-once`. +Erasing the slot's reference leaves a marker, so the slot is never filled again. +The marker keeps the file's SHA-256 digest, media type and size and the revision that filled the slot. +It drops who filled the slot and when. +The runtime role can only add and read references, so it cannot replace or remove one. +Hook events never carry file bytes. +When file verification is configured, BReg refuses an immediate Action's file if its stored verdict is already rejected. +An unseen or pending file commits before the verification worker checks it. +Until the worker approves the file, it cannot be downloaded. +A later rejection leaves the slot unreadable, and the slot cannot be filled again. +Field disclosure conditions and field encryption do not cover file slots. +BReg stores file bytes unencrypted, in PostgreSQL or in external storage. + +A download needs the slot in the selected profile's `readableAttachments`, and `bregctl check` accepts +that grant only beside `get` on the Record type. +BReg checks the grant and a keyed principal before any I/O. +It then finds the record through the Record type's ordinary read relation, so row boundaries, +consent and lifecycle apply as they do on `GET`. +It loads the reference and the bytes in the same transaction, under the lock that deletion takes. +It releases the bytes only when they match the stored size and digest. +A profile without the grant gets `404 resource.not_found`, with no digest. +So do a record outside the boundary, an empty slot and a file that verification has not approved. +A download is recorded in BReg's read audit and, when the Record type has `accessLog`, in the +subject access log. +Both name the operation after the record's `get` operation and the slot, such as +`records.application.get:attachment:evidence`. +A refusal before byte access names the declared slot too. +An undeclared slot uses only the `:attachment` suffix, so caller-supplied names do not enter the audit. +A download that fails after it starts is audited as refused and is not logged for the subject. + +History erasure keeps current files, including files a Proposal promoted. +It clears their attaching actor and timestamp when the boundary reaches the revision that attached them. +It removes a file only when the request names its slot in `eraseFiles`. +BReg checks those names against the verified active Record type before any erasure. +An erased slot keeps only its identity and erasure timestamp, so it cannot be filled again. +It retains no digest, media type, size or attachment revision. +An erased Proposal file reference also drops its digest, media type, size and uploader metadata. +A still-live Proposal keeps its file metadata and held responses until its own detail is erased. +History erasure removes Proposal links to erased revisions. +Its report and audit count those links and kept or erased file references. +BReg deletes the bytes only when no other record and no Proposal refers to them. +Proposal erasure and attachment cleanup count record references too. +The verification worker also checks files that only a record holds. + +A promotion adds a record reference to the bytes that the frozen Proposal file already holds. +`bregctl check` accepts it only when the record slot accepts every media type and size the Proposal slot accepts. +The record slot must also be classified at least as restricted as the Proposal slot, so a promoted +file's classification label never drops. +The label is checked once, by `bregctl check`. +Who can download the promoted file is then decided by the record grants' `readableAttachments`. +Promotions are part of the Action's definition revision, so changing one changes the Action. +So are the request-file bindings of an immediate Action. +Apply rebuilds the Proposal's file manifest and refuses a file that verification has not approved. +Inside the apply transaction it checks the frozen file again, under the lock that deletion takes. +A file whose verdict turns to rejected after the manifest check is still refused. +It then adds the reference beside the record revision the effect wrote. +An unapproved file answers `412 precondition.failed`. +A filled slot answers `409 attachment.slot-write-once`. +Either refusal rolls back the whole apply. +Erasing the Proposal keeps the promoted bytes and removes files that nothing promoted. + +{/* Evidence: crates/registry-breg/src/api/record_attachments.rs; + crates/registry-breg/src/postgres/record_attachment_read.rs, read_record_attachment; + crates/registry-breg/src/attachment_store.rs, attach_record_reference, load_record_attachment, + erase_record_attachments and retire_unreferenced; + crates/registry-breg/tests/postgres_record_attachments.rs, + profiles_without_the_grant_or_outside_the_row_boundary_cannot_read, + early_download_refusals_audit_the_attachment_operation_without_caller_values, + a_tombstoned_record_and_its_file_have_the_same_concealed_read, + a_record_disclosure_condition_conceals_its_file_under_the_same_get_relation, + a_file_waiting_for_or_refused_by_verification_is_concealed, + a_write_once_slot_refuses_a_second_file_even_after_erasure, + a_failed_commit_leaves_neither_the_record_nor_the_file, + record_erasure_removes_the_reference_then_the_bytes_nothing_else_refers_to, + proposal_erasure_never_removes_bytes_a_record_refers_to, + an_applied_proposal_promotes_its_file_by_reference_and_erasure_keeps_it, + history_erasure_keeps_a_promoted_file_and_removes_the_link_to_the_erased_revision, + promotion_into_a_filled_slot_answers_409_and_rolls_back_the_whole_apply; + crates/registry-breg/src/immediate_actions.rs, compile_attachment_promotions, definition_revision; + crates/registry-breg/tests/attachment_promotion_compiler.rs, + a_promotion_refuses_a_record_slot_less_restricted_than_the_proposal_slot, + an_immediate_action_revision_covers_its_request_file_bindings; + crates/registry-breg/src/mutation/proposal.rs, promote_proposal_attachments; + crates/registry-breg/tests/postgres_proposal_s3.rs, + promotion_references_the_verified_s3_object_and_refuses_unverified_bytes, + promotion_rechecks_a_verdict_rejected_after_the_manifest_check; + products/breg/contracts/security-invariant-matrix.yaml, BREG-SEC-218 to BREG-SEC-223. */} + ## Operator obligations For the invariants to hold, a deployment must do the following. diff --git a/docs/site/src/data/breg-api.yaml b/docs/site/src/data/breg-api.yaml index 19120b8d93..9f39591346 100644 --- a/docs/site/src/data/breg-api.yaml +++ b/docs/site/src/data/breg-api.yaml @@ -11,6 +11,7 @@ - ['`GET /v1/records/{route}`', '`list`', 'Configured Record type with this granted operation', 'Collection.'] - ['`GET /v1/records/{route}/{record_id}`', '`get`', 'Configured Record type with this granted operation', 'Record envelope with `ETag`.'] - ['`GET /v1/records/{route}/{record_id}/access-log`', '`get`', 'Record type declares `accessLog`; the authenticated caller reaches the record through `get` and is its current subject', 'A bounded page of the record''s retained subject-facing access events. `limit` defaults to 50 and is at most 100; `cursor` continues from an event ID.'] + - ['`GET /v1/records/{route}/{record_id}/attachments/{slot_id}`', '`get`', 'Record type declares the slot in `attachments`; the selected profile reaches the record through `get` and lists the slot in `readableAttachments`', 'The stored file with its stored media type and a `Repr-Digest` of its stored SHA-256 digest. Accepts only `accessProfile`. A slot with no file is the concealed 404.'] - ['`PATCH /v1/records/{route}/{record_id}`', '`patch`', '`mutationMode: mutable`', 'Record envelope. Requires `If-Match`.'] - ['`DELETE /v1/records/{route}/{record_id}`', '`tombstone`', '`tombstone: true`', 'Envelope of the final revision. Requires `If-Match`.'] - ['`POST /v1/records/{route}:lookup`', '`lookup`', 'Record type declares `selectorProfiles`', 'Record envelope, or 404 `lookup.unresolved`.'] @@ -29,7 +30,7 @@ - ['`GET /v1/records/{route}/{record_id}/{read_path}`', '`list` through `readPaths[]`', 'Record type declares `readPaths`', 'Collection of related records.'] - ['`POST /v1/actions/{action}/target-conditions`', '`invoke`', 'Immediate Action advertises required target conditions', '`{"preconditions": {...}}` for the targets the input names.'] - ['`POST /v1/actions/{action}/availability`', '`invoke`', 'Immediate Action has at least one reference input', 'Advisory availability for one referenced target: `true` or `false` with its observed revision, or `null` when more input is required or the current profile cannot inspect the guard safely.'] - - ['`POST /v1/actions/{action}`', '`invoke`', 'Action mode is immediate and the caller holds Invoke', '`{"action", "applicationId", "results"}`. Requires `Idempotency-Key`.'] + - ['`POST /v1/actions/{action}`', '`invoke`', 'Action mode is immediate and the caller holds Invoke', '`{"action", "applicationId", "results"}`. Requires `Idempotency-Key` and `application/json` with `input` and every declared file in `attachments` (each with `contentType`, lowercase hex `sha256` and base64 `content`).'] - ['`POST /v1/review-completions`', 'review completion receiver', 'A review authority configures a completion token and recipient binding', '204 after durable acceptance or an exact replay. Requires bearer authentication, `Registry-Recipient-Binding`, and an `Idempotency-Key` equal to the completion event ID.'] - ['`GET /v1/gis`', 'GIS adapter', '`listener.publicOrigin` is configured; the response includes only GIS collections visible to the caller', 'Landing document with links to the service description, conformance document, and collection inventory. Declares `breg-gis-bounded-crs84-point-bbox-v1` for Point-only visibility or `breg-gis-bounded-crs84-geometry-bbox-v1` when a polygon collection is visible.'] - ['`GET /v1/gis/api`', 'GIS adapter', '`listener.publicOrigin` is configured; the response includes only GIS collections visible to the caller', 'Caller-filtered OpenAPI 3.0 description for the visible collection item routes.'] @@ -82,8 +83,12 @@ - ['`action.handler_failed`', '500', 'An activated Action function failed to produce an accepted result. Operators use the trace identifier and safe server diagnostics to repair the package. A function deadline returns `503 service.unavailable` instead.'] - ['`action.evidence_failed`', '503', 'An immediate-action handler declared an Evidence dependency that could not be acquired or accepted: the provider did not answer, or the assertion was refused, failed verification, or exceeded the retention bound. `fieldPath` names the declared Evidence alias when the failure is bound to one. No effects commit.'] - ['`unsupported.media_type`', '415', 'A body without the required `Content-Type`.'] + - ['`attachment.too-large`', '413', 'An immediate Action carried a file larger than the `maximumBytes` of its record attachment slot. No effects commit.'] + - ['`attachment.content-type`', '415', 'An immediate Action carried a file whose `contentType` is not in the `contentTypes` of its record attachment slot. No effects commit.'] + - ['`attachment.digest-mismatch`', '422', 'An immediate Action carried a file whose bytes do not hash to the `sha256` the request declared. No effects commit.'] + - ['`attachment.slot-write-once`', '409', 'A record attachment slot already holds a file. Record slots are write-once, so the second write is refused and the stored file is unchanged. This covers an immediate Action file and a Proposal file that Apply promotes. No effects commit.'] - ['`precondition.required`', '428', 'A route that requires `If-Match` was called without it.'] - - ['`precondition.failed`', '412', '`If-Match` did not match the current revision, a Patch target was hidden or absent, or an ingestion item, immediate Action effect, or Proposal target or effect failed its boundary check. The response is value-free.'] + - ['`precondition.failed`', '412', '`If-Match` did not match the current revision, a Patch target was hidden or absent, or an ingestion item, immediate Action effect, or Proposal target or effect failed its boundary check. Invoke also answers this when a file already has a rejected verification verdict. Apply also answers this when a Proposal file it promotes is waiting for verification or was rejected by it. The response is value-free.'] - ['`write.outside-boundary`', '403', 'A direct Create, direct Batch item, or Patch of a visible Record would put the resulting Record outside the selected access profile''s row boundary, or would leave a Record that a `record` disclosure condition then withholds from that profile. An immediate Action, or a Proposal applied by hand, is refused the same way when its plan creates or patches a Record that a `record` disclosure condition binding the applying profile would then withhold from it. A Patch, Batch item, immediate Action or Proposal applied by hand is also refused when a disclosure condition that binds the applying profile matches the Record and the write names one of its withheld fields or would lift the mark. The response has no field, value, claim, or location extension, and no item commits.'] - ['`proposal.rejected`', '409', 'A Review rejected the Proposal, and a rejection is final: Submit, Edit, Revise, Rebase, Apply, Retry and Cancel are refused. Start a new Proposal to try again.'] - ['`proposal.review_result_mismatch`', '412', 'The current Review result differs from the retained approval. Apply commits no effects. Reconcile the review result before attempting application again.'] @@ -111,6 +116,7 @@ columns: [Read, Answer] rows: - ['`get`, `lookup`, or `access-log` of a record outside the row, membership, or consent boundary', '404 `resource.not_found`, or 404 `lookup.unresolved` for a lookup, identical to an absent record.'] + - ['A record attachment download by a profile without the slot in `readableAttachments`, or of a record outside the boundary', '404 `resource.not_found`, identical to an absent record or an empty slot. No digest is returned.'] - ['Collection, `:snapshot`, `$count`, or `$skiptoken` continuation over such records', '200 with those records left out and the count taken over the visible records only. A cursor replay re-evaluates the boundary.'] - ['Revisions of such a record', '404 `resource.not_found`, identical to an absent record.'] - ['A record or its history withheld by a disclosure condition', 'The same answers as above: a get is 404 `resource.not_found`, a list and a count leave it out, and `history` and `record` conditions answer its revisions and snapshots as not found. A `fields` condition keeps the record readable and returns each named member as `null`.'] diff --git a/products/breg/CHANGELOG.md b/products/breg/CHANGELOG.md index 088d7e13d7..2fa132febd 100644 --- a/products/breg/CHANGELOG.md +++ b/products/breg/CHANGELOG.md @@ -2,10 +2,92 @@ ## Unreleased -- The model explanation schema now declares `derivation` on a derived field: - a non-empty string naming the derived relation the registry uses to work the - field out when the record is read. `bregctl explain model` already emitted - it. Stored fields still omit it. +- Refused Record file downloads use the same attachment audit operation as + served downloads, including refusals before database access. The slot suffix + names only a declared slot. Caller-supplied undeclared names stay out of audit. +- A Record type can keep files. It declares write-once slots under + `attachments`, each with `maximumBytes`, `contentTypes`, `classification` + and `writeOnce: true`. The create effect of an immediate Action fills a slot + from a file sent in the same request, under the request's new + `attachments` member. The file commits with the record, its history, the + idempotency receipt and any hook event, or nothing commits. Hook events + never carry the bytes. A profile reads a slot only when its record grant + lists it in `readableAttachments` beside `get`. The new + `GET /v1/records/{route}/{record_id}/attachments/{slot_id}` route returns + the stored bytes, the stored media type and a `Repr-Digest` header. Any + other caller, a record outside the row boundary and an empty slot get the + same 404. New problems are `attachment.slot-write-once` (409), + `attachment.too-large` (413), `attachment.content-type` (415) and + `attachment.digest-mismatch` (422). `bregctl check` refuses a request file + on a patch effect, an Action with Evidence and a timer Action. An applied + Proposal can also fill a record slot. The create or patch effect of a + Proposal Action names the Proposal file to promote, as + `"attachments": {"": {"fromAttachment": ""}}`. + The record slot then refers to the same stored bytes, so nothing is copied. + The reference commits with the applied revision. An empty optional Proposal + slot leaves the record slot empty. `bregctl check` refuses a promotion from + a Proposal slot the Action does not declare, into a slot the target record + type does not declare, from a Proposal slot that accepts a content type or + size the record slot does not, into a record slot classified less + restricted than the Proposal slot, and a second promotion into one slot of + one record. Promotions and an immediate Action's request files are part + of the Action's definition revision. When the record slot already holds a + file, apply answers `409 attachment.slot-write-once` and nothing commits. + When the Proposal file's verification is pending or rejected, apply + answers `412 precondition.failed` and nothing commits. Invoke also refuses + files whose stored verification verdict is already rejected. History erasure + keeps current record files and clears attribution from erased revisions. + The existing `history erase` request's `eraseFiles` member explicitly names + slots to erase, including after their history is gone while coverage is ready. + Undeclared or repeated slots are refused before any erasure. + The report and `breg-history-erasure-audit/v4` entry count erased and kept + file references and removed Proposal links. Erased Record and Proposal file + references keep only their slot identity and erasure timestamp, with no + file digest, media type or size. Bytes go once no record or + Proposal refers to them. Proposal erasure keeps bytes a record refers to, + including promoted files, and removes the rest. The Rust and Python + clients gain `download_record_attachment`, and the Node.js client gains + `downloadRecordAttachment`. A download reads at most 8 MiB unless the + client's maximum response size is raised. The clients cannot yet send + request files, so an immediate Action that declares attachments is not + invocable from them. +- BREAKING: record file references live in the + `registry_internal.registry_record_attachments` table, and the managed + schema fingerprint changes with it. The fingerprint also covers a new index + on the Proposal result rows by target record and revision, which record + history uses to name the Proposal behind a revision. Migration: install the + release on a fresh database. +- Every registry revision changes on upgrade, even for a project that + declares no slots, because the problem code list in the generated OpenAPI + document grew. Per-action contract revisions do not change. Operators who + pin a registry revision update the pin. +- Record history names the Proposal that produced a revision. A revision list + item and a revision detail gain an optional `proposal` member with + `actionId`, `proposalId` and `submissionVersion`, derived from the existing + Proposal result rows. The member appears only when the selected access + profile could read that Proposal under its `get` grant, ownership and row + boundaries. Otherwise the member is absent and the response is unchanged. + A revision written by an immediate Action, a direct write, a batch or an + import never carries it. Operator Proposal erasure keeps the link. + Task-grant callers do not see it, and it disappears once a record the + Proposal targeted is tombstoned. A link check that cannot finish answers + `503 source.unavailable`. The generated OpenAPI document declares the member + only for a registry with a Proposal Action, and the caller-filtered document + only for a caller who would receive it. +- History erasure can erase a revision that an applied Proposal wrote. Before, + the Proposal's result row still named the revision and the erasure rolled + back. The erasure now removes that result row in the same transaction. The + Proposal keeps its state and application, a current Proposal read leaves + the erased revision out of `resultLinks`, and record history shows no + Proposal link for it. A retry of the original apply by the same authorized + caller with the same idempotency key still returns the receipt as first + issued while the registry holds it. That receipt names the record and the + revision number and carries no field values. `bregctl proposal-retention + erase` removes it with the rest of the Proposal's detail, where the + Action's retention mode allows it. A + file the Proposal promoted at that revision is erased like any other record + file. A Proposal read still requires the caller's row boundaries to hold + every record the Proposal wrote. - `bregctl generate evidence-source --public-check` exports the Source of an Evidence public check. Evidence compares the check code only after the Source returns a record, so this export states each fact's scalar type and @@ -20,6 +102,10 @@ - `bregctl generate identity-facts` and `external-source-facts` now refuse `--optional-fields` and `--require-value`, which only `evidence-source` reads. They were accepted and ignored. +- The model explanation schema now declares `derivation` on a derived field: + a non-empty string naming the derived relation the registry uses to work the + field out when the record is read. `bregctl explain model` already emitted + it. Stored fields still omit it. ## 0.48.0 - 2026-11-23 diff --git a/products/breg/contracts/client-capabilities.json b/products/breg/contracts/client-capabilities.json index 917da2bb19..0fa7603fbd 100644 --- a/products/breg/contracts/client-capabilities.json +++ b/products/breg/contracts/client-capabilities.json @@ -401,9 +401,9 @@ }, { "id": "attachments", - "rust": ["upload_proposal_attachment", "download_proposal_attachment", "delete_proposal_attachment"], - "node": ["uploadProposalAttachment", "downloadProposalAttachment", "deleteProposalAttachment"], - "python": ["upload_proposal_attachment", "download_proposal_attachment", "delete_proposal_attachment"] + "rust": ["upload_proposal_attachment", "download_proposal_attachment", "delete_proposal_attachment", "download_record_attachment"], + "node": ["uploadProposalAttachment", "downloadProposalAttachment", "deleteProposalAttachment", "downloadRecordAttachment"], + "python": ["upload_proposal_attachment", "download_proposal_attachment", "delete_proposal_attachment", "download_record_attachment"] }, { "id": "create-recovery", diff --git a/products/breg/contracts/security-invariant-matrix.yaml b/products/breg/contracts/security-invariant-matrix.yaml index 9fba460829..7bf229aa85 100644 --- a/products/breg/contracts/security-invariant-matrix.yaml +++ b/products/breg/contracts/security-invariant-matrix.yaml @@ -228,3 +228,10 @@ invariants: - {"id": "BREG-SEC-214", "state": "enforced", "targetWave": "W5", "threat": "A total over a protected sum is released although it contains a suppressed sum cell, so the suppressed value is recovered by subtracting the released siblings from the total.", "enforcementPoint": "registry_breg::statistics::apply_protected_disclosure propagates a suppressed primary sum cell to every ancestor cell with a total substitution, in one pass, with the reason contains-suppressed-sum; count cells never propagate; compiler refusal breg.statistical-dataset.sum-field-released-twice keeps every protected sum of a field over a unit in one dataset, where propagation reaches every total; the PostgreSQL release path feeds it per-cell contributor counts and a dominance predicate computed in SQL (unit proof: statistics.rs a_suppressed_sum_suppresses_every_total_that_contains_it_over_two_levels)", "refusal": "Suppress the containing total with no value and status suppressed; keep a cell's own reason when it already has one.", "negativeId": "BREG-NEG-214", "negativeTest": {"path": "crates/registry-breg/tests/postgres_statistics_protected_sums.rs", "name": "the_dry_run_names_the_reason_of_every_withheld_cell_and_publish_stores_the_same_document"}} - {"id": "BREG-SEC-215", "state": "enforced", "targetWave": "W5", "threat": "The dominance percentage or the per-cell contributor inputs leave the server, so a reader of a release document infers which cell was suppressed by dominance and its threshold.", "enforcementPoint": "DisclosureDocument names the contributor and the rule identifiers only; CellDisclosureInput is never serialized, and the dominance percentage never appears in a release document, dry-run response, OpenAPI document, metadata entry, problem or audit entry (it is present in the operator's compiled package and model explanation, as in the project source), and validate_document refuses a sum release whose members are absent or unknown; the dry run and the stored document are searched for p and the inputs (unit proof: statistics.rs the_release_document_of_a_sum_names_the_contributor_and_the_rules_but_never_p)", "refusal": "Serve the contributor, dominanceRule and sumTotals members without the percentage; refuse an unknown member in a release document.", "negativeId": "BREG-NEG-215", "negativeTest": {"path": "crates/registry-breg/tests/postgres_statistics_protected_sums.rs", "name": "the_dry_run_names_the_reason_of_every_withheld_cell_and_publish_stores_the_same_document"}} - {"id": "BREG-SEC-216", "state": "enforced", "targetWave": "W5", "threat": "The publisher's release dry run is served to a release reader or a live reader, or it stores a release, reserves a version or leaks the disclosure inputs, so a caller outside the publisher reads what is withheld or a dry run alters the release series.", "enforcementPoint": "the versions:dry-run route is eligible for the dataset publisher only, with the admission and concealment of publish; it reads no Idempotency-Key, runs the publish computation without the persist step, and writes an audit attempt and one terminal entry", "refusal": "Conceal the dry run from a profile that is not the publisher; store nothing and reserve no version.", "negativeId": "BREG-NEG-216", "negativeTest": {"path": "crates/registry-breg/tests/postgres_statistics_protected_sums.rs", "name": "the_dry_run_is_unavailable_to_a_release_reader_and_a_live_reader"}} + - {"id": "BREG-SEC-217", "state": "enforced", "targetWave": "W5", "threat": "A Record revision read names the Proposal that produced the revision to a caller who could not read that Proposal, disclosing a Proposal identifier, its Action and its submission version.", "enforcementPoint": "revision reads resolve the link from registry_proposal_results and keep it only after the same authorize_proposal_document check a Proposal read applies, under the Proposal get grant of the selected access profile (profile grant, ownership, row boundaries); a task-grant caller, an unreadable Proposal or an unreadable target omits the member; the check reads the applied Proposal without a row lock under one deadline per read, and the caller-filtered OpenAPI document declares the member only on revision routes where the same check could keep it", "refusal": "Omit the proposal member, leaving a response byte-identical to one for a revision no Proposal produced. A check that cannot finish (conflict, store failure or deadline) fails the read with 503 source.unavailable instead of omitting the member. Operator erasure of Proposal detail keeps the link because the identifier and state survive.", "negativeId": "BREG-NEG-217", "negativeTest": {"path": "crates/registry-breg/tests/postgres_proposal_security.rs", "name": "record_history_omits_the_proposal_when_ownership_does_not_match"}} + - {"id": "BREG-SEC-218", "state": "enforced", "targetWave": "W5", "threat": "A Record attachment download releases a file to a caller whose access profile does not grant the slot, or for a record the caller cannot read, so the file escapes the boundary that protects its record.", "enforcementPoint": "the download route requires the selected access profile to list the slot in readableAttachments, which bregctl check accepts only beside get on the Record type, and a keyed principal, before any I/O; inside one RLS-bound transaction it then finds the record through the Record type's GET source relation (row boundaries, consent, lifecycle and record disclosure), loads the reference and the bytes under the content-hash lock, checks the bytes against the stored size and SHA-256 digest, and records the release in the subject access log and the read audit; early refusals and served reads share the attachment operation identity, with a slot suffix only for a declared slot and no caller-supplied slot name", "refusal": "Refuse with 404 resource.not_found, identical to an absent record or an empty slot, with no digest, media type or size. Bytes that do not match the stored digest are never released.", "negativeId": "BREG-NEG-218", "negativeTest": {"path": "crates/registry-breg/tests/postgres_record_attachments.rs", "name": "profiles_without_the_grant_or_outside_the_row_boundary_cannot_read"}} + - {"id": "BREG-SEC-219", "state": "enforced", "targetWave": "W5", "threat": "A Record slot's file is replaced after the record kept it, or a record commits without the file its Action declared, so the file a decision rests on changes or goes missing after the fact.", "enforcementPoint": "only an immediate Action create effect or a Proposal promotion on apply writes a record slot; under the content-hash lock the existing verification verdict refuses an already rejected file before inserting a reference, while pending files retain their ordinary commit behavior; the reference key (Record type, record, slot) refuses a second write, an erased reference keeps its tombstone so the slot stays written, the runtime role holds INSERT and SELECT only on the reference table, and the reference commits in the transaction that writes the record, its history, the idempotency receipt and the outbox", "refusal": "Refuse an already rejected file with 412 precondition.failed and no committed effects. Refuse a second write with 409 attachment.slot-write-once and roll back the record, the reference and the bytes. Refuse an undeclared media type with 415, an oversized file with 413 and a digest that does not match the bytes with 422 before any write.", "negativeId": "BREG-NEG-219", "negativeTest": {"path": "crates/registry-breg/tests/postgres_record_attachments.rs", "name": "a_write_once_slot_refuses_a_second_file_even_after_erasure"}} + - {"id": "BREG-SEC-220", "state": "enforced", "targetWave": "W5", "threat": "History erasure destroys a current file without an explicit slot selection, explicit file erasure leaves its digest in the slot marker, erasure of a Proposal deletes bytes a Record still refers to, or a successor removes or redefines a slot while retained bytes still depend on its ID and policy.", "enforcementPoint": "history erasure keeps current files and clears attaching actor and timestamp when its boundary reaches the filling revision; only eraseFiles names validated against the verified active Record type erase current Record references; package change-set comparison treats new attachment slots as additive and refuses removal or redefinition of an existing slot; the same transaction scrubs erased Record and Proposal file references to their slot identity and erasure timestamp, with database constraints requiring live file metadata and forbidding erased file metadata; retire_unreferenced deletes bytes under the content-hash lock only when no live Proposal or Record reference remains; history erasure deletes Proposal result links to erased revisions and reports erased and kept file references and removed links in its outcome and audit; a Proposal read checks every record its frozen targets name, so a removed link never widens disclosure", "refusal": "Refuse undeclared or repeated slot names before erasure. Successor packages may add slots but must preserve every existing slot ID and definition. Keep unnamed files readable under their ordinary grants. Answer a named erased slot's download with the concealed 404 and keep the slot permanently written. Keep bytes while any live reference remains. An explicit live file can be erased after its history is gone while coverage stays ready; refuse an empty-history no-op. A Proposal whose revision was erased still reads, names no erased revision, and stays concealed outside its record boundary.", "negativeId": "BREG-NEG-220", "negativeTest": {"path": "crates/registry-breg/tests/postgres_record_attachments.rs", "name": "record_erasure_removes_the_reference_then_the_bytes_nothing_else_refers_to"}} + - {"id": "BREG-SEC-221", "state": "enforced", "targetWave": "W5", "threat": "Applying a Proposal promotes a file into a Record slot that does not accept it or is classified less restricted than the Proposal slot, a file verification has not approved, or bytes other than the file frozen at submission, so a record keeps a file outside its slot's bounds, under a lower classification label than it was submitted with, or one nobody verified. The label is a compile-time check only: who can download the promoted file is decided by the record grants' readableAttachments.", "enforcementPoint": "bregctl check accepts a promotion only from a Proposal slot the Action declares, into a slot the target Record type of a create or patch effect declares, when the record slot accepts every media type and size the Proposal slot accepts and is classified at least as restricted as the Proposal slot, and once per slot of one record; promotions are part of the Action definition revision; apply recomputes the attachment manifest, which refuses a file whose verification does not permit its content, and inside the apply transaction, under the content-hash lock, requires the frozen submission's live reference with the same digest, media type and size and a verdict that still permits its content before it adds a record reference to the same content hash", "refusal": "Refuse the project with breg.action.attachment-invalid. Refuse the apply with 412 precondition.failed when the frozen file is waiting for verification, was rejected or no longer matches, and roll back every effect of the apply.", "negativeId": "BREG-NEG-221", "negativeTest": {"path": "crates/registry-breg/tests/postgres_proposal_s3.rs", "name": "promotion_references_the_verified_s3_object_and_refuses_unverified_bytes"}} + - {"id": "BREG-SEC-222", "state": "enforced", "targetWave": "W5", "threat": "Applying a Proposal fills a Record slot that already holds a file, or commits part of its effects when a promotion fails, so the file a decision rests on changes or a record exists without the file the Proposal froze.", "enforcementPoint": "the promotion inserts the record reference in the apply transaction after the effect writes its record revision; the reference key (Record type, record, slot) refuses a second write, live or erased, and any refusal rolls back the records, revisions, references, outbox and the Proposal's application", "refusal": "Refuse with 409 attachment.slot-write-once, keep the stored file, and leave no record, revision or reference from the apply.", "negativeId": "BREG-NEG-222", "negativeTest": {"path": "crates/registry-breg/tests/postgres_record_attachments.rs", "name": "promotion_into_a_filled_slot_answers_409_and_rolls_back_the_whole_apply"}} + - {"id": "BREG-SEC-223", "state": "enforced", "targetWave": "W5", "threat": "Operator erasure of a Proposal deletes the bytes of a file the Proposal promoted to a Record, or keeps the bytes of a Proposal file nothing promoted.", "enforcementPoint": "promotion adds a Record reference to the content hash the Proposal file holds and copies no bytes; Proposal erasure tombstones the Proposal references and retire_unreferenced deletes a hash under the content-hash lock only when no live Proposal or Record reference remains", "refusal": "Keep promoted bytes readable through the Record download after the Proposal is erased. Remove the bytes of Proposal files nothing promoted.", "negativeId": "BREG-NEG-223", "negativeTest": {"path": "crates/registry-breg/tests/postgres_record_attachments.rs", "name": "an_applied_proposal_promotes_its_file_by_reference_and_erasure_keeps_it"}} diff --git a/products/breg/contracts/security-test-traceability.yaml b/products/breg/contracts/security-test-traceability.yaml index 55484a792e..7dab96b8f5 100644 --- a/products/breg/contracts/security-test-traceability.yaml +++ b/products/breg/contracts/security-test-traceability.yaml @@ -235,3 +235,40 @@ traceability: - {"id": "BREG-SEC-214", "state": "enforced", "negativeId": "BREG-NEG-214", "negativeTest": {"path": "crates/registry-breg/tests/postgres_statistics_protected_sums.rs", "name": "the_dry_run_names_the_reason_of_every_withheld_cell_and_publish_stores_the_same_document"}} - {"id": "BREG-SEC-215", "state": "enforced", "negativeId": "BREG-NEG-215", "negativeTest": {"path": "crates/registry-breg/tests/postgres_statistics_protected_sums.rs", "name": "the_dry_run_names_the_reason_of_every_withheld_cell_and_publish_stores_the_same_document"}} - {"id": "BREG-SEC-216", "state": "enforced", "negativeId": "BREG-NEG-216", "negativeTest": {"path": "crates/registry-breg/tests/postgres_statistics_protected_sums.rs", "name": "the_dry_run_is_unavailable_to_a_release_reader_and_a_live_reader"}} + # No Proposal grant: crates/registry-breg/tests/postgres_proposal_security.rs::record_history_omits_the_proposal_from_a_profile_without_a_proposal_grant + # Row boundary: crates/registry-breg/tests/postgres_proposal_security.rs::record_history_omits_the_proposal_outside_the_proposal_row_boundary + # Task grant: crates/registry-breg/tests/postgres_proposal_security.rs::record_history_never_names_the_proposal_to_a_task_grant_caller + # Standing agent: crates/registry-breg/tests/postgres_proposal_security.rs::record_history_never_names_the_proposal_to_a_standing_agent + # Failed check answers 503: crates/registry-breg/tests/postgres_proposal_security.rs::record_history_is_unavailable_when_the_proposal_link_check_fails + # Caller-filtered OpenAPI: crates/registry-breg/tests/postgres_proposal_security.rs::record_discovery_declares_the_proposal_link_only_to_a_caller_who_can_receive_it + - {"id": "BREG-SEC-217", "state": "enforced", "negativeId": "BREG-NEG-217", "negativeTest": {"path": "crates/registry-breg/tests/postgres_proposal_security.rs", "name": "record_history_omits_the_proposal_when_ownership_does_not_match"}} + # Early refusal audit identity and value minimization: crates/registry-breg/tests/postgres_record_attachments.rs::early_download_refusals_audit_the_attachment_operation_without_caller_values + # Lifecycle visibility: crates/registry-breg/tests/postgres_record_attachments.rs::a_tombstoned_record_and_its_file_have_the_same_concealed_read + # Record disclosure visibility: crates/registry-breg/tests/postgres_record_attachments.rs::a_record_disclosure_condition_conceals_its_file_under_the_same_get_relation + - {"id": "BREG-SEC-218", "state": "enforced", "negativeId": "BREG-NEG-218", "negativeTest": {"path": "crates/registry-breg/tests/postgres_record_attachments.rs", "name": "profiles_without_the_grant_or_outside_the_row_boundary_cannot_read"}} + # Completed verdict admission: crates/registry-breg/tests/postgres_record_attachments.rs::immediate_action_refuses_a_completed_rejected_verdict_and_keeps_approved_and_unseen_files + # External immediate-Action rollback, retry and replay: crates/registry-breg/tests/postgres_proposal_s3.rs::immediate_action_s3_rollback_retry_and_exact_replay_converge + - {"id": "BREG-SEC-219", "state": "enforced", "negativeId": "BREG-NEG-219", "negativeTest": {"path": "crates/registry-breg/tests/postgres_record_attachments.rs", "name": "a_write_once_slot_refuses_a_second_file_even_after_erasure"}} + # Proposal erasure keeps bytes a Record refers to: crates/registry-breg/tests/postgres_record_attachments.rs::proposal_erasure_never_removes_bytes_a_record_refers_to + # History erasure keeps a promoted file and removes the Proposal link to the erased revision: crates/registry-breg/tests/postgres_record_attachments.rs::history_erasure_keeps_a_promoted_file_and_removes_the_link_to_the_erased_revision + # A removed Proposal link keeps the Proposal read bounded: crates/registry-breg/tests/postgres_record_attachments.rs::an_applied_proposal_stays_bounded_by_a_record_whose_revision_was_erased + # Erase-and-rebaseline over a Proposal-written revision: crates/registry-breg/tests/postgres_record_attachments.rs::erase_and_rebaseline_erases_a_revision_a_proposal_wrote + # Current files and attribution: crates/registry-breg/tests/postgres_record_attachments.rs::history_erasure_keeps_current_files_and_clears_their_attribution + # Slot admission: crates/registry-breg/tests/postgres_record_attachments.rs::history_erasure_refuses_an_undeclared_file_slot_before_any_erasure + # Later explicit erasure and no-op refusal: crates/registry-breg/tests/postgres_record_attachments.rs::a_retained_file_can_be_erased_after_its_history_is_gone + # Promoted files and counted links: crates/registry-breg/tests/postgres_record_attachments.rs::history_erasure_keeps_a_promoted_file_and_removes_the_link_to_the_erased_revision + # Proposal markers: crates/registry-breg/tests/postgres_record_attachments.rs::proposal_erasure_never_removes_bytes_a_record_refers_to + # Successor slot stability: crates/registry-breg/src/package/tests/immediate_actions.rs::record_attachment_successors_allow_additions_and_refuse_existing_slot_changes + - {"id": "BREG-SEC-220", "state": "enforced", "negativeId": "BREG-NEG-220", "negativeTest": {"path": "crates/registry-breg/tests/postgres_record_attachments.rs", "name": "record_erasure_removes_the_reference_then_the_bytes_nothing_else_refers_to"}} + # Unknown Proposal slot: crates/registry-breg/tests/attachment_promotion_compiler.rs::a_promotion_must_name_a_declared_proposal_slot + # Record slot not on the target type: crates/registry-breg/tests/attachment_promotion_compiler.rs::a_promotion_must_name_a_slot_of_the_effect_target_record_type + # Content type the record slot refuses: crates/registry-breg/tests/attachment_promotion_compiler.rs::a_promotion_refuses_a_content_type_the_record_slot_does_not_accept + # Size the record slot refuses: crates/registry-breg/tests/attachment_promotion_compiler.rs::a_promotion_refuses_a_size_the_record_slot_does_not_accept + # Record slot less restricted than the Proposal slot: crates/registry-breg/tests/attachment_promotion_compiler.rs::a_promotion_refuses_a_record_slot_less_restricted_than_the_proposal_slot + # Two promotions into one slot: crates/registry-breg/tests/attachment_promotion_compiler.rs::two_effects_cannot_promote_into_one_record_slot_of_one_record + # Verdict rejected after the manifest check: crates/registry-breg/tests/postgres_proposal_s3.rs::promotion_rechecks_a_verdict_rejected_after_the_manifest_check + - {"id": "BREG-SEC-221", "state": "enforced", "negativeId": "BREG-NEG-221", "negativeTest": {"path": "crates/registry-breg/tests/postgres_proposal_s3.rs", "name": "promotion_references_the_verified_s3_object_and_refuses_unverified_bytes"}} + # Empty optional source leaves the slot empty: crates/registry-breg/tests/postgres_record_attachments.rs::an_empty_optional_source_leaves_the_record_slot_empty + # Create and patch reference one stored copy: crates/registry-breg/tests/postgres_record_attachments.rs::create_and_patch_effects_reference_one_stored_copy + - {"id": "BREG-SEC-222", "state": "enforced", "negativeId": "BREG-NEG-222", "negativeTest": {"path": "crates/registry-breg/tests/postgres_record_attachments.rs", "name": "promotion_into_a_filled_slot_answers_409_and_rolls_back_the_whole_apply"}} + - {"id": "BREG-SEC-223", "state": "enforced", "negativeId": "BREG-NEG-223", "negativeTest": {"path": "crates/registry-breg/tests/postgres_record_attachments.rs", "name": "an_applied_proposal_promotes_its_file_by_reference_and_erasure_keeps_it"}} diff --git a/products/breg/examples/formats/ctl-report.json b/products/breg/examples/formats/ctl-report.json index a3b04a7315..c50c91869c 100644 --- a/products/breg/examples/formats/ctl-report.json +++ b/products/breg/examples/formats/ctl-report.json @@ -1664,13 +1664,13 @@ "protocol": "id.registrystack.org/protocols/review/v1" } ], - "revision": "sha256:24f18ae5ae8cdf18d0df9b280db52b59d143fac1d4ce83727ff0817dbafef3f0", + "revision": "sha256:dca3c6da48851de9878daa19e0f15b48f867abc87bfd90a0e5ef738a75dc79bd", "statisticalDatasets": [] }, "kind": "BRegCtlReport", "ok": true, "profile": "authoring", - "revision": "sha256:24f18ae5ae8cdf18d0df9b280db52b59d143fac1d4ce83727ff0817dbafef3f0", + "revision": "sha256:dca3c6da48851de9878daa19e0f15b48f867abc87bfd90a0e5ef738a75dc79bd", "status": "complete", "version": "0.49.0-dev" } diff --git a/products/breg/examples/formats/explain/actions-explanation.json b/products/breg/examples/formats/explain/actions-explanation.json index 2c8a9e5e9b..cb64860763 100644 --- a/products/breg/examples/formats/explain/actions-explanation.json +++ b/products/breg/examples/formats/explain/actions-explanation.json @@ -1641,6 +1641,6 @@ "protocol": "id.registrystack.org/protocols/review/v1" } ], - "revision": "sha256:24f18ae5ae8cdf18d0df9b280db52b59d143fac1d4ce83727ff0817dbafef3f0", + "revision": "sha256:dca3c6da48851de9878daa19e0f15b48f867abc87bfd90a0e5ef738a75dc79bd", "statisticalDatasets": [] } diff --git a/products/breg/examples/formats/explain/authored-display-actions-explanation.json b/products/breg/examples/formats/explain/authored-display-actions-explanation.json index 9cbe5c821e..c3336cc537 100644 --- a/products/breg/examples/formats/explain/authored-display-actions-explanation.json +++ b/products/breg/examples/formats/explain/authored-display-actions-explanation.json @@ -366,7 +366,7 @@ ], "registryId": "labelled-directory", "reviewAuthorities": [], - "revision": "sha256:93fe9251ad307ff3af5ed0b505d11071a592ecc459f4076009d4db4556157dcc", + "revision": "sha256:2422724a5ff2b11539885904d27cb3aad319e05b80f6655da444a12ee2da65ba", "statisticalDatasets": [ { "accessProfiles": { diff --git a/products/breg/examples/formats/explain/authored-display-model-explanation.json b/products/breg/examples/formats/explain/authored-display-model-explanation.json index 3a66d52e25..0c27dd3d87 100644 --- a/products/breg/examples/formats/explain/authored-display-model-explanation.json +++ b/products/breg/examples/formats/explain/authored-display-model-explanation.json @@ -634,7 +634,7 @@ "registryId": "labelled-directory", "requiresPostgis": false, "reviewAuthorities": [], - "revision": "sha256:93fe9251ad307ff3af5ed0b505d11071a592ecc459f4076009d4db4556157dcc", + "revision": "sha256:2422724a5ff2b11539885904d27cb3aad319e05b80f6655da444a12ee2da65ba", "statisticalDatasets": [ { "accessProfiles": { diff --git a/products/breg/examples/formats/explain/model-explanation.json b/products/breg/examples/formats/explain/model-explanation.json index 8cb78518e5..b908a4e2cd 100644 --- a/products/breg/examples/formats/explain/model-explanation.json +++ b/products/breg/examples/formats/explain/model-explanation.json @@ -2644,7 +2644,7 @@ "protocol": "id.registrystack.org/protocols/review/v1" } ], - "revision": "sha256:24f18ae5ae8cdf18d0df9b280db52b59d143fac1d4ce83727ff0817dbafef3f0", + "revision": "sha256:dca3c6da48851de9878daa19e0f15b48f867abc87bfd90a0e5ef738a75dc79bd", "statisticalDatasets": [], "version": "0.1.0" } diff --git a/products/breg/examples/formats/odrl-coverage.json b/products/breg/examples/formats/odrl-coverage.json index aabf05c8ac..e386fe5ca9 100644 --- a/products/breg/examples/formats/odrl-coverage.json +++ b/products/breg/examples/formats/odrl-coverage.json @@ -1 +1 @@ -{"apiVersion":"id.registrystack.org/formats/breg/odrl-coverage/v1alpha1","audience":"operator-review","excludedSurfaces":["actions","proposals","statistics","lookups","read-paths","revisions","snapshots","mutations","counts","filters","sorting","spatial-queries","data-export","provenance"],"grants":[{"accessProfile":"directory-editor","operation":"create","reasons":["unsupported-operation","row-boundaries"],"recordType":"contact","status":"omitted"},{"accessProfile":"directory-editor","operation":"get","reasons":["row-boundaries"],"recordType":"contact","status":"omitted"},{"accessProfile":"directory-editor","operation":"list","reasons":["row-boundaries"],"recordType":"contact","status":"omitted"},{"accessProfile":"directory-editor","operation":"patch","reasons":["unsupported-operation","row-boundaries"],"recordType":"contact","status":"omitted"}],"kind":"BRegOdrlCoverage","partial":true,"registryId":"local-directory","revision":"sha256:d6c90c29973020102501cac5271a73416ef1a9b31e9af0d77acba9042217e21a","scope":"record-operation-grants","selectedAccessProfile":null,"totals":{"considered":4,"exported":0,"omitted":4}} \ No newline at end of file +{"apiVersion":"id.registrystack.org/formats/breg/odrl-coverage/v1alpha1","audience":"operator-review","excludedSurfaces":["actions","proposals","statistics","lookups","read-paths","revisions","snapshots","mutations","counts","filters","sorting","spatial-queries","data-export","provenance"],"grants":[{"accessProfile":"directory-editor","operation":"create","reasons":["unsupported-operation","row-boundaries"],"recordType":"contact","status":"omitted"},{"accessProfile":"directory-editor","operation":"get","reasons":["row-boundaries"],"recordType":"contact","status":"omitted"},{"accessProfile":"directory-editor","operation":"list","reasons":["row-boundaries"],"recordType":"contact","status":"omitted"},{"accessProfile":"directory-editor","operation":"patch","reasons":["unsupported-operation","row-boundaries"],"recordType":"contact","status":"omitted"}],"kind":"BRegOdrlCoverage","partial":true,"registryId":"local-directory","revision":"sha256:5e7fbc35de52b6437ee46b9623af792b19758d176001c2d82acfc0c6c9a8c670","scope":"record-operation-grants","selectedAccessProfile":null,"totals":{"considered":4,"exported":0,"omitted":4}} \ No newline at end of file diff --git a/products/breg/examples/formats/odrl-policies.jsonld b/products/breg/examples/formats/odrl-policies.jsonld index 64479f25fe..0226f21730 100644 --- a/products/breg/examples/formats/odrl-policies.jsonld +++ b/products/breg/examples/formats/odrl-policies.jsonld @@ -1 +1 @@ -{"@context":{"dcterms":"http://purl.org/dc/terms/","odrl":"http://www.w3.org/ns/odrl/2/"},"@graph":[{"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3A93fe9251ad307ff3af5ed0b505d11071a592ecc459f4076009d4db4556157dcc:odrl:profiles:directory-editor:policy","@type":"odrl:Set","https://id.registrystack.org/vocab/breg-odrl/partial":true,"odrl:permission":[{"odrl:action":{"@id":"http://www.w3.org/ns/odrl/2/read"},"odrl:constraint":[{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/accessProfile"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":"directory-editor"}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/authenticated"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":true}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/delegatedActor"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":false}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/operation"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":"get"}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/taskGrantPresent"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":false}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/tokenScopes"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/hasPart"},"odrl:rightOperand":{"@list":[{"@value":"directory:write"}]}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/verifiedNonemptyClaims"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/hasPart"},"odrl:rightOperand":{"@list":[{"@value":"registry_principal"}]}}],"odrl:target":{"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3A93fe9251ad307ff3af5ed0b505d11071a592ecc459f4076009d4db4556157dcc:odrl:record-types:entry:profiles:directory-editor:operations:get:projection","@type":"odrl:Asset","https://id.registrystack.org/vocab/breg-odrl/readableFields":{"@list":[{"@value":"active"},{"@value":"code"},{"@value":"recorded-on"}]},"https://id.registrystack.org/vocab/breg-odrl/recordType":"entry","odrl:partOf":{"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3A93fe9251ad307ff3af5ed0b505d11071a592ecc459f4076009d4db4556157dcc:odrl:record-types:entry"}}},{"odrl:action":{"@id":"http://www.w3.org/ns/odrl/2/read"},"odrl:constraint":[{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/accessProfile"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":"directory-editor"}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/authenticated"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":true}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/delegatedActor"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":false}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/operation"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":"list"}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/taskGrantPresent"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":false}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/tokenScopes"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/hasPart"},"odrl:rightOperand":{"@list":[{"@value":"directory:write"}]}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/verifiedNonemptyClaims"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/hasPart"},"odrl:rightOperand":{"@list":[{"@value":"registry_principal"}]}}],"odrl:target":{"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3A93fe9251ad307ff3af5ed0b505d11071a592ecc459f4076009d4db4556157dcc:odrl:record-types:entry:profiles:directory-editor:operations:list:projection","@type":"odrl:Asset","https://id.registrystack.org/vocab/breg-odrl/readableFields":{"@list":[{"@value":"active"},{"@value":"code"},{"@value":"recorded-on"}]},"https://id.registrystack.org/vocab/breg-odrl/recordType":"entry","odrl:partOf":{"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3A93fe9251ad307ff3af5ed0b505d11071a592ecc459f4076009d4db4556157dcc:odrl:record-types:entry"}}}],"odrl:profile":[{"@id":"https://id.registrystack.org/profiles/breg-odrl/v1"}],"odrl:uid":{"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3A93fe9251ad307ff3af5ed0b505d11071a592ecc459f4076009d4db4556157dcc:odrl:profiles:directory-editor:policy"}}],"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3A93fe9251ad307ff3af5ed0b505d11071a592ecc459f4076009d4db4556157dcc:odrl:policies","http://purl.org/dc/terms/description":"Partial, non-enforcing projection of supported BReg record-operation grants; review coverage.json before use.","https://id.registrystack.org/vocab/breg-odrl/partial":true} \ No newline at end of file +{"@context":{"dcterms":"http://purl.org/dc/terms/","odrl":"http://www.w3.org/ns/odrl/2/"},"@graph":[{"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3A2422724a5ff2b11539885904d27cb3aad319e05b80f6655da444a12ee2da65ba:odrl:profiles:directory-editor:policy","@type":"odrl:Set","https://id.registrystack.org/vocab/breg-odrl/partial":true,"odrl:permission":[{"odrl:action":{"@id":"http://www.w3.org/ns/odrl/2/read"},"odrl:constraint":[{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/accessProfile"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":"directory-editor"}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/authenticated"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":true}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/delegatedActor"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":false}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/operation"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":"get"}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/taskGrantPresent"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":false}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/tokenScopes"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/hasPart"},"odrl:rightOperand":{"@list":[{"@value":"directory:write"}]}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/verifiedNonemptyClaims"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/hasPart"},"odrl:rightOperand":{"@list":[{"@value":"registry_principal"}]}}],"odrl:target":{"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3A2422724a5ff2b11539885904d27cb3aad319e05b80f6655da444a12ee2da65ba:odrl:record-types:entry:profiles:directory-editor:operations:get:projection","@type":"odrl:Asset","https://id.registrystack.org/vocab/breg-odrl/readableFields":{"@list":[{"@value":"active"},{"@value":"code"},{"@value":"recorded-on"}]},"https://id.registrystack.org/vocab/breg-odrl/recordType":"entry","odrl:partOf":{"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3A2422724a5ff2b11539885904d27cb3aad319e05b80f6655da444a12ee2da65ba:odrl:record-types:entry"}}},{"odrl:action":{"@id":"http://www.w3.org/ns/odrl/2/read"},"odrl:constraint":[{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/accessProfile"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":"directory-editor"}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/authenticated"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":true}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/delegatedActor"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":false}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/operation"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":"list"}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/taskGrantPresent"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/eq"},"odrl:rightOperand":{"@value":false}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/tokenScopes"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/hasPart"},"odrl:rightOperand":{"@list":[{"@value":"directory:write"}]}},{"odrl:leftOperand":{"@id":"https://id.registrystack.org/vocab/breg-odrl/verifiedNonemptyClaims"},"odrl:operator":{"@id":"http://www.w3.org/ns/odrl/2/hasPart"},"odrl:rightOperand":{"@list":[{"@value":"registry_principal"}]}}],"odrl:target":{"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3A2422724a5ff2b11539885904d27cb3aad319e05b80f6655da444a12ee2da65ba:odrl:record-types:entry:profiles:directory-editor:operations:list:projection","@type":"odrl:Asset","https://id.registrystack.org/vocab/breg-odrl/readableFields":{"@list":[{"@value":"active"},{"@value":"code"},{"@value":"recorded-on"}]},"https://id.registrystack.org/vocab/breg-odrl/recordType":"entry","odrl:partOf":{"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3A2422724a5ff2b11539885904d27cb3aad319e05b80f6655da444a12ee2da65ba:odrl:record-types:entry"}}}],"odrl:profile":[{"@id":"https://id.registrystack.org/profiles/breg-odrl/v1"}],"odrl:uid":{"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3A2422724a5ff2b11539885904d27cb3aad319e05b80f6655da444a12ee2da65ba:odrl:profiles:directory-editor:policy"}}],"@id":"urn:registrystack:breg:labelled-directory:revision:sha256%3A2422724a5ff2b11539885904d27cb3aad319e05b80f6655da444a12ee2da65ba:odrl:policies","http://purl.org/dc/terms/description":"Partial, non-enforcing projection of supported BReg record-operation grants; review coverage.json before use.","https://id.registrystack.org/vocab/breg-odrl/partial":true} \ No newline at end of file diff --git a/products/breg/examples/formats/source-export.json b/products/breg/examples/formats/source-export.json index b75a505646..67daed1631 100644 --- a/products/breg/examples/formats/source-export.json +++ b/products/breg/examples/formats/source-export.json @@ -1 +1 @@ -{"apiVersion":"id.registrystack.org/formats/breg/evidence-source-export/v1alpha1","kind":"BRegEvidenceSourceExport","sourceId":"registry-status","provenance":{"accessProfile":"evidence-source","behaviorRevision":"sha256:0fe08665e856376805945509e0bb0a232e9e0d956d4237b3f46c97296ba68358","entity":"record","producer":"bregctl","registryId":"registry","registryRevision":"sha256:74e51d2203375a56764cd94c9059c530e9619b3fefa82e59d6f65f3d2218f3a3"},"artifacts":[{"path":"adapter-packs/registry-status/pack.yaml","digest":"sha256:595d966808bed106ebd8bce96be7d21aca84ea1ec8d51700a538becd79d75fa7"},{"path":"adapter-packs/registry-status/protocols/registry-lookup.json","digest":"sha256:de5da14df16cbd9f8fc37a8580330242d50409aa15d28749904bc9c2823b41b2"},{"path":"adapter-packs/registry-status/schemas/facts.json","digest":"sha256:53d95c4a0be36815e2eddca510e8469e2d8aa5f57843436c7d97e8dd5f03fd12"},{"path":"adapter-packs/registry-status/schemas/inputs.json","digest":"sha256:458373dc1cda44d10f328dfaaa809ebaaffda45bd7b4292274e99326f877640a"},{"path":"adapter-packs/registry-status/schemas/response.json","digest":"sha256:80ceace892a817dcf12560d16ebe37fea09544a0b7c5f147fa11e9635fda9b9a"},{"path":"adapter-packs/registry-status/scripts/lookup.rhai","digest":"sha256:4c4d865446578334e6d9e774986dc5e68e9cdfe000c103e9cf325eda45842c45"},{"path":"selectors/breg-8-registry-6-record-22-by-registration-number.yaml","digest":"sha256:41eac0fcc67de6564be9447971c1291f271817ea3018e25d401810ac4fafc300"},{"path":"selectors/breg-8-registry-6-record-7-by-code.yaml","digest":"sha256:3912ec5c8bfeb077878266397a2c0f9f8cb991a200de92acba5bc31036c30300"},{"path":"sources/registry-status.yaml","digest":"sha256:841f1a0d8c5fb15c6e78c294454a6d3ef33cf9fa1c93e327e44a120fd98ee0e7"}]} \ No newline at end of file +{"apiVersion":"id.registrystack.org/formats/breg/evidence-source-export/v1alpha1","kind":"BRegEvidenceSourceExport","sourceId":"registry-status","provenance":{"accessProfile":"evidence-source","behaviorRevision":"sha256:0fe08665e856376805945509e0bb0a232e9e0d956d4237b3f46c97296ba68358","entity":"record","producer":"bregctl","registryId":"registry","registryRevision":"sha256:e4dc4121665a6067ef4d148ac4e794d33dd201e0268e2e79595ded22491b4b09"},"artifacts":[{"path":"adapter-packs/registry-status/pack.yaml","digest":"sha256:595d966808bed106ebd8bce96be7d21aca84ea1ec8d51700a538becd79d75fa7"},{"path":"adapter-packs/registry-status/protocols/registry-lookup.json","digest":"sha256:de5da14df16cbd9f8fc37a8580330242d50409aa15d28749904bc9c2823b41b2"},{"path":"adapter-packs/registry-status/schemas/facts.json","digest":"sha256:53d95c4a0be36815e2eddca510e8469e2d8aa5f57843436c7d97e8dd5f03fd12"},{"path":"adapter-packs/registry-status/schemas/inputs.json","digest":"sha256:458373dc1cda44d10f328dfaaa809ebaaffda45bd7b4292274e99326f877640a"},{"path":"adapter-packs/registry-status/schemas/response.json","digest":"sha256:80ceace892a817dcf12560d16ebe37fea09544a0b7c5f147fa11e9635fda9b9a"},{"path":"adapter-packs/registry-status/scripts/lookup.rhai","digest":"sha256:4c4d865446578334e6d9e774986dc5e68e9cdfe000c103e9cf325eda45842c45"},{"path":"selectors/breg-8-registry-6-record-22-by-registration-number.yaml","digest":"sha256:41eac0fcc67de6564be9447971c1291f271817ea3018e25d401810ac4fafc300"},{"path":"selectors/breg-8-registry-6-record-7-by-code.yaml","digest":"sha256:3912ec5c8bfeb077878266397a2c0f9f8cb991a200de92acba5bc31036c30300"},{"path":"sources/registry-status.yaml","digest":"sha256:841f1a0d8c5fb15c6e78c294454a6d3ef33cf9fa1c93e327e44a120fd98ee0e7"}]} \ No newline at end of file diff --git a/products/breg/generated/authoring/registry-module.schema.json b/products/breg/generated/authoring/registry-module.schema.json index 1b678a8105..319974f07a 100644 --- a/products/breg/generated/authoring/registry-module.schema.json +++ b/products/breg/generated/authoring/registry-module.schema.json @@ -119,6 +119,16 @@ "ActionEffectSource": { "additionalProperties": false, "properties": { + "attachments": { + "additionalProperties": { + "$ref": "#/$defs/EffectAttachmentSource" + }, + "description": "Record slots the effect fills, keyed by slot id. An immediate create\neffect takes files from the same request. A Proposal create or patch\neffect promotes files from Proposal attachment slots on apply.", + "propertyNames": { + "$ref": "#/$defs/LocalId" + }, + "type": "object" + }, "clear": { "default": [], "items": { @@ -2075,6 +2085,19 @@ ], "type": "string" }, + "EffectAttachmentSource": { + "additionalProperties": false, + "description": "Where an effect takes one record slot's file from. In an immediate\nAction it names a file in the same request. In a Proposal Action it names\na Proposal attachment slot, and applying the Proposal promotes that file.", + "properties": { + "fromAttachment": { + "$ref": "#/$defs/LocalId" + } + }, + "required": [ + "fromAttachment" + ], + "type": "object" + }, "EffectiveTimeSource": { "additionalProperties": false, "description": "A point or a span of effect. An open end means the effect has no end.", @@ -3353,6 +3376,42 @@ ], "type": "object" }, + "RecordAttachmentSlotSource": { + "additionalProperties": false, + "description": "One file slot on a record type. A file enters it through an immediate\nAction create effect in the same request, or when an applied Proposal\npromotes one of its files. Once written it never changes.", + "properties": { + "classification": { + "$ref": "#/$defs/Classification" + }, + "contentTypes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "$ref": "#/$defs/LocalId" + }, + "maximumBytes": { + "format": "uint32", + "maximum": 16777216, + "minimum": 1, + "type": "integer" + }, + "writeOnce": { + "description": "Must be `true`: a record slot holds the first file written to it.", + "type": "boolean" + } + }, + "required": [ + "id", + "maximumBytes", + "contentTypes", + "classification", + "writeOnce" + ], + "type": "object" + }, "ReferenceDelete": { "enum": [ "restrict" @@ -4362,6 +4421,14 @@ }, "type": "array" }, + "readableAttachments": { + "description": "Record attachment slots the profile may download. Requires `get`.", + "items": { + "type": "string" + }, + "type": "array", + "uniqueItems": true + }, "readableFields": { "default": [], "items": { @@ -4660,6 +4727,14 @@ }, "type": "array" }, + "readableAttachments": { + "description": "Record attachment slots the profile may download. Requires `get`.", + "items": { + "type": "string" + }, + "type": "array", + "uniqueItems": true + }, "readableFields": { "default": [], "items": { @@ -4762,6 +4837,13 @@ "apiName": { "type": "string" }, + "attachments": { + "description": "Write-once file slots filled by immediate Action create effects.", + "items": { + "$ref": "#/$defs/RecordAttachmentSlotSource" + }, + "type": "array" + }, "batch": { "$ref": "#/$defs/BatchSource" }, diff --git a/products/breg/generated/authoring/registry-project.schema.json b/products/breg/generated/authoring/registry-project.schema.json index 1a4efd15f8..fa1d357670 100644 --- a/products/breg/generated/authoring/registry-project.schema.json +++ b/products/breg/generated/authoring/registry-project.schema.json @@ -119,6 +119,16 @@ "ActionEffectSource": { "additionalProperties": false, "properties": { + "attachments": { + "additionalProperties": { + "$ref": "#/$defs/EffectAttachmentSource" + }, + "description": "Record slots the effect fills, keyed by slot id. An immediate create\neffect takes files from the same request. A Proposal create or patch\neffect promotes files from Proposal attachment slots on apply.", + "propertyNames": { + "$ref": "#/$defs/LocalId" + }, + "type": "object" + }, "clear": { "default": [], "items": { @@ -2177,6 +2187,19 @@ ], "type": "string" }, + "EffectAttachmentSource": { + "additionalProperties": false, + "description": "Where an effect takes one record slot's file from. In an immediate\nAction it names a file in the same request. In a Proposal Action it names\na Proposal attachment slot, and applying the Proposal promotes that file.", + "properties": { + "fromAttachment": { + "$ref": "#/$defs/LocalId" + } + }, + "required": [ + "fromAttachment" + ], + "type": "object" + }, "EffectiveTimeSource": { "additionalProperties": false, "description": "A point or a span of effect. An open end means the effect has no end.", @@ -2250,6 +2273,14 @@ }, "type": "array" }, + "readableAttachments": { + "description": "Record attachment slots the profile may download. Requires `get`.", + "items": { + "type": "string" + }, + "type": "array", + "uniqueItems": true + }, "readableFields": { "default": [], "items": { @@ -4484,6 +4515,42 @@ }, "type": "object" }, + "RecordAttachmentSlotSource": { + "additionalProperties": false, + "description": "One file slot on a record type. A file enters it through an immediate\nAction create effect in the same request, or when an applied Proposal\npromotes one of its files. Once written it never changes.", + "properties": { + "classification": { + "$ref": "#/$defs/Classification" + }, + "contentTypes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "$ref": "#/$defs/LocalId" + }, + "maximumBytes": { + "format": "uint32", + "maximum": 16777216, + "minimum": 1, + "type": "integer" + }, + "writeOnce": { + "description": "Must be `true`: a record slot holds the first file written to it.", + "type": "boolean" + } + }, + "required": [ + "id", + "maximumBytes", + "contentTypes", + "classification", + "writeOnce" + ], + "type": "object" + }, "ReferenceDelete": { "enum": [ "restrict" @@ -6261,6 +6328,14 @@ }, "type": "array" }, + "readableAttachments": { + "description": "Record attachment slots the profile may download. Requires `get`.", + "items": { + "type": "string" + }, + "type": "array", + "uniqueItems": true + }, "readableFields": { "default": [], "items": { @@ -6363,6 +6438,13 @@ "apiName": { "type": "string" }, + "attachments": { + "description": "Write-once file slots filled by immediate Action create effects.", + "items": { + "$ref": "#/$defs/RecordAttachmentSlotSource" + }, + "type": "array" + }, "batch": { "$ref": "#/$defs/BatchSource" }, diff --git a/products/breg/generated/facility/generated/openapi.json b/products/breg/generated/facility/generated/openapi.json index 7d8dd6ecc2..91f965d7f9 100644 --- a/products/breg/generated/facility/generated/openapi.json +++ b/products/breg/generated/facility/generated/openapi.json @@ -1 +1 @@ -{"components":{"schemas":{"ImmediateActionPrecondition":{"additionalProperties":false,"properties":{"ifMatch":{"maxLength":256,"minLength":3,"pattern":"^\\\"[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"required":["ifMatch"],"type":"object"},"ImmediateActionResultReference":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"format":"int64","minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"Problem":{"additionalProperties":false,"allOf":[{"if":{"properties":{"code":{"const":"write.outside-boundary"}}},"then":{"properties":{"code":{"const":"write.outside-boundary"},"detail":{"const":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition."},"status":{"const":403},"title":{"const":"Forbidden"},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId"]}}},{"if":{"properties":{"code":{"not":{"const":"action.guard_failed"}}}},"then":{"not":{"required":["guardReason"]}}},{"if":{"properties":{"code":{"const":"action.refused"}}},"then":{"properties":{"status":{"const":422}},"required":["refusalCode"]}},{"if":{"properties":{"code":{"const":"statistical_dataset.release_refused"}}},"then":{"properties":{"refusalCode":{"enum":["period-not-ended","before-first-period","provisional-after-final","already-withdrawn","negative-value"]},"status":{"const":422}},"required":["refusalCode"]}},{"if":{"properties":{"code":{"not":{"enum":["action.refused","statistical_dataset.release_refused"]}}}},"then":{"not":{"required":["refusalCode"]}}},{"if":{"properties":{"code":{"const":"statistical_dataset.version_withdrawn"}}},"then":{"properties":{"status":{"const":410}},"required":["reasonCode"]}},{"if":{"properties":{"code":{"not":{"const":"statistical_dataset.version_withdrawn"}}}},"then":{"not":{"required":["reasonCode"]}}},{"if":{"properties":{"code":{"const":"action.evidence_failed"}}},"then":{"properties":{"detail":{"const":"The declared Evidence dependency could not be accepted."},"fieldPath":{"pattern":"^/evidence/[a-z][a-z0-9_-]{0,63}$","type":"string"},"status":{"const":503}}}},{"if":{"properties":{"code":{"const":"action.handler_failed"}}},"then":{"properties":{"status":{"const":500}}}},{"if":{"anyOf":[{"required":["atField"]},{"required":["notAfterField"]}]},"then":{"properties":{"code":{"const":"request.invalid"},"status":{"const":400}},"required":["atField","notAfterField"]}},{"if":{"anyOf":[{"required":["recordType"]},{"required":["fieldId"]},{"required":["constraintId"]},{"required":["constraintKind"]},{"required":["left"]},{"required":["right"]},{"required":["field"]}]},"then":{"oneOf":[{"not":{"anyOf":[{"required":["constraintId"]},{"required":["constraintKind"]},{"required":["left"]},{"required":["right"]},{"required":["field"]}]},"required":["fieldId"]},{"not":{"required":["fieldId"]},"oneOf":[{"not":{"required":["field"]},"properties":{"constraintKind":{"const":"compare"}},"required":["left","right"]},{"not":{"anyOf":[{"required":["left"]},{"required":["right"]}]},"properties":{"constraintKind":{"enum":["int-range","vocabulary"]}},"required":["field"]}],"required":["constraintId","constraintKind"]}],"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409}},"required":["recordType"]}}],"properties":{"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["action.evidence_failed","action.guard_failed","action.handler_failed","action.refused","authentication.refused","idempotency.expired","idempotency.key-reused","ingestion.chunk_mismatch","ingestion.profile_mismatch","ingestion.receipt_erased","ingestion.run_blocked","ingestion.run_not_open","lookup.unresolved","mutation.conflict","precondition.failed","precondition.required","proposal.rejected","proposal.review_result_mismatch","proposal.submission_expired","query.cursor_invalid","query.filter_required","query.invalid","request.access_reason_required","request.invalid","request.timeout","resource.not_found","runtime.field_encryption.unavailable","service.unavailable","source.unavailable","statistical_dataset.domain_violation","statistical_dataset.release_refused","statistical_dataset.version_conflict","statistical_dataset.version_withdrawn","unsupported.media_type","write.outside-boundary"],"type":"string"},"constraintId":{"maxLength":128,"minLength":1,"type":"string"},"constraintKind":{"enum":["compare","int-range","vocabulary"],"type":"string"},"detail":{"maxLength":256,"type":"string"},"field":{"maxLength":128,"minLength":1,"type":"string"},"fieldId":{"maxLength":128,"minLength":1,"type":"string"},"fieldPath":{"maxLength":256,"type":"string"},"guardReason":{"pattern":"^[a-z][a-z0-9_-]{0,63}$","type":"string"},"left":{"maxLength":128,"minLength":1,"type":"string"},"notAfterField":{"maxLength":128,"minLength":1,"type":"string"},"reasonCode":{"enum":["computation-error","source-data-error","disclosure-risk"],"type":"string"},"recordType":{"maxLength":128,"minLength":1,"type":"string"},"refusalCode":{"maxLength":128,"minLength":1,"type":"string"},"requiredFilters":{"items":{"items":{"maxLength":64,"minLength":1,"type":"string"},"maxItems":32,"minItems":1,"type":"array","uniqueItems":true},"maxItems":8,"minItems":1,"type":"array"},"right":{"maxLength":128,"minLength":1,"type":"string"},"status":{"maximum":599,"minimum":400,"type":"integer"},"title":{"maxLength":128,"type":"string"},"traceId":{"maxLength":32,"minLength":32,"pattern":"^[0-9a-f]{32}$","type":"string"},"type":{"format":"uri","maxLength":256,"type":"string"}},"required":["type","title","status","detail","code","traceId"],"type":"object"},"ReviewCompletion":{"additionalProperties":false,"properties":{"completedAt":{"format":"date-time","type":"string"},"eventId":{"format":"uuid","type":"string"},"requestId":{"format":"uuid","type":"string"},"resultId":{"format":"uuid","type":"string"},"type":{"const":"review.completed"}},"required":["type","eventId","requestId","resultId","completedAt"],"type":"object"},"action-correct-address-invoke-input":{"$id":"urn:breg:action:correct-address:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityId":{"format":"uuid","type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-address","x-registry-requiredConditionKeys":[]},"action-correct-address-invoke-response":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"},"action-deactivate-facility-invoke-input":{"$id":"urn:breg:action:deactivate-facility:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"facilityId":{"format":"uuid","type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"deactivate-facility","x-registry-requiredConditionKeys":[]},"action-deactivate-facility-invoke-response":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"},"action-register-facility-availability-input":{"$id":"urn:breg:action:register-facility:availability-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"oneOf":[{"properties":{"input":{"properties":{"operatorId":{"format":"uuid","type":"string"}},"required":["operatorId"]},"targetInput":{"const":"operatorId"}}}],"properties":{"input":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityCode":{"maxLength":64,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"operatorId":{"format":"uuid","type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"}},"required":[],"type":"object"},"targetInput":{"enum":["operatorId"],"type":"string"}},"required":["targetInput","input"],"type":"object","x-registry-action":"register-facility"},"action-register-facility-availability-response":{"$id":"urn:breg:action:register-facility:availability-response","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"availability":{"oneOf":[{"additionalProperties":false,"properties":{"available":{"const":true},"observedRevision":{"format":"int64","minimum":1,"type":"integer"}},"required":["available","observedRevision"],"type":"object"},{"additionalProperties":false,"properties":{"available":{"const":false},"guardReason":{"pattern":"^[a-z][a-z0-9_-]{0,63}$","type":"string"},"observedRevision":{"format":"int64","minimum":1,"type":"integer"},"reason":{"const":"guard-not-satisfied"},"recovery":{"const":"none"}},"required":["available","observedRevision","reason","recovery"],"type":"object"},{"additionalProperties":false,"properties":{"available":{"type":"null"},"missingInputs":{"items":{"enum":["facilityCode","name","addressLine","city","postalCode","operatorId","jurisdiction"],"type":"string"},"minItems":1,"type":"array","uniqueItems":true},"observedRevision":{"format":"int64","minimum":1,"type":"integer"},"reason":{"const":"input-required"},"recovery":{"const":"correct-input"}},"required":["available","observedRevision","reason","recovery","missingInputs"],"type":"object"},{"additionalProperties":false,"properties":{"available":{"type":"null"},"observedRevision":{"type":"null"},"reason":{"const":"not-disclosed"},"recovery":{"const":"none"}},"required":["available","observedRevision","reason","recovery"],"type":"object"}]}},"required":["availability"],"type":"object","x-registry-action":"register-facility"},"action-register-facility-invoke-input":{"$id":"urn:breg:action:register-facility:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityCode":{"maxLength":64,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"operatorId":{"format":"uuid","type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"}},"required":["facilityCode","name","addressLine","city","postalCode","operatorId","jurisdiction"],"type":"object"},"preconditions":{"additionalProperties":false,"properties":{},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"register-facility","x-registry-requiredConditionKeys":[]},"action-register-facility-invoke-response":{"$id":"urn:breg:action:register-facility:invoke-response","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"action":{"const":"register-facility"},"applicationId":{"format":"uuid","type":"string"},"results":{"additionalProperties":false,"properties":{"assignment":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"const":"facility-assignment"},"revision":{"format":"int64","minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"facility":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"const":"facility"},"revision":{"format":"int64","minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"}},"required":["assignment","facility"],"type":"object"}},"required":["action","applicationId","results"],"type":"object"},"directory-entry":{"$id":"urn:breg:record-type:directory-entry","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"required":["name","email","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"},"directory-entry-create-input":{"$id":"urn:breg:record-type:directory-entry:input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"required":["name","email","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"},"facility":{"$id":"urn:breg:record-type:facility","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityCode":{"maxLength":64,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"facility-status"}},"required":["facilityCode","name","addressLine","city","postalCode","status","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable","x-registry-mutationPolicy":{"patch":"proposal-required"}},"facility-assignment":{"$id":"urn:breg:record-type:facility-assignment","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"facility":{"format":"uuid","type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operator":{"format":"uuid","type":"string"}},"required":["facility","operator","jurisdiction"],"type":"object","x-registry-mutationMode":"create-only"},"operator":{"$id":"urn:breg:record-type:operator","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"required":["operatorCode","status","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"},"operator-create-input":{"$id":"urn:breg:record-type:operator:input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"required":["operatorCode","status","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"}},"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}}},"info":{"title":"facility-registry","version":"0.1.0"},"openapi":"3.1.0","paths":{"/v1/actions/correct-address/proposals":{"post":{"operationId":"actions.correct-address.start","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to the action route, selected profile, package revision, normalized action input, preconditions, and granted result contract.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-correct-address-invoke-input"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-correct-address-invoke-response"}}},"description":"Proposal created","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag for the created Proposal.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Location":{"description":"Relative URL of the created Proposal.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-correction-author"],"x-registry-action":{"access":{"accessProfiles":["facility-correction-author"]},"apiName":"correctAddress","attachments":[{"contentTypes":["application/pdf"],"id":"supporting-document","maximumBytes":1048576,"required":false}],"bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"display":{"description":"Submit a frozen address correction for independent review and later application.","label":"Correct facility address"},"execution":{"application":"automatic","mode":"proposal","review":"required"},"id":"correct-address","inputMode":"handler","inputs":[{"apiName":"facilityId","classification":"internal","fieldType":{"onDelete":"restrict","target":"facility","type":"reference"},"id":"facility","label":"facilityId","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"addressLine","classification":"internal","fieldType":{"maximumLength":240,"minimumLength":1,"type":"string"},"id":"address-line","label":"addressLine","nullable":false,"required":true,"schema":{"maxLength":240,"minLength":1,"type":"string"}},{"apiName":"city","classification":"internal","fieldType":{"maximumLength":120,"minimumLength":1,"type":"string"},"id":"city","label":"city","nullable":false,"required":true,"schema":{"maxLength":120,"minLength":1,"type":"string"}},{"apiName":"postalCode","classification":"internal","fieldType":{"maximumLength":24,"minimumLength":1,"type":"string"},"id":"postal-code","label":"postalCode","nullable":false,"required":true,"schema":{"maxLength":24,"minLength":1,"type":"string"}}],"maximumInputStringBytes":16384,"referenceInputs":[{"apiName":"facilityId","input":"facility","targetRecordType":"facility"}],"requiredConditionKeys":[],"resultEffects":[{"effect":"facility-address","operation":"patch","recordType":"facility"}],"revision":"sha256:efb20d40704ae6c133b660f2fe3d556b4a00ee5478a5871cf1fd026e7d7b6b7a","route":"/v1/actions/correct-address/proposals","routes":{"availability":null,"start":{"inputSchema":"action-correct-address-invoke-input","method":"POST","operationId":"actions.correct-address.start","path":"/v1/actions/correct-address/proposals","requiresIdempotencyKey":true,"responseSchema":"action-correct-address-invoke-response"}}},"x-registry-defaultAccessProfile":"facility-correction-author","x-registry-operation":"start","x-registry-routeKind":"invoke"}},"/v1/actions/deactivate-facility/proposals":{"post":{"operationId":"actions.deactivate-facility.start","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to the action route, selected profile, package revision, normalized action input, preconditions, and granted result contract.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-deactivate-facility-invoke-input"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-deactivate-facility-invoke-response"}}},"description":"Proposal created","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag for the created Proposal.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Location":{"description":"Relative URL of the created Proposal.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-correction-author"],"x-registry-action":{"access":{"accessProfiles":["facility-correction-author"]},"apiName":"deactivateFacility","attachments":[],"bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"display":{"description":"Submit a durable deactivation that requires no external review.","label":"Deactivate facility"},"execution":{"application":"manual","mode":"proposal","review":"none"},"id":"deactivate-facility","inputMode":"fixed","inputs":[{"apiName":"facilityId","classification":"internal","fieldType":{"onDelete":"restrict","target":"facility","type":"reference"},"id":"facility","label":"facilityId","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"facilityId","input":"facility","targetRecordType":"facility"}],"requiredConditionKeys":[],"resultEffects":[{"effect":"facility-status","operation":"patch","recordType":"facility"}],"revision":"sha256:9237300ee419a0014c3b123cc7ac90eb9623cb4c45bba4a65c03936083299f1d","route":"/v1/actions/deactivate-facility/proposals","routes":{"availability":null,"start":{"inputSchema":"action-deactivate-facility-invoke-input","method":"POST","operationId":"actions.deactivate-facility.start","path":"/v1/actions/deactivate-facility/proposals","requiresIdempotencyKey":true,"responseSchema":"action-deactivate-facility-invoke-response"}}},"x-registry-defaultAccessProfile":"facility-correction-author","x-registry-operation":"start","x-registry-routeKind":"invoke"}},"/v1/actions/register-facility":{"post":{"operationId":"actions.register-facility.invoke","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to the action route, selected profile, package revision, normalized action input, preconditions, and granted result contract.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-register-facility-invoke-input"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-register-facility-invoke-response"}}},"description":"Immediate action committed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"action.guard_failed":{"value":{"code":"action.guard_failed","detail":"The action guard was not satisfied.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/action/guard_failed"}},"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"runtime.field_encryption.unavailable":{"value":{"code":"runtime.field_encryption.unavailable","detail":"The Registry field-encryption service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/runtime/field_encryption/unavailable"}},"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-registrar"],"x-registry-action":{"access":{"accessProfiles":["facility-registrar"]},"apiName":"registerFacility","bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"conditionRoute":null,"display":{"description":"Create a facility and its initial operator assignment atomically.","label":"Register facility"},"execution":{"mode":"immediate"},"id":"register-facility","inputMode":"fixed","inputs":[{"apiName":"facilityCode","classification":"internal","fieldType":{"maximumLength":64,"minimumLength":1,"type":"string"},"id":"facility-code","label":"facilityCode","nullable":false,"required":true,"schema":{"maxLength":64,"minLength":1,"type":"string"}},{"apiName":"name","classification":"internal","fieldType":{"maximumLength":200,"minimumLength":1,"type":"string"},"id":"name","label":"name","nullable":false,"required":true,"schema":{"maxLength":200,"minLength":1,"type":"string"}},{"apiName":"addressLine","classification":"internal","fieldType":{"maximumLength":240,"minimumLength":1,"type":"string"},"id":"address-line","label":"addressLine","nullable":false,"required":true,"schema":{"maxLength":240,"minLength":1,"type":"string"}},{"apiName":"city","classification":"internal","fieldType":{"maximumLength":120,"minimumLength":1,"type":"string"},"id":"city","label":"city","nullable":false,"required":true,"schema":{"maxLength":120,"minLength":1,"type":"string"}},{"apiName":"postalCode","classification":"internal","fieldType":{"maximumLength":24,"minimumLength":1,"type":"string"},"id":"postal-code","label":"postalCode","nullable":false,"required":true,"schema":{"maxLength":24,"minLength":1,"type":"string"}},{"apiName":"operatorId","classification":"internal","fieldType":{"onDelete":"restrict","target":"operator","type":"reference"},"id":"operator","label":"operatorId","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"jurisdiction","classification":"internal","fieldType":{"maximumLength":40,"minimumLength":1,"type":"string"},"id":"jurisdiction","label":"jurisdiction","nullable":false,"required":true,"schema":{"maxLength":40,"minLength":1,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"operatorId","input":"operator","targetRecordType":"operator"}],"requiredConditionKeys":[],"resultEffects":[{"effect":"facility","operation":"create","recordType":"facility"},{"effect":"assignment","operation":"create","recordType":"facility-assignment"}],"revision":"sha256:5b5de70fa9b8f831387fc08e520f16fccd71863f18f3efe8b7999728927910f6","route":"/v1/actions/register-facility","routes":{"availability":{"inputSchema":"action-register-facility-availability-input","method":"POST","operationId":"actions.register-facility.availability","path":"/v1/actions/register-facility/availability","requiresIdempotencyKey":false,"responseSchema":"action-register-facility-availability-response"},"invoke":{"inputSchema":"action-register-facility-invoke-input","method":"POST","operationId":"actions.register-facility.invoke","path":"/v1/actions/register-facility","requiresIdempotencyKey":true,"responseSchema":"action-register-facility-invoke-response"},"targetConditions":null}},"x-registry-defaultAccessProfile":"facility-registrar","x-registry-operation":"invoke","x-registry-routeKind":"invoke"}},"/v1/actions/register-facility/availability":{"post":{"operationId":"actions.register-facility.availability","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-register-facility-availability-input"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-register-facility-availability-response"}}},"description":"Action availability returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"runtime.field_encryption.unavailable":{"value":{"code":"runtime.field_encryption.unavailable","detail":"The Registry field-encryption service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/runtime/field_encryption/unavailable"}},"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-registrar"],"x-registry-action":{"access":{"accessProfiles":["facility-registrar"]},"apiName":"registerFacility","bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"conditionRoute":null,"display":{"description":"Create a facility and its initial operator assignment atomically.","label":"Register facility"},"execution":{"mode":"immediate"},"id":"register-facility","inputMode":"fixed","inputs":[{"apiName":"facilityCode","classification":"internal","fieldType":{"maximumLength":64,"minimumLength":1,"type":"string"},"id":"facility-code","label":"facilityCode","nullable":false,"required":true,"schema":{"maxLength":64,"minLength":1,"type":"string"}},{"apiName":"name","classification":"internal","fieldType":{"maximumLength":200,"minimumLength":1,"type":"string"},"id":"name","label":"name","nullable":false,"required":true,"schema":{"maxLength":200,"minLength":1,"type":"string"}},{"apiName":"addressLine","classification":"internal","fieldType":{"maximumLength":240,"minimumLength":1,"type":"string"},"id":"address-line","label":"addressLine","nullable":false,"required":true,"schema":{"maxLength":240,"minLength":1,"type":"string"}},{"apiName":"city","classification":"internal","fieldType":{"maximumLength":120,"minimumLength":1,"type":"string"},"id":"city","label":"city","nullable":false,"required":true,"schema":{"maxLength":120,"minLength":1,"type":"string"}},{"apiName":"postalCode","classification":"internal","fieldType":{"maximumLength":24,"minimumLength":1,"type":"string"},"id":"postal-code","label":"postalCode","nullable":false,"required":true,"schema":{"maxLength":24,"minLength":1,"type":"string"}},{"apiName":"operatorId","classification":"internal","fieldType":{"onDelete":"restrict","target":"operator","type":"reference"},"id":"operator","label":"operatorId","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"jurisdiction","classification":"internal","fieldType":{"maximumLength":40,"minimumLength":1,"type":"string"},"id":"jurisdiction","label":"jurisdiction","nullable":false,"required":true,"schema":{"maxLength":40,"minLength":1,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"operatorId","input":"operator","targetRecordType":"operator"}],"requiredConditionKeys":[],"resultEffects":[{"effect":"facility","operation":"create","recordType":"facility"},{"effect":"assignment","operation":"create","recordType":"facility-assignment"}],"revision":"sha256:5b5de70fa9b8f831387fc08e520f16fccd71863f18f3efe8b7999728927910f6","route":"/v1/actions/register-facility","routes":{"availability":{"inputSchema":"action-register-facility-availability-input","method":"POST","operationId":"actions.register-facility.availability","path":"/v1/actions/register-facility/availability","requiresIdempotencyKey":false,"responseSchema":"action-register-facility-availability-response"},"invoke":{"inputSchema":"action-register-facility-invoke-input","method":"POST","operationId":"actions.register-facility.invoke","path":"/v1/actions/register-facility","requiresIdempotencyKey":true,"responseSchema":"action-register-facility-invoke-response"},"targetConditions":null}},"x-registry-defaultAccessProfile":"facility-registrar","x-registry-operation":"invoke","x-registry-routeKind":"availability"}},"/v1/proposals":{"get":{"operationId":"proposals.list","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"type":"string"}},{"in":"query","name":"action","schema":{"type":"string"}},{"in":"query","name":"owner","schema":{"const":"caller"}},{"in":"query","name":"target","schema":{"format":"uuid","type":"string"}},{"in":"query","name":"state","schema":{"enum":["draft","submitted","applied","cancelled","rejected"]}},{"in":"query","name":"turn","schema":{"enum":["party","official","nobody"]}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"description":"The most items a page holds. A page may hold fewer than `limit` items, so keep paging while `nextCursor` is present.","in":"query","name":"limit","schema":{"default":50,"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"pendingManualApplication","schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"items":{"items":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"},"maxItems":100,"type":"array"},"nextCursor":{"type":"string"}},"required":["items"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-applier","facility-correction-author"]}},"/v1/proposals/review-context":{"get":{"description":"One bounded transport exchange under each item's current get-review-context authority. Ordered visible or concealed results; operational failures refuse the whole batch. Maximum response is 8 MiB.","operationId":"proposals.get-review-context-batch","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["proposal-reviewer"],"type":"string"}},{"description":"One to 100 distinct canonical Proposal UUIDs, in response order.","explode":false,"in":"query","name":"ids","required":true,"schema":{"items":{"format":"uuid","type":"string"},"maxItems":100,"minItems":1,"type":"array","uniqueItems":true},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"items":{"items":{"oneOf":[{"additionalProperties":false,"properties":{"context":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"authority":{"type":"string"},"context":{"additionalProperties":false,"properties":{"contract":{"additionalProperties":false,"properties":{"id":{"maxLength":2048,"pattern":"^urn:registry:breg:review-context:","type":"string"},"revision":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"schemaDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"}},"required":["id","revision","schemaDigest"],"type":"object"},"fields":{"type":"object"},"reference":{"type":"string"}},"required":["reference","contract","fields"],"type":"object"},"effectDigest":{"type":"string"},"id":{"format":"uuid","type":"string"},"policy":{"additionalProperties":false,"properties":{"digest":{"type":"string"},"id":{"type":"string"},"version":{"type":"string"}},"required":["id","version","digest"],"type":"object"},"result":{"additionalProperties":false,"properties":{"availableUntil":{"format":"date-time","type":"string"},"completedAt":{"format":"date-time","type":"string"},"resultId":{"format":"uuid","type":"string"},"state":{"enum":["pending","approved","rejected","changes-requested","answered","cancelled","superseded","expired"]}},"required":["state"],"type":"object"},"reviewable":{"type":"boolean"},"revision":{"minimum":1,"type":"integer"},"subject":{"additionalProperties":false,"properties":{"digest":{"type":"string"},"id":{"format":"uuid","type":"string"},"source":{"type":"string"},"subjectType":{"const":"proposal"},"version":{"type":"string"}},"required":["source","subjectType","id","version","digest"],"type":"object"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["id","actionId","actionRevision","submissionVersion","revision","effectDigest","subject","context","reviewable"],"type":"object"},"id":{"format":"uuid","type":"string"},"status":{"const":"visible"}},"required":["id","status","context"],"type":"object"},{"additionalProperties":false,"properties":{"id":{"format":"uuid","type":"string"},"status":{"const":"concealed"}},"required":["id","status"],"type":"object"}]},"maxItems":100,"minItems":1,"type":"array"}},"required":["items"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["proposal-reviewer"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"dependentRequired":{"appliedAt":["appliedBy"],"appliedBy":["appliedAt"]},"properties":{"applicationId":{"format":"uuid","type":"string"},"appliedAt":{"description":"Application time, present with appliedBy only when the selected profile holds get-application-actor.","format":"date-time","type":"string"},"appliedBy":{"description":"Keyed actor pseudonym, present with appliedAt only when the selected profile holds get-application-actor.","pattern":"^hmac-sha256:[0-9a-f]{64}$","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-applier","facility-correction-author"]}},"/v1/proposals/{proposal_id}/apply":{"post":{"operationId":"proposals.apply","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-applier"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"reason":{"description":"Optional application explanation, preserved unchanged. At most 4096 Unicode characters; NUL is refused.","maxLength":4096,"pattern":"^[^\\u0000]*$","type":"string"},"submissionVersion":{"maximum":4294967295,"minimum":1,"type":"integer"}},"required":["submissionVersion","effectDigest"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed, or a Record revision guard failed (`precondition.failed`); a failed field commit guard answers `action.guard_failed` when the selected profile can read it"}},"x-registry-accessProfiles":["facility-correction-applier"]}},"/v1/proposals/{proposal_id}/attachments/supporting-document":{"delete":{"operationId":"proposals.attachments.supporting-document.delete","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author"]},"get":{"operationId":"proposals.attachments.supporting-document.get","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author","proposal-reviewer"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"submissionVersion","required":true,"schema":{"maximum":4294967295,"minimum":1,"type":"integer"}},{"description":"All three review-context query members are required together and select only get-review-context authority. Omit all three for ordinary get authority.","in":"query","name":"reviewContextField","required":false,"schema":{"pattern":"^[a-z][a-zA-Z0-9]{0,63}$","type":"string"}},{"description":"All three review-context query members are required together and select only get-review-context authority. Omit all three for ordinary get authority.","in":"query","name":"effectDigest","required":false,"schema":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"}},{"description":"All three review-context query members are required together and select only get-review-context authority. Omit all three for ordinary get authority.","in":"query","name":"contextSchemaDigest","required":false,"schema":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"}}],"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","maxLength":16777216,"type":"string"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author","proposal-reviewer"]},"patch":{"operationId":"proposals.attachments.supporting-document.patch","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/pdf":{"schema":{"format":"binary","maxLength":1048576,"type":"string"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$id":"urn:breg:action:correct-address:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityId":{"format":"uuid","type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-address","x-registry-requiredConditionKeys":[]},{"$id":"urn:breg:action:deactivate-facility:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"facilityId":{"format":"uuid","type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"deactivate-facility","x-registry-requiredConditionKeys":[]}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/rebase":{"post":{"operationId":"proposals.rebase","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$id":"urn:breg:action:correct-address:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityId":{"format":"uuid","type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-address","x-registry-requiredConditionKeys":[]},{"$id":"urn:breg:action:deactivate-facility:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"facilityId":{"format":"uuid","type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"deactivate-facility","x-registry-requiredConditionKeys":[]}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/retry":{"post":{"operationId":"proposals.retry","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/review-context":{"get":{"operationId":"proposals.get-review-context","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["proposal-reviewer"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"authority":{"type":"string"},"context":{"additionalProperties":false,"properties":{"contract":{"additionalProperties":false,"properties":{"id":{"maxLength":2048,"pattern":"^urn:registry:breg:review-context:","type":"string"},"revision":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"schemaDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"}},"required":["id","revision","schemaDigest"],"type":"object"},"fields":{"type":"object"},"reference":{"type":"string"}},"required":["reference","contract","fields"],"type":"object"},"effectDigest":{"type":"string"},"id":{"format":"uuid","type":"string"},"policy":{"additionalProperties":false,"properties":{"digest":{"type":"string"},"id":{"type":"string"},"version":{"type":"string"}},"required":["id","version","digest"],"type":"object"},"result":{"additionalProperties":false,"properties":{"availableUntil":{"format":"date-time","type":"string"},"completedAt":{"format":"date-time","type":"string"},"resultId":{"format":"uuid","type":"string"},"state":{"enum":["pending","approved","rejected","changes-requested","answered","cancelled","superseded","expired"]}},"required":["state"],"type":"object"},"reviewable":{"type":"boolean"},"revision":{"minimum":1,"type":"integer"},"subject":{"additionalProperties":false,"properties":{"digest":{"type":"string"},"id":{"format":"uuid","type":"string"},"source":{"type":"string"},"subjectType":{"const":"proposal"},"version":{"type":"string"}},"required":["source","subjectType","id","version","digest"],"type":"object"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["id","actionId","actionRevision","submissionVersion","revision","effectDigest","subject","context","reviewable"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["proposal-reviewer"]}},"/v1/proposals/{proposal_id}/review-status":{"get":{"operationId":"proposals.get-review-status","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["casework-review-status","facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Request the institution's optional applicant-visible progress code. The code is returned only when the selected caller-owned grant enables readableReviewProgress.","in":"query","name":"include","required":false,"schema":{"const":"progress"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"authority":{"type":"string"},"context":{"additionalProperties":false,"properties":{"contract":{"additionalProperties":false,"properties":{"id":{"maxLength":2048,"pattern":"^urn:registry:breg:review-context:","type":"string"},"revision":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"schemaDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"}},"required":["id","revision","schemaDigest"],"type":"object"},"reference":{"type":"string"}},"required":["reference"],"type":"object"},"effectDigest":{"type":"string"},"handoff":{"additionalProperties":false,"properties":{"reason":{"enum":["remote-refused","producer-identity-mismatch","review-acceptance-changed","review-policy-changed","submission-recovery-expired","operator-closed","unspecified"]},"state":{"enum":["pending","accepted","failed","withdrawn"]}},"required":["state"],"type":"object"},"id":{"format":"uuid","type":"string"},"policy":{"additionalProperties":false,"properties":{"digest":{"type":"string"},"id":{"type":"string"},"version":{"type":"string"}},"required":["id","version","digest"],"type":"object"},"progressCode":{"description":"Institution-defined applicant-visible progress. Absent when the institution conceals the current stage, progress was not requested or granted, the provider is unavailable, or the accepted review round is no longer live.","maxLength":64,"pattern":"^[a-z][a-z0-9_-]{0,63}$","type":"string"},"requestId":{"format":"uuid","type":"string"},"result":{"additionalProperties":false,"properties":{"availableUntil":{"format":"date-time","type":"string"},"completedAt":{"format":"date-time","type":"string"},"resultId":{"format":"uuid","type":"string"},"state":{"enum":["pending","approved","rejected","changes-requested","answered","cancelled","superseded","expired"]}},"required":["state"],"type":"object"},"reviewable":{"type":"boolean"},"revision":{"minimum":1,"type":"integer"},"subject":{"additionalProperties":false,"properties":{"digest":{"type":"string"},"id":{"format":"uuid","type":"string"},"source":{"type":"string"},"subjectType":{"const":"proposal"},"version":{"type":"string"}},"required":["source","subjectType","id","version","digest"],"type":"object"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["id","actionId","actionRevision","submissionVersion","revision","effectDigest","subject","context","reviewable"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["casework-review-status","facility-correction-author"]}},"/v1/proposals/{proposal_id}/revise":{"post":{"operationId":"proposals.revise","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$id":"urn:breg:action:correct-address:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityId":{"format":"uuid","type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-address","x-registry-requiredConditionKeys":[]},{"$id":"urn:breg:action:deactivate-facility:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"facilityId":{"format":"uuid","type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"deactivate-facility","x-registry-requiredConditionKeys":[]},{"additionalProperties":false,"type":"object"}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"submission_version","required":true,"schema":{"maximum":4294967295,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"application":{"anyOf":[{"additionalProperties":false,"dependentRequired":{"appliedAt":["appliedBy"],"appliedBy":["appliedAt"]},"properties":{"applicationId":{"format":"uuid","type":"string"},"appliedAt":{"description":"Application time, present with appliedBy only when the selected profile holds get-application-actor.","format":"date-time","type":"string"},"appliedBy":{"description":"Keyed actor pseudonym, present with appliedAt only when the selected profile holds get-application-actor.","pattern":"^hmac-sha256:[0-9a-f]{64}$","type":"string"},"state":{"const":"applied"}},"required":["state","applicationId"],"type":"object"},{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},{"type":"null"}]},"current":{"type":"boolean"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"review":{"anyOf":[{"additionalProperties":false,"properties":{"availableUntil":{"format":"date-time","type":"string"},"completedAt":{"format":"date-time","type":"string"},"resultId":{"format":"uuid","type":"string"},"state":{"enum":["pending","approved","rejected","changes-requested","answered","cancelled","superseded","expired"]}},"required":["state"],"type":"object"},{"type":"null"}]},"submissionVersion":{"maximum":4294967295,"minimum":1,"type":"integer"}},"required":["id","actionId","submissionVersion","current","effectDigest","review","application"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"410":{"description":"The submission's review result and application receipt are no longer retained"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-applier","facility-correction-author"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed, or a Record revision guard failed (`precondition.failed`); a failed field commit guard answers `action.guard_failed` when the selected profile can read it"}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/records/directory-entries":{"get":{"operationId":"records.directory-entry.list","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Strict Registry read filter expression over compiled filterable API properties.","explode":false,"in":"query","name":"$filter","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"One compiled sortable property, ascending only.","explode":false,"in":"query","name":"$orderby","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Bounded page size.","explode":false,"in":"query","name":"$top","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Request count when the selected compiled query profile allows it.","explode":false,"in":"query","name":"$count","required":false,"schema":{"type":"boolean"}},{"description":"Opaque continuation cursor for the next page.","explode":false,"in":"query","name":"$skiptoken","required":false,"schema":{"maxLength":10978,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta","@context"],"type":"object"}}},"description":"Records returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"query.cursor_invalid":{"value":{"code":"query.cursor_invalid","detail":"The query cursor is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/cursor_invalid"}},"query.invalid":{"value":{"code":"query.invalid","detail":"The query request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/invalid"}},"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"directory-editor":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"directory-editor","selectableProperties":["email","jurisdiction","name"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"directory-entry","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"directory-entry","x-registry-responseShape":"RegistryRecordCollectionV1"},"post":{"operationId":"records.directory-entry.create","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to method, route, caller, target record, package revision, request body, and response field set.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/directory-entry-create-input"}},"required":["data"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/directory-entry"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/directory-entry"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record created","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Location":{"description":"Relative URL of the created record.","schema":{"type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"403":{"content":{"application/problem+json":{"examples":{"write.outside-boundary":{"value":{"code":"write.outside-boundary","detail":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"create","x-registry-recordType":"directory-entry","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"directory-entry","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/directory-entries/{record_id}":{"get":{"operationId":"records.directory-entry.get","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"get","x-registry-recordType":"directory-entry","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"directory-entry","x-registry-responseShape":"RegistryRecordSingleV1"},"patch":{"operationId":"records.directory-entry.patch","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to method, route, caller, target record, package revision, request body, and response field set.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}},{"description":"Strong Registry ETag for the currently visible record representation.","in":"header","name":"If-Match","required":true,"schema":{"maxLength":256,"minLength":6,"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"requestBody":{"content":{"application/json-patch+json":{"schema":{"items":{"additionalProperties":false,"else":{"required":["value"]},"if":{"properties":{"op":{"const":"remove"}}},"properties":{"op":{"enum":["add","replace","remove","test"],"type":"string"},"path":{"type":"string"},"value":true},"required":["op","path"],"then":{"not":{"required":["value"]}},"type":"object"},"maxItems":128,"minItems":1,"type":"array"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/directory-entry"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/directory-entry"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record patched","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"403":{"content":{"application/problem+json":{"examples":{"write.outside-boundary":{"value":{"code":"write.outside-boundary","detail":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"428":{"content":{"application/problem+json":{"examples":{"precondition.required":{"value":{"code":"precondition.required","detail":"The mutation precondition is required.","status":428,"title":"Precondition Required","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"patch","x-registry-recordType":"directory-entry","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"directory-entry","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/facilities":{"get":{"operationId":"records.facility.list","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Strict Registry read filter expression over compiled filterable API properties.","explode":false,"in":"query","name":"$filter","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"One compiled sortable property, ascending only.","explode":false,"in":"query","name":"$orderby","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Bounded page size.","explode":false,"in":"query","name":"$top","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Request count when the selected compiled query profile allows it.","explode":false,"in":"query","name":"$count","required":false,"schema":{"type":"boolean"}},{"description":"Opaque continuation cursor for the next page.","explode":false,"in":"query","name":"$skiptoken","required":false,"schema":{"maxLength":10978,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityCode":{"maxLength":64,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"facility-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityCode":{"maxLength":64,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"facility-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta","@context"],"type":"object"}}},"description":"Records returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"query.cursor_invalid":{"value":{"code":"query.cursor_invalid","detail":"The query cursor is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/cursor_invalid"}},"query.invalid":{"value":{"code":"query.invalid","detail":"The query request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/invalid"}},"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-reader"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"facility-reader":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"facility-reader","selectableProperties":["addressLine","city","facilityCode","jurisdiction","name","postalCode","status"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"facility","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"facility","x-registry-responseShape":"RegistryRecordCollectionV1"}},"/v1/records/facilities/{record_id}":{"get":{"operationId":"records.facility.get","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":true,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityCode":{"maxLength":64,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"facility-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityCode":{"maxLength":64,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"facility-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-reader","proposal-reviewer"],"x-registry-operation":"get","x-registry-recordType":"facility","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"facility","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/facilities/{record_id}/operators":{"get":{"operationId":"records.facility.path.operators","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Strict Registry read filter expression over compiled filterable API properties.","explode":false,"in":"query","name":"$filter","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"One compiled sortable property, ascending only.","explode":false,"in":"query","name":"$orderby","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Bounded page size.","explode":false,"in":"query","name":"$top","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Request count when the selected compiled query profile allows it.","explode":false,"in":"query","name":"$count","required":false,"schema":{"type":"boolean"}},{"description":"Opaque continuation cursor for the next page.","explode":false,"in":"query","name":"$skiptoken","required":false,"schema":{"maxLength":10978,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta","@context"],"type":"object"}}},"description":"Records returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"query.cursor_invalid":{"value":{"code":"query.cursor_invalid","detail":"The query cursor is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/cursor_invalid"}},"query.invalid":{"value":{"code":"query.invalid","detail":"The query request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/invalid"}},"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-reader"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"facility-reader":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"facility-reader","selectableProperties":["jurisdiction","operatorCode","status"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"facility","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"operator","x-registry-responseShape":"RegistryRecordCollectionV1"}},"/v1/records/facility-assignments":{"get":{"operationId":"records.facility-assignment.list","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Strict Registry read filter expression over compiled filterable API properties.","explode":false,"in":"query","name":"$filter","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"One compiled sortable property, ascending only.","explode":false,"in":"query","name":"$orderby","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Bounded page size.","explode":false,"in":"query","name":"$top","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Request count when the selected compiled query profile allows it.","explode":false,"in":"query","name":"$count","required":false,"schema":{"type":"boolean"}},{"description":"Opaque continuation cursor for the next page.","explode":false,"in":"query","name":"$skiptoken","required":false,"schema":{"maxLength":10978,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"facility":{"format":"uuid","type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operator":{"format":"uuid","type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility-assignment"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"facility":{"format":"uuid","type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operator":{"format":"uuid","type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility-assignment"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta","@context"],"type":"object"}}},"description":"Records returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"query.cursor_invalid":{"value":{"code":"query.cursor_invalid","detail":"The query cursor is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/cursor_invalid"}},"query.invalid":{"value":{"code":"query.invalid","detail":"The query request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/invalid"}},"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-reader"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"facility-reader":{"allowCount":false,"filterableProperties":[{"operators":["equals","in","is-null","is-not-null"],"property":"facility"},{"operators":["equals","in","is-null","is-not-null"],"property":"operator"}],"kind":"list","maximumPageSize":100,"profile":"facility-reader","selectableProperties":["facility","jurisdiction","operator"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"facility-assignment","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"facility-assignment","x-registry-responseShape":"RegistryRecordCollectionV1"}},"/v1/records/facility-assignments/{record_id}":{"get":{"operationId":"records.facility-assignment.get","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"facility":{"format":"uuid","type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operator":{"format":"uuid","type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility-assignment"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"facility":{"format":"uuid","type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operator":{"format":"uuid","type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility-assignment"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-reader"],"x-registry-operation":"get","x-registry-recordType":"facility-assignment","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"facility-assignment","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/operators":{"get":{"operationId":"records.operator.list","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":true,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Strict Registry read filter expression over compiled filterable API properties.","explode":false,"in":"query","name":"$filter","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"One compiled sortable property, ascending only.","explode":false,"in":"query","name":"$orderby","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Bounded page size.","explode":false,"in":"query","name":"$top","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Request count when the selected compiled query profile allows it.","explode":false,"in":"query","name":"$count","required":false,"schema":{"type":"boolean"}},{"description":"Opaque continuation cursor for the next page.","explode":false,"in":"query","name":"$skiptoken","required":false,"schema":{"maxLength":10978,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta","@context"],"type":"object"}}},"description":"Records returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"query.cursor_invalid":{"value":{"code":"query.cursor_invalid","detail":"The query cursor is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/cursor_invalid"}},"query.invalid":{"value":{"code":"query.invalid","detail":"The query request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/invalid"}},"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-reader","operator-editor"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"facility-reader":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"facility-reader","selectableProperties":["jurisdiction","operatorCode","status"],"selectorProperties":[],"sortableProperties":[],"temporal":null},"operator-editor":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"operator-editor","selectableProperties":["jurisdiction","operatorCode","status"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"operator","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"operator","x-registry-responseShape":"RegistryRecordCollectionV1"},"post":{"operationId":"records.operator.create","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to method, route, caller, target record, package revision, request body, and response field set.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/operator-create-input"}},"required":["data"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/operator"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/operator"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record created","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Location":{"description":"Relative URL of the created record.","schema":{"type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"403":{"content":{"application/problem+json":{"examples":{"write.outside-boundary":{"value":{"code":"write.outside-boundary","detail":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["operator-editor"],"x-registry-operation":"create","x-registry-recordType":"operator","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"operator","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/operators/{record_id}":{"get":{"operationId":"records.operator.get","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":true,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-reader","operator-editor"],"x-registry-operation":"get","x-registry-recordType":"operator","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"operator","x-registry-responseShape":"RegistryRecordSingleV1"},"patch":{"operationId":"records.operator.patch","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to method, route, caller, target record, package revision, request body, and response field set.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}},{"description":"Strong Registry ETag for the currently visible record representation.","in":"header","name":"If-Match","required":true,"schema":{"maxLength":256,"minLength":6,"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"requestBody":{"content":{"application/json-patch+json":{"schema":{"items":{"additionalProperties":false,"else":{"required":["value"]},"if":{"properties":{"op":{"const":"remove"}}},"properties":{"op":{"enum":["add","replace","remove","test"],"type":"string"},"path":{"type":"string"},"value":true},"required":["op","path"],"then":{"not":{"required":["value"]}},"type":"object"},"maxItems":128,"minItems":1,"type":"array"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/operator"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/operator"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record patched","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"403":{"content":{"application/problem+json":{"examples":{"write.outside-boundary":{"value":{"code":"write.outside-boundary","detail":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"428":{"content":{"application/problem+json":{"examples":{"precondition.required":{"value":{"code":"precondition.required","detail":"The mutation precondition is required.","status":428,"title":"Precondition Required","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["operator-editor"],"x-registry-operation":"patch","x-registry-recordType":"operator","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"operator","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/review-completions":{"post":{"description":"Available when a review authority configures a completion token and recipient binding.","operationId":"receiveReviewCompletion","parameters":[{"in":"header","name":"Registry-Recipient-Binding","required":true,"schema":{"maxLength":256,"minLength":1,"type":"string"}},{"description":"Must equal eventId.","in":"header","name":"Idempotency-Key","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewCompletion"}}},"required":true},"responses":{"204":{"description":"Completion accepted or already recorded."},"400":{"description":"The completion or idempotency binding is invalid."},"401":{"description":"The completion authority could not be authenticated."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"bearerAuth":[]}],"summary":"Receive a Casework review completion"}}}} \ No newline at end of file +{"components":{"schemas":{"ImmediateActionPrecondition":{"additionalProperties":false,"properties":{"ifMatch":{"maxLength":256,"minLength":3,"pattern":"^\\\"[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"required":["ifMatch"],"type":"object"},"ImmediateActionResultReference":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"format":"int64","minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"Problem":{"additionalProperties":false,"allOf":[{"if":{"properties":{"code":{"const":"write.outside-boundary"}}},"then":{"properties":{"code":{"const":"write.outside-boundary"},"detail":{"const":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition."},"status":{"const":403},"title":{"const":"Forbidden"},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId"]}}},{"if":{"properties":{"code":{"not":{"const":"action.guard_failed"}}}},"then":{"not":{"required":["guardReason"]}}},{"if":{"properties":{"code":{"const":"action.refused"}}},"then":{"properties":{"status":{"const":422}},"required":["refusalCode"]}},{"if":{"properties":{"code":{"const":"statistical_dataset.release_refused"}}},"then":{"properties":{"refusalCode":{"enum":["period-not-ended","before-first-period","provisional-after-final","already-withdrawn","negative-value"]},"status":{"const":422}},"required":["refusalCode"]}},{"if":{"properties":{"code":{"not":{"enum":["action.refused","statistical_dataset.release_refused"]}}}},"then":{"not":{"required":["refusalCode"]}}},{"if":{"properties":{"code":{"const":"statistical_dataset.version_withdrawn"}}},"then":{"properties":{"status":{"const":410}},"required":["reasonCode"]}},{"if":{"properties":{"code":{"not":{"const":"statistical_dataset.version_withdrawn"}}}},"then":{"not":{"required":["reasonCode"]}}},{"if":{"properties":{"code":{"const":"action.evidence_failed"}}},"then":{"properties":{"detail":{"const":"The declared Evidence dependency could not be accepted."},"fieldPath":{"pattern":"^/evidence/[a-z][a-z0-9_-]{0,63}$","type":"string"},"status":{"const":503}}}},{"if":{"properties":{"code":{"const":"action.handler_failed"}}},"then":{"properties":{"status":{"const":500}}}},{"if":{"anyOf":[{"required":["atField"]},{"required":["notAfterField"]}]},"then":{"properties":{"code":{"const":"request.invalid"},"status":{"const":400}},"required":["atField","notAfterField"]}},{"if":{"anyOf":[{"required":["recordType"]},{"required":["fieldId"]},{"required":["constraintId"]},{"required":["constraintKind"]},{"required":["left"]},{"required":["right"]},{"required":["field"]}]},"then":{"oneOf":[{"not":{"anyOf":[{"required":["constraintId"]},{"required":["constraintKind"]},{"required":["left"]},{"required":["right"]},{"required":["field"]}]},"required":["fieldId"]},{"not":{"required":["fieldId"]},"oneOf":[{"not":{"required":["field"]},"properties":{"constraintKind":{"const":"compare"}},"required":["left","right"]},{"not":{"anyOf":[{"required":["left"]},{"required":["right"]}]},"properties":{"constraintKind":{"enum":["int-range","vocabulary"]}},"required":["field"]}],"required":["constraintId","constraintKind"]}],"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409}},"required":["recordType"]}}],"properties":{"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["action.evidence_failed","action.guard_failed","action.handler_failed","action.refused","attachment.content-type","attachment.digest-mismatch","attachment.slot-write-once","attachment.too-large","authentication.refused","idempotency.expired","idempotency.key-reused","ingestion.chunk_mismatch","ingestion.profile_mismatch","ingestion.receipt_erased","ingestion.run_blocked","ingestion.run_not_open","lookup.unresolved","mutation.conflict","precondition.failed","precondition.required","proposal.rejected","proposal.review_result_mismatch","proposal.submission_expired","query.cursor_invalid","query.filter_required","query.invalid","request.access_reason_required","request.invalid","request.timeout","resource.not_found","runtime.field_encryption.unavailable","service.unavailable","source.unavailable","statistical_dataset.domain_violation","statistical_dataset.release_refused","statistical_dataset.version_conflict","statistical_dataset.version_withdrawn","unsupported.media_type","write.outside-boundary"],"type":"string"},"constraintId":{"maxLength":128,"minLength":1,"type":"string"},"constraintKind":{"enum":["compare","int-range","vocabulary"],"type":"string"},"detail":{"maxLength":256,"type":"string"},"field":{"maxLength":128,"minLength":1,"type":"string"},"fieldId":{"maxLength":128,"minLength":1,"type":"string"},"fieldPath":{"maxLength":256,"type":"string"},"guardReason":{"pattern":"^[a-z][a-z0-9_-]{0,63}$","type":"string"},"left":{"maxLength":128,"minLength":1,"type":"string"},"notAfterField":{"maxLength":128,"minLength":1,"type":"string"},"reasonCode":{"enum":["computation-error","source-data-error","disclosure-risk"],"type":"string"},"recordType":{"maxLength":128,"minLength":1,"type":"string"},"refusalCode":{"maxLength":128,"minLength":1,"type":"string"},"requiredFilters":{"items":{"items":{"maxLength":64,"minLength":1,"type":"string"},"maxItems":32,"minItems":1,"type":"array","uniqueItems":true},"maxItems":8,"minItems":1,"type":"array"},"right":{"maxLength":128,"minLength":1,"type":"string"},"status":{"maximum":599,"minimum":400,"type":"integer"},"title":{"maxLength":128,"type":"string"},"traceId":{"maxLength":32,"minLength":32,"pattern":"^[0-9a-f]{32}$","type":"string"},"type":{"format":"uri","maxLength":256,"type":"string"}},"required":["type","title","status","detail","code","traceId"],"type":"object"},"ReviewCompletion":{"additionalProperties":false,"properties":{"completedAt":{"format":"date-time","type":"string"},"eventId":{"format":"uuid","type":"string"},"requestId":{"format":"uuid","type":"string"},"resultId":{"format":"uuid","type":"string"},"type":{"const":"review.completed"}},"required":["type","eventId","requestId","resultId","completedAt"],"type":"object"},"action-correct-address-invoke-input":{"$id":"urn:breg:action:correct-address:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityId":{"format":"uuid","type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-address","x-registry-requiredConditionKeys":[]},"action-correct-address-invoke-response":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"},"action-deactivate-facility-invoke-input":{"$id":"urn:breg:action:deactivate-facility:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"facilityId":{"format":"uuid","type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"deactivate-facility","x-registry-requiredConditionKeys":[]},"action-deactivate-facility-invoke-response":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"},"action-register-facility-availability-input":{"$id":"urn:breg:action:register-facility:availability-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"oneOf":[{"properties":{"input":{"properties":{"operatorId":{"format":"uuid","type":"string"}},"required":["operatorId"]},"targetInput":{"const":"operatorId"}}}],"properties":{"input":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityCode":{"maxLength":64,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"operatorId":{"format":"uuid","type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"}},"required":[],"type":"object"},"targetInput":{"enum":["operatorId"],"type":"string"}},"required":["targetInput","input"],"type":"object","x-registry-action":"register-facility"},"action-register-facility-availability-response":{"$id":"urn:breg:action:register-facility:availability-response","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"availability":{"oneOf":[{"additionalProperties":false,"properties":{"available":{"const":true},"observedRevision":{"format":"int64","minimum":1,"type":"integer"}},"required":["available","observedRevision"],"type":"object"},{"additionalProperties":false,"properties":{"available":{"const":false},"guardReason":{"pattern":"^[a-z][a-z0-9_-]{0,63}$","type":"string"},"observedRevision":{"format":"int64","minimum":1,"type":"integer"},"reason":{"const":"guard-not-satisfied"},"recovery":{"const":"none"}},"required":["available","observedRevision","reason","recovery"],"type":"object"},{"additionalProperties":false,"properties":{"available":{"type":"null"},"missingInputs":{"items":{"enum":["facilityCode","name","addressLine","city","postalCode","operatorId","jurisdiction"],"type":"string"},"minItems":1,"type":"array","uniqueItems":true},"observedRevision":{"format":"int64","minimum":1,"type":"integer"},"reason":{"const":"input-required"},"recovery":{"const":"correct-input"}},"required":["available","observedRevision","reason","recovery","missingInputs"],"type":"object"},{"additionalProperties":false,"properties":{"available":{"type":"null"},"observedRevision":{"type":"null"},"reason":{"const":"not-disclosed"},"recovery":{"const":"none"}},"required":["available","observedRevision","reason","recovery"],"type":"object"}]}},"required":["availability"],"type":"object","x-registry-action":"register-facility"},"action-register-facility-invoke-input":{"$id":"urn:breg:action:register-facility:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityCode":{"maxLength":64,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"operatorId":{"format":"uuid","type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"}},"required":["facilityCode","name","addressLine","city","postalCode","operatorId","jurisdiction"],"type":"object"},"preconditions":{"additionalProperties":false,"properties":{},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"register-facility","x-registry-requiredConditionKeys":[]},"action-register-facility-invoke-response":{"$id":"urn:breg:action:register-facility:invoke-response","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"action":{"const":"register-facility"},"applicationId":{"format":"uuid","type":"string"},"results":{"additionalProperties":false,"properties":{"assignment":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"const":"facility-assignment"},"revision":{"format":"int64","minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"facility":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"const":"facility"},"revision":{"format":"int64","minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"}},"required":["assignment","facility"],"type":"object"}},"required":["action","applicationId","results"],"type":"object"},"directory-entry":{"$id":"urn:breg:record-type:directory-entry","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"required":["name","email","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"},"directory-entry-create-input":{"$id":"urn:breg:record-type:directory-entry:input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"required":["name","email","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"},"facility":{"$id":"urn:breg:record-type:facility","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityCode":{"maxLength":64,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"facility-status"}},"required":["facilityCode","name","addressLine","city","postalCode","status","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable","x-registry-mutationPolicy":{"patch":"proposal-required"}},"facility-assignment":{"$id":"urn:breg:record-type:facility-assignment","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"facility":{"format":"uuid","type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operator":{"format":"uuid","type":"string"}},"required":["facility","operator","jurisdiction"],"type":"object","x-registry-mutationMode":"create-only"},"operator":{"$id":"urn:breg:record-type:operator","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"required":["operatorCode","status","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"},"operator-create-input":{"$id":"urn:breg:record-type:operator:input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"required":["operatorCode","status","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"}},"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}}},"info":{"title":"facility-registry","version":"0.1.0"},"openapi":"3.1.0","paths":{"/v1/actions/correct-address/proposals":{"post":{"operationId":"actions.correct-address.start","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to the action route, selected profile, package revision, normalized action input, preconditions, and granted result contract.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-correct-address-invoke-input"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-correct-address-invoke-response"}}},"description":"Proposal created","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag for the created Proposal.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Location":{"description":"Relative URL of the created Proposal.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-correction-author"],"x-registry-action":{"access":{"accessProfiles":["facility-correction-author"]},"apiName":"correctAddress","attachments":[{"contentTypes":["application/pdf"],"id":"supporting-document","maximumBytes":1048576,"required":false}],"bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"display":{"description":"Submit a frozen address correction for independent review and later application.","label":"Correct facility address"},"execution":{"application":"automatic","mode":"proposal","review":"required"},"id":"correct-address","inputMode":"handler","inputs":[{"apiName":"facilityId","classification":"internal","fieldType":{"onDelete":"restrict","target":"facility","type":"reference"},"id":"facility","label":"facilityId","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"addressLine","classification":"internal","fieldType":{"maximumLength":240,"minimumLength":1,"type":"string"},"id":"address-line","label":"addressLine","nullable":false,"required":true,"schema":{"maxLength":240,"minLength":1,"type":"string"}},{"apiName":"city","classification":"internal","fieldType":{"maximumLength":120,"minimumLength":1,"type":"string"},"id":"city","label":"city","nullable":false,"required":true,"schema":{"maxLength":120,"minLength":1,"type":"string"}},{"apiName":"postalCode","classification":"internal","fieldType":{"maximumLength":24,"minimumLength":1,"type":"string"},"id":"postal-code","label":"postalCode","nullable":false,"required":true,"schema":{"maxLength":24,"minLength":1,"type":"string"}}],"maximumInputStringBytes":16384,"referenceInputs":[{"apiName":"facilityId","input":"facility","targetRecordType":"facility"}],"requiredConditionKeys":[],"resultEffects":[{"effect":"facility-address","operation":"patch","recordType":"facility"}],"revision":"sha256:efb20d40704ae6c133b660f2fe3d556b4a00ee5478a5871cf1fd026e7d7b6b7a","route":"/v1/actions/correct-address/proposals","routes":{"availability":null,"start":{"inputSchema":"action-correct-address-invoke-input","method":"POST","operationId":"actions.correct-address.start","path":"/v1/actions/correct-address/proposals","requiresIdempotencyKey":true,"responseSchema":"action-correct-address-invoke-response"}}},"x-registry-defaultAccessProfile":"facility-correction-author","x-registry-operation":"start","x-registry-routeKind":"invoke"}},"/v1/actions/deactivate-facility/proposals":{"post":{"operationId":"actions.deactivate-facility.start","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to the action route, selected profile, package revision, normalized action input, preconditions, and granted result contract.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-deactivate-facility-invoke-input"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-deactivate-facility-invoke-response"}}},"description":"Proposal created","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag for the created Proposal.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Location":{"description":"Relative URL of the created Proposal.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-correction-author"],"x-registry-action":{"access":{"accessProfiles":["facility-correction-author"]},"apiName":"deactivateFacility","attachments":[],"bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"display":{"description":"Submit a durable deactivation that requires no external review.","label":"Deactivate facility"},"execution":{"application":"manual","mode":"proposal","review":"none"},"id":"deactivate-facility","inputMode":"fixed","inputs":[{"apiName":"facilityId","classification":"internal","fieldType":{"onDelete":"restrict","target":"facility","type":"reference"},"id":"facility","label":"facilityId","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"facilityId","input":"facility","targetRecordType":"facility"}],"requiredConditionKeys":[],"resultEffects":[{"effect":"facility-status","operation":"patch","recordType":"facility"}],"revision":"sha256:9237300ee419a0014c3b123cc7ac90eb9623cb4c45bba4a65c03936083299f1d","route":"/v1/actions/deactivate-facility/proposals","routes":{"availability":null,"start":{"inputSchema":"action-deactivate-facility-invoke-input","method":"POST","operationId":"actions.deactivate-facility.start","path":"/v1/actions/deactivate-facility/proposals","requiresIdempotencyKey":true,"responseSchema":"action-deactivate-facility-invoke-response"}}},"x-registry-defaultAccessProfile":"facility-correction-author","x-registry-operation":"start","x-registry-routeKind":"invoke"}},"/v1/actions/register-facility":{"post":{"operationId":"actions.register-facility.invoke","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to the action route, selected profile, package revision, normalized action input, preconditions, and granted result contract.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-register-facility-invoke-input"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-register-facility-invoke-response"}}},"description":"Immediate action committed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"action.guard_failed":{"value":{"code":"action.guard_failed","detail":"The action guard was not satisfied.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/action/guard_failed"}},"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"runtime.field_encryption.unavailable":{"value":{"code":"runtime.field_encryption.unavailable","detail":"The Registry field-encryption service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/runtime/field_encryption/unavailable"}},"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-registrar"],"x-registry-action":{"access":{"accessProfiles":["facility-registrar"]},"apiName":"registerFacility","bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"conditionRoute":null,"display":{"description":"Create a facility and its initial operator assignment atomically.","label":"Register facility"},"execution":{"mode":"immediate"},"id":"register-facility","inputMode":"fixed","inputs":[{"apiName":"facilityCode","classification":"internal","fieldType":{"maximumLength":64,"minimumLength":1,"type":"string"},"id":"facility-code","label":"facilityCode","nullable":false,"required":true,"schema":{"maxLength":64,"minLength":1,"type":"string"}},{"apiName":"name","classification":"internal","fieldType":{"maximumLength":200,"minimumLength":1,"type":"string"},"id":"name","label":"name","nullable":false,"required":true,"schema":{"maxLength":200,"minLength":1,"type":"string"}},{"apiName":"addressLine","classification":"internal","fieldType":{"maximumLength":240,"minimumLength":1,"type":"string"},"id":"address-line","label":"addressLine","nullable":false,"required":true,"schema":{"maxLength":240,"minLength":1,"type":"string"}},{"apiName":"city","classification":"internal","fieldType":{"maximumLength":120,"minimumLength":1,"type":"string"},"id":"city","label":"city","nullable":false,"required":true,"schema":{"maxLength":120,"minLength":1,"type":"string"}},{"apiName":"postalCode","classification":"internal","fieldType":{"maximumLength":24,"minimumLength":1,"type":"string"},"id":"postal-code","label":"postalCode","nullable":false,"required":true,"schema":{"maxLength":24,"minLength":1,"type":"string"}},{"apiName":"operatorId","classification":"internal","fieldType":{"onDelete":"restrict","target":"operator","type":"reference"},"id":"operator","label":"operatorId","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"jurisdiction","classification":"internal","fieldType":{"maximumLength":40,"minimumLength":1,"type":"string"},"id":"jurisdiction","label":"jurisdiction","nullable":false,"required":true,"schema":{"maxLength":40,"minLength":1,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"operatorId","input":"operator","targetRecordType":"operator"}],"requiredConditionKeys":[],"resultEffects":[{"effect":"facility","operation":"create","recordType":"facility"},{"effect":"assignment","operation":"create","recordType":"facility-assignment"}],"revision":"sha256:5b5de70fa9b8f831387fc08e520f16fccd71863f18f3efe8b7999728927910f6","route":"/v1/actions/register-facility","routes":{"availability":{"inputSchema":"action-register-facility-availability-input","method":"POST","operationId":"actions.register-facility.availability","path":"/v1/actions/register-facility/availability","requiresIdempotencyKey":false,"responseSchema":"action-register-facility-availability-response"},"invoke":{"inputSchema":"action-register-facility-invoke-input","method":"POST","operationId":"actions.register-facility.invoke","path":"/v1/actions/register-facility","requiresIdempotencyKey":true,"responseSchema":"action-register-facility-invoke-response"},"targetConditions":null}},"x-registry-defaultAccessProfile":"facility-registrar","x-registry-operation":"invoke","x-registry-routeKind":"invoke"}},"/v1/actions/register-facility/availability":{"post":{"operationId":"actions.register-facility.availability","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-register-facility-availability-input"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-register-facility-availability-response"}}},"description":"Action availability returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"runtime.field_encryption.unavailable":{"value":{"code":"runtime.field_encryption.unavailable","detail":"The Registry field-encryption service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/runtime/field_encryption/unavailable"}},"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-registrar"],"x-registry-action":{"access":{"accessProfiles":["facility-registrar"]},"apiName":"registerFacility","bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"conditionRoute":null,"display":{"description":"Create a facility and its initial operator assignment atomically.","label":"Register facility"},"execution":{"mode":"immediate"},"id":"register-facility","inputMode":"fixed","inputs":[{"apiName":"facilityCode","classification":"internal","fieldType":{"maximumLength":64,"minimumLength":1,"type":"string"},"id":"facility-code","label":"facilityCode","nullable":false,"required":true,"schema":{"maxLength":64,"minLength":1,"type":"string"}},{"apiName":"name","classification":"internal","fieldType":{"maximumLength":200,"minimumLength":1,"type":"string"},"id":"name","label":"name","nullable":false,"required":true,"schema":{"maxLength":200,"minLength":1,"type":"string"}},{"apiName":"addressLine","classification":"internal","fieldType":{"maximumLength":240,"minimumLength":1,"type":"string"},"id":"address-line","label":"addressLine","nullable":false,"required":true,"schema":{"maxLength":240,"minLength":1,"type":"string"}},{"apiName":"city","classification":"internal","fieldType":{"maximumLength":120,"minimumLength":1,"type":"string"},"id":"city","label":"city","nullable":false,"required":true,"schema":{"maxLength":120,"minLength":1,"type":"string"}},{"apiName":"postalCode","classification":"internal","fieldType":{"maximumLength":24,"minimumLength":1,"type":"string"},"id":"postal-code","label":"postalCode","nullable":false,"required":true,"schema":{"maxLength":24,"minLength":1,"type":"string"}},{"apiName":"operatorId","classification":"internal","fieldType":{"onDelete":"restrict","target":"operator","type":"reference"},"id":"operator","label":"operatorId","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"jurisdiction","classification":"internal","fieldType":{"maximumLength":40,"minimumLength":1,"type":"string"},"id":"jurisdiction","label":"jurisdiction","nullable":false,"required":true,"schema":{"maxLength":40,"minLength":1,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"operatorId","input":"operator","targetRecordType":"operator"}],"requiredConditionKeys":[],"resultEffects":[{"effect":"facility","operation":"create","recordType":"facility"},{"effect":"assignment","operation":"create","recordType":"facility-assignment"}],"revision":"sha256:5b5de70fa9b8f831387fc08e520f16fccd71863f18f3efe8b7999728927910f6","route":"/v1/actions/register-facility","routes":{"availability":{"inputSchema":"action-register-facility-availability-input","method":"POST","operationId":"actions.register-facility.availability","path":"/v1/actions/register-facility/availability","requiresIdempotencyKey":false,"responseSchema":"action-register-facility-availability-response"},"invoke":{"inputSchema":"action-register-facility-invoke-input","method":"POST","operationId":"actions.register-facility.invoke","path":"/v1/actions/register-facility","requiresIdempotencyKey":true,"responseSchema":"action-register-facility-invoke-response"},"targetConditions":null}},"x-registry-defaultAccessProfile":"facility-registrar","x-registry-operation":"invoke","x-registry-routeKind":"availability"}},"/v1/proposals":{"get":{"operationId":"proposals.list","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"type":"string"}},{"in":"query","name":"action","schema":{"type":"string"}},{"in":"query","name":"owner","schema":{"const":"caller"}},{"in":"query","name":"target","schema":{"format":"uuid","type":"string"}},{"in":"query","name":"state","schema":{"enum":["draft","submitted","applied","cancelled","rejected"]}},{"in":"query","name":"turn","schema":{"enum":["party","official","nobody"]}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"description":"The most items a page holds. A page may hold fewer than `limit` items, so keep paging while `nextCursor` is present.","in":"query","name":"limit","schema":{"default":50,"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"pendingManualApplication","schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"items":{"items":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"},"maxItems":100,"type":"array"},"nextCursor":{"type":"string"}},"required":["items"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-applier","facility-correction-author"]}},"/v1/proposals/review-context":{"get":{"description":"One bounded transport exchange under each item's current get-review-context authority. Ordered visible or concealed results; operational failures refuse the whole batch. Maximum response is 8 MiB.","operationId":"proposals.get-review-context-batch","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["proposal-reviewer"],"type":"string"}},{"description":"One to 100 distinct canonical Proposal UUIDs, in response order.","explode":false,"in":"query","name":"ids","required":true,"schema":{"items":{"format":"uuid","type":"string"},"maxItems":100,"minItems":1,"type":"array","uniqueItems":true},"style":"form"}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"items":{"items":{"oneOf":[{"additionalProperties":false,"properties":{"context":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"authority":{"type":"string"},"context":{"additionalProperties":false,"properties":{"contract":{"additionalProperties":false,"properties":{"id":{"maxLength":2048,"pattern":"^urn:registry:breg:review-context:","type":"string"},"revision":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"schemaDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"}},"required":["id","revision","schemaDigest"],"type":"object"},"fields":{"type":"object"},"reference":{"type":"string"}},"required":["reference","contract","fields"],"type":"object"},"effectDigest":{"type":"string"},"id":{"format":"uuid","type":"string"},"policy":{"additionalProperties":false,"properties":{"digest":{"type":"string"},"id":{"type":"string"},"version":{"type":"string"}},"required":["id","version","digest"],"type":"object"},"result":{"additionalProperties":false,"properties":{"availableUntil":{"format":"date-time","type":"string"},"completedAt":{"format":"date-time","type":"string"},"resultId":{"format":"uuid","type":"string"},"state":{"enum":["pending","approved","rejected","changes-requested","answered","cancelled","superseded","expired"]}},"required":["state"],"type":"object"},"reviewable":{"type":"boolean"},"revision":{"minimum":1,"type":"integer"},"subject":{"additionalProperties":false,"properties":{"digest":{"type":"string"},"id":{"format":"uuid","type":"string"},"source":{"type":"string"},"subjectType":{"const":"proposal"},"version":{"type":"string"}},"required":["source","subjectType","id","version","digest"],"type":"object"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["id","actionId","actionRevision","submissionVersion","revision","effectDigest","subject","context","reviewable"],"type":"object"},"id":{"format":"uuid","type":"string"},"status":{"const":"visible"}},"required":["id","status","context"],"type":"object"},{"additionalProperties":false,"properties":{"id":{"format":"uuid","type":"string"},"status":{"const":"concealed"}},"required":["id","status"],"type":"object"}]},"maxItems":100,"minItems":1,"type":"array"}},"required":["items"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["proposal-reviewer"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"dependentRequired":{"appliedAt":["appliedBy"],"appliedBy":["appliedAt"]},"properties":{"applicationId":{"format":"uuid","type":"string"},"appliedAt":{"description":"Application time, present with appliedBy only when the selected profile holds get-application-actor.","format":"date-time","type":"string"},"appliedBy":{"description":"Keyed actor pseudonym, present with appliedAt only when the selected profile holds get-application-actor.","pattern":"^hmac-sha256:[0-9a-f]{64}$","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-applier","facility-correction-author"]}},"/v1/proposals/{proposal_id}/apply":{"post":{"operationId":"proposals.apply","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-applier"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"reason":{"description":"Optional application explanation, preserved unchanged. At most 4096 Unicode characters; NUL is refused.","maxLength":4096,"pattern":"^[^\\u0000]*$","type":"string"},"submissionVersion":{"maximum":4294967295,"minimum":1,"type":"integer"}},"required":["submissionVersion","effectDigest"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed, or a Record revision guard failed (`precondition.failed`); a failed field commit guard answers `action.guard_failed` when the selected profile can read it"}},"x-registry-accessProfiles":["facility-correction-applier"]}},"/v1/proposals/{proposal_id}/attachments/supporting-document":{"delete":{"operationId":"proposals.attachments.supporting-document.delete","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author"]},"get":{"operationId":"proposals.attachments.supporting-document.get","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author","proposal-reviewer"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"submissionVersion","required":true,"schema":{"maximum":4294967295,"minimum":1,"type":"integer"}},{"description":"All three review-context query members are required together and select only get-review-context authority. Omit all three for ordinary get authority.","in":"query","name":"reviewContextField","required":false,"schema":{"pattern":"^[a-z][a-zA-Z0-9]{0,63}$","type":"string"}},{"description":"All three review-context query members are required together and select only get-review-context authority. Omit all three for ordinary get authority.","in":"query","name":"effectDigest","required":false,"schema":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"}},{"description":"All three review-context query members are required together and select only get-review-context authority. Omit all three for ordinary get authority.","in":"query","name":"contextSchemaDigest","required":false,"schema":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"}}],"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","maxLength":16777216,"type":"string"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author","proposal-reviewer"]},"patch":{"operationId":"proposals.attachments.supporting-document.patch","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/pdf":{"schema":{"format":"binary","maxLength":1048576,"type":"string"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$id":"urn:breg:action:correct-address:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityId":{"format":"uuid","type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-address","x-registry-requiredConditionKeys":[]},{"$id":"urn:breg:action:deactivate-facility:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"facilityId":{"format":"uuid","type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"deactivate-facility","x-registry-requiredConditionKeys":[]}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/rebase":{"post":{"operationId":"proposals.rebase","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$id":"urn:breg:action:correct-address:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityId":{"format":"uuid","type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-address","x-registry-requiredConditionKeys":[]},{"$id":"urn:breg:action:deactivate-facility:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"facilityId":{"format":"uuid","type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"deactivate-facility","x-registry-requiredConditionKeys":[]}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/retry":{"post":{"operationId":"proposals.retry","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/review-context":{"get":{"operationId":"proposals.get-review-context","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["proposal-reviewer"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"authority":{"type":"string"},"context":{"additionalProperties":false,"properties":{"contract":{"additionalProperties":false,"properties":{"id":{"maxLength":2048,"pattern":"^urn:registry:breg:review-context:","type":"string"},"revision":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"schemaDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"}},"required":["id","revision","schemaDigest"],"type":"object"},"fields":{"type":"object"},"reference":{"type":"string"}},"required":["reference","contract","fields"],"type":"object"},"effectDigest":{"type":"string"},"id":{"format":"uuid","type":"string"},"policy":{"additionalProperties":false,"properties":{"digest":{"type":"string"},"id":{"type":"string"},"version":{"type":"string"}},"required":["id","version","digest"],"type":"object"},"result":{"additionalProperties":false,"properties":{"availableUntil":{"format":"date-time","type":"string"},"completedAt":{"format":"date-time","type":"string"},"resultId":{"format":"uuid","type":"string"},"state":{"enum":["pending","approved","rejected","changes-requested","answered","cancelled","superseded","expired"]}},"required":["state"],"type":"object"},"reviewable":{"type":"boolean"},"revision":{"minimum":1,"type":"integer"},"subject":{"additionalProperties":false,"properties":{"digest":{"type":"string"},"id":{"format":"uuid","type":"string"},"source":{"type":"string"},"subjectType":{"const":"proposal"},"version":{"type":"string"}},"required":["source","subjectType","id","version","digest"],"type":"object"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["id","actionId","actionRevision","submissionVersion","revision","effectDigest","subject","context","reviewable"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["proposal-reviewer"]}},"/v1/proposals/{proposal_id}/review-status":{"get":{"operationId":"proposals.get-review-status","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["casework-review-status","facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Request the institution's optional applicant-visible progress code. The code is returned only when the selected caller-owned grant enables readableReviewProgress.","in":"query","name":"include","required":false,"schema":{"const":"progress"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"authority":{"type":"string"},"context":{"additionalProperties":false,"properties":{"contract":{"additionalProperties":false,"properties":{"id":{"maxLength":2048,"pattern":"^urn:registry:breg:review-context:","type":"string"},"revision":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"schemaDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"}},"required":["id","revision","schemaDigest"],"type":"object"},"reference":{"type":"string"}},"required":["reference"],"type":"object"},"effectDigest":{"type":"string"},"handoff":{"additionalProperties":false,"properties":{"reason":{"enum":["remote-refused","producer-identity-mismatch","review-acceptance-changed","review-policy-changed","submission-recovery-expired","operator-closed","unspecified"]},"state":{"enum":["pending","accepted","failed","withdrawn"]}},"required":["state"],"type":"object"},"id":{"format":"uuid","type":"string"},"policy":{"additionalProperties":false,"properties":{"digest":{"type":"string"},"id":{"type":"string"},"version":{"type":"string"}},"required":["id","version","digest"],"type":"object"},"progressCode":{"description":"Institution-defined applicant-visible progress. Absent when the institution conceals the current stage, progress was not requested or granted, the provider is unavailable, or the accepted review round is no longer live.","maxLength":64,"pattern":"^[a-z][a-z0-9_-]{0,63}$","type":"string"},"requestId":{"format":"uuid","type":"string"},"result":{"additionalProperties":false,"properties":{"availableUntil":{"format":"date-time","type":"string"},"completedAt":{"format":"date-time","type":"string"},"resultId":{"format":"uuid","type":"string"},"state":{"enum":["pending","approved","rejected","changes-requested","answered","cancelled","superseded","expired"]}},"required":["state"],"type":"object"},"reviewable":{"type":"boolean"},"revision":{"minimum":1,"type":"integer"},"subject":{"additionalProperties":false,"properties":{"digest":{"type":"string"},"id":{"format":"uuid","type":"string"},"source":{"type":"string"},"subjectType":{"const":"proposal"},"version":{"type":"string"}},"required":["source","subjectType","id","version","digest"],"type":"object"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["id","actionId","actionRevision","submissionVersion","revision","effectDigest","subject","context","reviewable"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["casework-review-status","facility-correction-author"]}},"/v1/proposals/{proposal_id}/revise":{"post":{"operationId":"proposals.revise","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$id":"urn:breg:action:correct-address:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityId":{"format":"uuid","type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"correct-address","x-registry-requiredConditionKeys":[]},{"$id":"urn:breg:action:deactivate-facility:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"facilityId":{"format":"uuid","type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"deactivate-facility","x-registry-requiredConditionKeys":[]},{"additionalProperties":false,"type":"object"}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-applier","facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"submission_version","required":true,"schema":{"maximum":4294967295,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"application":{"anyOf":[{"additionalProperties":false,"dependentRequired":{"appliedAt":["appliedBy"],"appliedBy":["appliedAt"]},"properties":{"applicationId":{"format":"uuid","type":"string"},"appliedAt":{"description":"Application time, present with appliedBy only when the selected profile holds get-application-actor.","format":"date-time","type":"string"},"appliedBy":{"description":"Keyed actor pseudonym, present with appliedAt only when the selected profile holds get-application-actor.","pattern":"^hmac-sha256:[0-9a-f]{64}$","type":"string"},"state":{"const":"applied"}},"required":["state","applicationId"],"type":"object"},{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},{"type":"null"}]},"current":{"type":"boolean"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"review":{"anyOf":[{"additionalProperties":false,"properties":{"availableUntil":{"format":"date-time","type":"string"},"completedAt":{"format":"date-time","type":"string"},"resultId":{"format":"uuid","type":"string"},"state":{"enum":["pending","approved","rejected","changes-requested","answered","cancelled","superseded","expired"]}},"required":["state"],"type":"object"},{"type":"null"}]},"submissionVersion":{"maximum":4294967295,"minimum":1,"type":"integer"}},"required":["id","actionId","submissionVersion","current","effectDigest","review","application"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"410":{"description":"The submission's review result and application receipt are no longer retained"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["facility-correction-applier","facility-correction-author"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["facility-correction-author"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed, or a Record revision guard failed (`precondition.failed`); a failed field commit guard answers `action.guard_failed` when the selected profile can read it"}},"x-registry-accessProfiles":["facility-correction-author"]}},"/v1/records/directory-entries":{"get":{"operationId":"records.directory-entry.list","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Strict Registry read filter expression over compiled filterable API properties.","explode":false,"in":"query","name":"$filter","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"One compiled sortable property, ascending only.","explode":false,"in":"query","name":"$orderby","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Bounded page size.","explode":false,"in":"query","name":"$top","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Request count when the selected compiled query profile allows it.","explode":false,"in":"query","name":"$count","required":false,"schema":{"type":"boolean"}},{"description":"Opaque continuation cursor for the next page.","explode":false,"in":"query","name":"$skiptoken","required":false,"schema":{"maxLength":10978,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta","@context"],"type":"object"}}},"description":"Records returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"query.cursor_invalid":{"value":{"code":"query.cursor_invalid","detail":"The query cursor is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/cursor_invalid"}},"query.invalid":{"value":{"code":"query.invalid","detail":"The query request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/invalid"}},"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"directory-editor":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"directory-editor","selectableProperties":["email","jurisdiction","name"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"directory-entry","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"directory-entry","x-registry-responseShape":"RegistryRecordCollectionV1"},"post":{"operationId":"records.directory-entry.create","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to method, route, caller, target record, package revision, request body, and response field set.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/directory-entry-create-input"}},"required":["data"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/directory-entry"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/directory-entry"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record created","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Location":{"description":"Relative URL of the created record.","schema":{"type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"403":{"content":{"application/problem+json":{"examples":{"write.outside-boundary":{"value":{"code":"write.outside-boundary","detail":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"create","x-registry-recordType":"directory-entry","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"directory-entry","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/directory-entries/{record_id}":{"get":{"operationId":"records.directory-entry.get","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"get","x-registry-recordType":"directory-entry","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"directory-entry","x-registry-responseShape":"RegistryRecordSingleV1"},"patch":{"operationId":"records.directory-entry.patch","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to method, route, caller, target record, package revision, request body, and response field set.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}},{"description":"Strong Registry ETag for the currently visible record representation.","in":"header","name":"If-Match","required":true,"schema":{"maxLength":256,"minLength":6,"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"requestBody":{"content":{"application/json-patch+json":{"schema":{"items":{"additionalProperties":false,"else":{"required":["value"]},"if":{"properties":{"op":{"const":"remove"}}},"properties":{"op":{"enum":["add","replace","remove","test"],"type":"string"},"path":{"type":"string"},"value":true},"required":["op","path"],"then":{"not":{"required":["value"]}},"type":"object"},"maxItems":128,"minItems":1,"type":"array"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/directory-entry"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/directory-entry"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"directory-entry"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record patched","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"403":{"content":{"application/problem+json":{"examples":{"write.outside-boundary":{"value":{"code":"write.outside-boundary","detail":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"428":{"content":{"application/problem+json":{"examples":{"precondition.required":{"value":{"code":"precondition.required","detail":"The mutation precondition is required.","status":428,"title":"Precondition Required","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"patch","x-registry-recordType":"directory-entry","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"directory-entry","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/facilities":{"get":{"operationId":"records.facility.list","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Strict Registry read filter expression over compiled filterable API properties.","explode":false,"in":"query","name":"$filter","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"One compiled sortable property, ascending only.","explode":false,"in":"query","name":"$orderby","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Bounded page size.","explode":false,"in":"query","name":"$top","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Request count when the selected compiled query profile allows it.","explode":false,"in":"query","name":"$count","required":false,"schema":{"type":"boolean"}},{"description":"Opaque continuation cursor for the next page.","explode":false,"in":"query","name":"$skiptoken","required":false,"schema":{"maxLength":10978,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityCode":{"maxLength":64,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"facility-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityCode":{"maxLength":64,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"facility-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta","@context"],"type":"object"}}},"description":"Records returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"query.cursor_invalid":{"value":{"code":"query.cursor_invalid","detail":"The query cursor is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/cursor_invalid"}},"query.invalid":{"value":{"code":"query.invalid","detail":"The query request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/invalid"}},"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-reader"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"facility-reader":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"facility-reader","selectableProperties":["addressLine","city","facilityCode","jurisdiction","name","postalCode","status"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"facility","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"facility","x-registry-responseShape":"RegistryRecordCollectionV1"}},"/v1/records/facilities/{record_id}":{"get":{"operationId":"records.facility.get","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":true,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityCode":{"maxLength":64,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"facility-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"addressLine":{"maxLength":240,"minLength":1,"type":"string"},"city":{"maxLength":120,"minLength":1,"type":"string"},"facilityCode":{"maxLength":64,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"postalCode":{"maxLength":24,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"facility-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-reader","proposal-reviewer"],"x-registry-operation":"get","x-registry-recordType":"facility","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"facility","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/facilities/{record_id}/operators":{"get":{"operationId":"records.facility.path.operators","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Strict Registry read filter expression over compiled filterable API properties.","explode":false,"in":"query","name":"$filter","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"One compiled sortable property, ascending only.","explode":false,"in":"query","name":"$orderby","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Bounded page size.","explode":false,"in":"query","name":"$top","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Request count when the selected compiled query profile allows it.","explode":false,"in":"query","name":"$count","required":false,"schema":{"type":"boolean"}},{"description":"Opaque continuation cursor for the next page.","explode":false,"in":"query","name":"$skiptoken","required":false,"schema":{"maxLength":10978,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta","@context"],"type":"object"}}},"description":"Records returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"query.cursor_invalid":{"value":{"code":"query.cursor_invalid","detail":"The query cursor is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/cursor_invalid"}},"query.invalid":{"value":{"code":"query.invalid","detail":"The query request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/invalid"}},"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-reader"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"facility-reader":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"facility-reader","selectableProperties":["jurisdiction","operatorCode","status"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"facility","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"operator","x-registry-responseShape":"RegistryRecordCollectionV1"}},"/v1/records/facility-assignments":{"get":{"operationId":"records.facility-assignment.list","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Strict Registry read filter expression over compiled filterable API properties.","explode":false,"in":"query","name":"$filter","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"One compiled sortable property, ascending only.","explode":false,"in":"query","name":"$orderby","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Bounded page size.","explode":false,"in":"query","name":"$top","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Request count when the selected compiled query profile allows it.","explode":false,"in":"query","name":"$count","required":false,"schema":{"type":"boolean"}},{"description":"Opaque continuation cursor for the next page.","explode":false,"in":"query","name":"$skiptoken","required":false,"schema":{"maxLength":10978,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"facility":{"format":"uuid","type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operator":{"format":"uuid","type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility-assignment"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"facility":{"format":"uuid","type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operator":{"format":"uuid","type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility-assignment"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta","@context"],"type":"object"}}},"description":"Records returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"query.cursor_invalid":{"value":{"code":"query.cursor_invalid","detail":"The query cursor is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/cursor_invalid"}},"query.invalid":{"value":{"code":"query.invalid","detail":"The query request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/invalid"}},"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-reader"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"facility-reader":{"allowCount":false,"filterableProperties":[{"operators":["equals","in","is-null","is-not-null"],"property":"facility"},{"operators":["equals","in","is-null","is-not-null"],"property":"operator"}],"kind":"list","maximumPageSize":100,"profile":"facility-reader","selectableProperties":["facility","jurisdiction","operator"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"facility-assignment","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"facility-assignment","x-registry-responseShape":"RegistryRecordCollectionV1"}},"/v1/records/facility-assignments/{record_id}":{"get":{"operationId":"records.facility-assignment.get","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"facility":{"format":"uuid","type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operator":{"format":"uuid","type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility-assignment"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"facility":{"format":"uuid","type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operator":{"format":"uuid","type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"facility-assignment"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-reader"],"x-registry-operation":"get","x-registry-recordType":"facility-assignment","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"facility-assignment","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/operators":{"get":{"operationId":"records.operator.list","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":true,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Strict Registry read filter expression over compiled filterable API properties.","explode":false,"in":"query","name":"$filter","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"One compiled sortable property, ascending only.","explode":false,"in":"query","name":"$orderby","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Bounded page size.","explode":false,"in":"query","name":"$top","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Request count when the selected compiled query profile allows it.","explode":false,"in":"query","name":"$count","required":false,"schema":{"type":"boolean"}},{"description":"Opaque continuation cursor for the next page.","explode":false,"in":"query","name":"$skiptoken","required":false,"schema":{"maxLength":10978,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta","@context"],"type":"object"}}},"description":"Records returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"query.cursor_invalid":{"value":{"code":"query.cursor_invalid","detail":"The query cursor is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/cursor_invalid"}},"query.invalid":{"value":{"code":"query.invalid","detail":"The query request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/invalid"}},"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-reader","operator-editor"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"facility-reader":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"facility-reader","selectableProperties":["jurisdiction","operatorCode","status"],"selectorProperties":[],"sortableProperties":[],"temporal":null},"operator-editor":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"operator-editor","selectableProperties":["jurisdiction","operatorCode","status"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"operator","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"operator","x-registry-responseShape":"RegistryRecordCollectionV1"},"post":{"operationId":"records.operator.create","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to method, route, caller, target record, package revision, request body, and response field set.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/operator-create-input"}},"required":["data"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/operator"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/operator"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record created","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Location":{"description":"Relative URL of the created record.","schema":{"type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"403":{"content":{"application/problem+json":{"examples":{"write.outside-boundary":{"value":{"code":"write.outside-boundary","detail":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["operator-editor"],"x-registry-operation":"create","x-registry-recordType":"operator","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"operator","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/operators/{record_id}":{"get":{"operationId":"records.operator.get","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":true,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"operatorCode":{"maxLength":64,"minLength":1,"type":"string"},"status":{"enum":["active","inactive"],"type":"string","x-registry-vocabulary":"operator-status"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["facility-reader","operator-editor"],"x-registry-operation":"get","x-registry-recordType":"operator","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"operator","x-registry-responseShape":"RegistryRecordSingleV1"},"patch":{"operationId":"records.operator.patch","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to method, route, caller, target record, package revision, request body, and response field set.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}},{"description":"Strong Registry ETag for the currently visible record representation.","in":"header","name":"If-Match","required":true,"schema":{"maxLength":256,"minLength":6,"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"requestBody":{"content":{"application/json-patch+json":{"schema":{"items":{"additionalProperties":false,"else":{"required":["value"]},"if":{"properties":{"op":{"const":"remove"}}},"properties":{"op":{"enum":["add","replace","remove","test"],"type":"string"},"path":{"type":"string"},"value":true},"required":["op","path"],"then":{"not":{"required":["value"]}},"type":"object"},"maxItems":128,"minItems":1,"type":"array"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/operator"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/operator"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"facility-registry"},"recordTypeIdentifier":{"const":"operator"},"registryIdentifier":{"const":"facility-registry"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record patched","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"403":{"content":{"application/problem+json":{"examples":{"write.outside-boundary":{"value":{"code":"write.outside-boundary","detail":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"428":{"content":{"application/problem+json":{"examples":{"precondition.required":{"value":{"code":"precondition.required","detail":"The mutation precondition is required.","status":428,"title":"Precondition Required","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["operator-editor"],"x-registry-operation":"patch","x-registry-recordType":"operator","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"operator","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/review-completions":{"post":{"description":"Available when a review authority configures a completion token and recipient binding.","operationId":"receiveReviewCompletion","parameters":[{"in":"header","name":"Registry-Recipient-Binding","required":true,"schema":{"maxLength":256,"minLength":1,"type":"string"}},{"description":"Must equal eventId.","in":"header","name":"Idempotency-Key","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewCompletion"}}},"required":true},"responses":{"204":{"description":"Completion accepted or already recorded."},"400":{"description":"The completion or idempotency binding is invalid."},"401":{"description":"The completion authority could not be authenticated."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"bearerAuth":[]}],"summary":"Receive a Casework review completion"}}}} \ No newline at end of file diff --git a/products/breg/generated/minimal/generated/openapi.json b/products/breg/generated/minimal/generated/openapi.json index 5ff236c701..42b334b223 100644 --- a/products/breg/generated/minimal/generated/openapi.json +++ b/products/breg/generated/minimal/generated/openapi.json @@ -1 +1 @@ -{"components":{"schemas":{"ImmediateActionPrecondition":{"additionalProperties":false,"properties":{"ifMatch":{"maxLength":256,"minLength":3,"pattern":"^\\\"[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"required":["ifMatch"],"type":"object"},"ImmediateActionResultReference":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"format":"int64","minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"Problem":{"additionalProperties":false,"allOf":[{"if":{"properties":{"code":{"const":"write.outside-boundary"}}},"then":{"properties":{"code":{"const":"write.outside-boundary"},"detail":{"const":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition."},"status":{"const":403},"title":{"const":"Forbidden"},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId"]}}},{"if":{"properties":{"code":{"not":{"const":"action.guard_failed"}}}},"then":{"not":{"required":["guardReason"]}}},{"if":{"properties":{"code":{"const":"action.refused"}}},"then":{"properties":{"status":{"const":422}},"required":["refusalCode"]}},{"if":{"properties":{"code":{"const":"statistical_dataset.release_refused"}}},"then":{"properties":{"refusalCode":{"enum":["period-not-ended","before-first-period","provisional-after-final","already-withdrawn","negative-value"]},"status":{"const":422}},"required":["refusalCode"]}},{"if":{"properties":{"code":{"not":{"enum":["action.refused","statistical_dataset.release_refused"]}}}},"then":{"not":{"required":["refusalCode"]}}},{"if":{"properties":{"code":{"const":"statistical_dataset.version_withdrawn"}}},"then":{"properties":{"status":{"const":410}},"required":["reasonCode"]}},{"if":{"properties":{"code":{"not":{"const":"statistical_dataset.version_withdrawn"}}}},"then":{"not":{"required":["reasonCode"]}}},{"if":{"properties":{"code":{"const":"action.evidence_failed"}}},"then":{"properties":{"detail":{"const":"The declared Evidence dependency could not be accepted."},"fieldPath":{"pattern":"^/evidence/[a-z][a-z0-9_-]{0,63}$","type":"string"},"status":{"const":503}}}},{"if":{"properties":{"code":{"const":"action.handler_failed"}}},"then":{"properties":{"status":{"const":500}}}},{"if":{"anyOf":[{"required":["atField"]},{"required":["notAfterField"]}]},"then":{"properties":{"code":{"const":"request.invalid"},"status":{"const":400}},"required":["atField","notAfterField"]}},{"if":{"anyOf":[{"required":["recordType"]},{"required":["fieldId"]},{"required":["constraintId"]},{"required":["constraintKind"]},{"required":["left"]},{"required":["right"]},{"required":["field"]}]},"then":{"oneOf":[{"not":{"anyOf":[{"required":["constraintId"]},{"required":["constraintKind"]},{"required":["left"]},{"required":["right"]},{"required":["field"]}]},"required":["fieldId"]},{"not":{"required":["fieldId"]},"oneOf":[{"not":{"required":["field"]},"properties":{"constraintKind":{"const":"compare"}},"required":["left","right"]},{"not":{"anyOf":[{"required":["left"]},{"required":["right"]}]},"properties":{"constraintKind":{"enum":["int-range","vocabulary"]}},"required":["field"]}],"required":["constraintId","constraintKind"]}],"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409}},"required":["recordType"]}}],"properties":{"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["action.evidence_failed","action.guard_failed","action.handler_failed","action.refused","authentication.refused","idempotency.expired","idempotency.key-reused","ingestion.chunk_mismatch","ingestion.profile_mismatch","ingestion.receipt_erased","ingestion.run_blocked","ingestion.run_not_open","lookup.unresolved","mutation.conflict","precondition.failed","precondition.required","proposal.rejected","proposal.review_result_mismatch","proposal.submission_expired","query.cursor_invalid","query.filter_required","query.invalid","request.access_reason_required","request.invalid","request.timeout","resource.not_found","runtime.field_encryption.unavailable","service.unavailable","source.unavailable","statistical_dataset.domain_violation","statistical_dataset.release_refused","statistical_dataset.version_conflict","statistical_dataset.version_withdrawn","unsupported.media_type","write.outside-boundary"],"type":"string"},"constraintId":{"maxLength":128,"minLength":1,"type":"string"},"constraintKind":{"enum":["compare","int-range","vocabulary"],"type":"string"},"detail":{"maxLength":256,"type":"string"},"field":{"maxLength":128,"minLength":1,"type":"string"},"fieldId":{"maxLength":128,"minLength":1,"type":"string"},"fieldPath":{"maxLength":256,"type":"string"},"guardReason":{"pattern":"^[a-z][a-z0-9_-]{0,63}$","type":"string"},"left":{"maxLength":128,"minLength":1,"type":"string"},"notAfterField":{"maxLength":128,"minLength":1,"type":"string"},"reasonCode":{"enum":["computation-error","source-data-error","disclosure-risk"],"type":"string"},"recordType":{"maxLength":128,"minLength":1,"type":"string"},"refusalCode":{"maxLength":128,"minLength":1,"type":"string"},"requiredFilters":{"items":{"items":{"maxLength":64,"minLength":1,"type":"string"},"maxItems":32,"minItems":1,"type":"array","uniqueItems":true},"maxItems":8,"minItems":1,"type":"array"},"right":{"maxLength":128,"minLength":1,"type":"string"},"status":{"maximum":599,"minimum":400,"type":"integer"},"title":{"maxLength":128,"type":"string"},"traceId":{"maxLength":32,"minLength":32,"pattern":"^[0-9a-f]{32}$","type":"string"},"type":{"format":"uri","maxLength":256,"type":"string"}},"required":["type","title","status","detail","code","traceId"],"type":"object"},"ReviewCompletion":{"additionalProperties":false,"properties":{"completedAt":{"format":"date-time","type":"string"},"eventId":{"format":"uuid","type":"string"},"requestId":{"format":"uuid","type":"string"},"resultId":{"format":"uuid","type":"string"},"type":{"const":"review.completed"}},"required":["type","eventId","requestId","resultId","completedAt"],"type":"object"},"action-register-contact-invoke-input":{"$id":"urn:breg:action:register-contact:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"register-contact","x-registry-requiredConditionKeys":[]},"action-register-contact-invoke-response":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"},"action-update-contact-email-availability-input":{"$id":"urn:breg:action:update-contact-email:availability-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"oneOf":[{"properties":{"input":{"properties":{"contactId":{"format":"uuid","type":"string"}},"required":["contactId"]},"targetInput":{"const":"contactId"}}}],"properties":{"input":{"additionalProperties":false,"properties":{"contactId":{"format":"uuid","type":"string"},"email":{"maxLength":254,"minLength":1,"type":"string"}},"required":[],"type":"object"},"targetInput":{"enum":["contactId"],"type":"string"}},"required":["targetInput","input"],"type":"object","x-registry-action":"update-contact-email"},"action-update-contact-email-availability-response":{"$id":"urn:breg:action:update-contact-email:availability-response","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"availability":{"oneOf":[{"additionalProperties":false,"properties":{"available":{"const":true},"observedRevision":{"format":"int64","minimum":1,"type":"integer"}},"required":["available","observedRevision"],"type":"object"},{"additionalProperties":false,"properties":{"available":{"const":false},"guardReason":{"pattern":"^[a-z][a-z0-9_-]{0,63}$","type":"string"},"observedRevision":{"format":"int64","minimum":1,"type":"integer"},"reason":{"const":"guard-not-satisfied"},"recovery":{"const":"none"}},"required":["available","observedRevision","reason","recovery"],"type":"object"},{"additionalProperties":false,"properties":{"available":{"type":"null"},"missingInputs":{"items":{"enum":["contactId","email"],"type":"string"},"minItems":1,"type":"array","uniqueItems":true},"observedRevision":{"format":"int64","minimum":1,"type":"integer"},"reason":{"const":"input-required"},"recovery":{"const":"correct-input"}},"required":["available","observedRevision","reason","recovery","missingInputs"],"type":"object"},{"additionalProperties":false,"properties":{"available":{"type":"null"},"observedRevision":{"type":"null"},"reason":{"const":"not-disclosed"},"recovery":{"const":"none"}},"required":["available","observedRevision","reason","recovery"],"type":"object"}]}},"required":["availability"],"type":"object","x-registry-action":"update-contact-email"},"action-update-contact-email-invoke-input":{"$id":"urn:breg:action:update-contact-email:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"contactId":{"format":"uuid","type":"string"},"email":{"maxLength":254,"minLength":1,"type":"string"}},"required":["contactId","email"],"type":"object"},"preconditions":{"additionalProperties":false,"properties":{"contactId":{"additionalProperties":false,"properties":{"ifMatch":{"maxLength":256,"minLength":3,"pattern":"^\\\"[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"required":["ifMatch"],"type":"object"}},"required":["contactId"],"type":"object"}},"required":["input","preconditions"],"type":"object","x-registry-action":"update-contact-email","x-registry-requiredConditionKeys":["contactId"]},"action-update-contact-email-invoke-response":{"$id":"urn:breg:action:update-contact-email:invoke-response","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"action":{"const":"update-contact-email"},"applicationId":{"format":"uuid","type":"string"},"results":{"additionalProperties":false,"properties":{"contact-email":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"const":"contact"},"revision":{"format":"int64","minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"}},"required":["contact-email"],"type":"object"}},"required":["action","applicationId","results"],"type":"object"},"action-update-contact-email-target-conditions-input":{"$id":"urn:breg:action:update-contact-email:target-conditions-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"contactId":{"format":"uuid","type":"string"}},"required":["contactId"],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"update-contact-email","x-registry-requiredConditionKeys":["contactId"]},"action-update-contact-email-target-conditions-response":{"$id":"urn:breg:action:update-contact-email:target-conditions-response","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"preconditions":{"additionalProperties":false,"properties":{"contactId":{"additionalProperties":false,"properties":{"ifMatch":{"maxLength":256,"minLength":3,"pattern":"^\\\"[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"required":["ifMatch"],"type":"object"}},"required":["contactId"],"type":"object"}},"required":["preconditions"],"type":"object","x-registry-action":"update-contact-email"},"contact":{"$id":"urn:breg:record-type:contact","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"required":["name","email","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"},"contact-create-input":{"$id":"urn:breg:record-type:contact:input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"required":["name","email","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"}},"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}}},"info":{"title":"local-directory","version":"0.1.0"},"openapi":"3.1.0","paths":{"/v1/actions/register-contact/proposals":{"post":{"operationId":"actions.register-contact.start","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to the action route, selected profile, package revision, normalized action input, preconditions, and granted result contract.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-register-contact-invoke-input"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-register-contact-invoke-response"}}},"description":"Proposal created","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag for the created Proposal.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Location":{"description":"Relative URL of the created Proposal.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-action":{"access":{"accessProfiles":["directory-editor"]},"apiName":"registerContact","attachments":[],"bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"display":{"description":"Create one contact through a Proposal that applies on submit without external review.","label":"Register contact"},"execution":{"application":"automatic","mode":"proposal","review":"none"},"id":"register-contact","inputMode":"fixed","inputs":[{"apiName":"name","classification":"internal","fieldType":{"maximumLength":160,"minimumLength":1,"type":"string"},"id":"name","label":"name","nullable":false,"required":true,"schema":{"maxLength":160,"minLength":1,"type":"string"}},{"apiName":"email","classification":"internal","fieldType":{"maximumLength":254,"minimumLength":1,"type":"string"},"id":"email","label":"email","nullable":false,"required":true,"schema":{"maxLength":254,"minLength":1,"type":"string"}},{"apiName":"jurisdiction","classification":"internal","fieldType":{"maximumLength":40,"minimumLength":1,"type":"string"},"id":"jurisdiction","label":"jurisdiction","nullable":false,"required":true,"schema":{"maxLength":40,"minLength":1,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[],"requiredConditionKeys":[],"resultEffects":[{"effect":"contact","operation":"create","recordType":"contact"}],"revision":"sha256:2a81cd7c0637d4bfd3043ca4643134bde20a92d9e14ba15cd966a8e00d3e40da","route":"/v1/actions/register-contact/proposals","routes":{"availability":null,"start":{"inputSchema":"action-register-contact-invoke-input","method":"POST","operationId":"actions.register-contact.start","path":"/v1/actions/register-contact/proposals","requiresIdempotencyKey":true,"responseSchema":"action-register-contact-invoke-response"}}},"x-registry-defaultAccessProfile":"directory-editor","x-registry-operation":"start","x-registry-routeKind":"invoke"}},"/v1/actions/update-contact-email":{"post":{"operationId":"actions.update-contact-email.invoke","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to the action route, selected profile, package revision, normalized action input, preconditions, and granted result contract.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-update-contact-email-invoke-input"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-update-contact-email-invoke-response"}}},"description":"Immediate action committed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"action.guard_failed":{"value":{"code":"action.guard_failed","detail":"The action guard was not satisfied.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/action/guard_failed"}},"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"runtime.field_encryption.unavailable":{"value":{"code":"runtime.field_encryption.unavailable","detail":"The Registry field-encryption service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/runtime/field_encryption/unavailable"}},"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-action":{"access":{"accessProfiles":["directory-editor"]},"apiName":"updateContactEmail","bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"conditionRoute":"/v1/actions/update-contact-email/target-conditions","display":{"description":"Replace one contact's email address as soon as the Action is invoked.","label":"Update contact email"},"execution":{"mode":"immediate"},"id":"update-contact-email","inputMode":"fixed","inputs":[{"apiName":"contactId","classification":"internal","fieldType":{"onDelete":"restrict","target":"contact","type":"reference"},"id":"contact","label":"contactId","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"email","classification":"internal","fieldType":{"maximumLength":254,"minimumLength":1,"type":"string"},"id":"email","label":"email","nullable":false,"required":true,"schema":{"maxLength":254,"minLength":1,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"contactId","input":"contact","targetRecordType":"contact"}],"requiredConditionKeys":["contactId"],"resultEffects":[{"effect":"contact-email","operation":"patch","recordType":"contact"}],"revision":"sha256:ca1bd47281413d63288eb89a49143a8e56fcee9320d904db1219ee1ec89f1066","route":"/v1/actions/update-contact-email","routes":{"availability":{"inputSchema":"action-update-contact-email-availability-input","method":"POST","operationId":"actions.update-contact-email.availability","path":"/v1/actions/update-contact-email/availability","requiresIdempotencyKey":false,"responseSchema":"action-update-contact-email-availability-response"},"invoke":{"inputSchema":"action-update-contact-email-invoke-input","method":"POST","operationId":"actions.update-contact-email.invoke","path":"/v1/actions/update-contact-email","requiresIdempotencyKey":true,"responseSchema":"action-update-contact-email-invoke-response"},"targetConditions":{"inputSchema":"action-update-contact-email-target-conditions-input","method":"POST","operationId":"actions.update-contact-email.target-conditions","path":"/v1/actions/update-contact-email/target-conditions","requiresIdempotencyKey":false,"responseSchema":"action-update-contact-email-target-conditions-response"}}},"x-registry-defaultAccessProfile":"directory-editor","x-registry-operation":"invoke","x-registry-routeKind":"invoke"}},"/v1/actions/update-contact-email/availability":{"post":{"operationId":"actions.update-contact-email.availability","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-update-contact-email-availability-input"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-update-contact-email-availability-response"}}},"description":"Action availability returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"runtime.field_encryption.unavailable":{"value":{"code":"runtime.field_encryption.unavailable","detail":"The Registry field-encryption service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/runtime/field_encryption/unavailable"}},"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-action":{"access":{"accessProfiles":["directory-editor"]},"apiName":"updateContactEmail","bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"conditionRoute":"/v1/actions/update-contact-email/target-conditions","display":{"description":"Replace one contact's email address as soon as the Action is invoked.","label":"Update contact email"},"execution":{"mode":"immediate"},"id":"update-contact-email","inputMode":"fixed","inputs":[{"apiName":"contactId","classification":"internal","fieldType":{"onDelete":"restrict","target":"contact","type":"reference"},"id":"contact","label":"contactId","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"email","classification":"internal","fieldType":{"maximumLength":254,"minimumLength":1,"type":"string"},"id":"email","label":"email","nullable":false,"required":true,"schema":{"maxLength":254,"minLength":1,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"contactId","input":"contact","targetRecordType":"contact"}],"requiredConditionKeys":["contactId"],"resultEffects":[{"effect":"contact-email","operation":"patch","recordType":"contact"}],"revision":"sha256:ca1bd47281413d63288eb89a49143a8e56fcee9320d904db1219ee1ec89f1066","route":"/v1/actions/update-contact-email","routes":{"availability":{"inputSchema":"action-update-contact-email-availability-input","method":"POST","operationId":"actions.update-contact-email.availability","path":"/v1/actions/update-contact-email/availability","requiresIdempotencyKey":false,"responseSchema":"action-update-contact-email-availability-response"},"invoke":{"inputSchema":"action-update-contact-email-invoke-input","method":"POST","operationId":"actions.update-contact-email.invoke","path":"/v1/actions/update-contact-email","requiresIdempotencyKey":true,"responseSchema":"action-update-contact-email-invoke-response"},"targetConditions":{"inputSchema":"action-update-contact-email-target-conditions-input","method":"POST","operationId":"actions.update-contact-email.target-conditions","path":"/v1/actions/update-contact-email/target-conditions","requiresIdempotencyKey":false,"responseSchema":"action-update-contact-email-target-conditions-response"}}},"x-registry-defaultAccessProfile":"directory-editor","x-registry-operation":"invoke","x-registry-routeKind":"availability"}},"/v1/actions/update-contact-email/target-conditions":{"post":{"operationId":"actions.update-contact-email.target-conditions","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-update-contact-email-target-conditions-input"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-update-contact-email-target-conditions-response"}}},"description":"Action target conditions returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-action":{"access":{"accessProfiles":["directory-editor"]},"apiName":"updateContactEmail","bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"conditionRoute":"/v1/actions/update-contact-email/target-conditions","display":{"description":"Replace one contact's email address as soon as the Action is invoked.","label":"Update contact email"},"execution":{"mode":"immediate"},"id":"update-contact-email","inputMode":"fixed","inputs":[{"apiName":"contactId","classification":"internal","fieldType":{"onDelete":"restrict","target":"contact","type":"reference"},"id":"contact","label":"contactId","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"email","classification":"internal","fieldType":{"maximumLength":254,"minimumLength":1,"type":"string"},"id":"email","label":"email","nullable":false,"required":true,"schema":{"maxLength":254,"minLength":1,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"contactId","input":"contact","targetRecordType":"contact"}],"requiredConditionKeys":["contactId"],"resultEffects":[{"effect":"contact-email","operation":"patch","recordType":"contact"}],"revision":"sha256:ca1bd47281413d63288eb89a49143a8e56fcee9320d904db1219ee1ec89f1066","route":"/v1/actions/update-contact-email","routes":{"availability":{"inputSchema":"action-update-contact-email-availability-input","method":"POST","operationId":"actions.update-contact-email.availability","path":"/v1/actions/update-contact-email/availability","requiresIdempotencyKey":false,"responseSchema":"action-update-contact-email-availability-response"},"invoke":{"inputSchema":"action-update-contact-email-invoke-input","method":"POST","operationId":"actions.update-contact-email.invoke","path":"/v1/actions/update-contact-email","requiresIdempotencyKey":true,"responseSchema":"action-update-contact-email-invoke-response"},"targetConditions":{"inputSchema":"action-update-contact-email-target-conditions-input","method":"POST","operationId":"actions.update-contact-email.target-conditions","path":"/v1/actions/update-contact-email/target-conditions","requiresIdempotencyKey":false,"responseSchema":"action-update-contact-email-target-conditions-response"}}},"x-registry-defaultAccessProfile":"directory-editor","x-registry-operation":"invoke","x-registry-routeKind":"target-conditions"}},"/v1/proposals":{"get":{"operationId":"proposals.list","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["directory-editor"],"type":"string"}},{"in":"query","name":"action","schema":{"type":"string"}},{"in":"query","name":"owner","schema":{"const":"caller"}},{"in":"query","name":"target","schema":{"format":"uuid","type":"string"}},{"in":"query","name":"state","schema":{"enum":["draft","submitted","applied","cancelled","rejected"]}},{"in":"query","name":"turn","schema":{"enum":["party","official","nobody"]}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"description":"The most items a page holds. A page may hold fewer than `limit` items, so keep paging while `nextCursor` is present.","in":"query","name":"limit","schema":{"default":50,"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"pendingManualApplication","schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"items":{"items":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"},"maxItems":100,"type":"array"},"nextCursor":{"type":"string"}},"required":["items"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["directory-editor"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"dependentRequired":{"appliedAt":["appliedBy"],"appliedBy":["appliedAt"]},"properties":{"applicationId":{"format":"uuid","type":"string"},"appliedAt":{"description":"Application time, present with appliedBy only when the selected profile holds get-application-actor.","format":"date-time","type":"string"},"appliedBy":{"description":"Keyed actor pseudonym, present with appliedAt only when the selected profile holds get-application-actor.","pattern":"^hmac-sha256:[0-9a-f]{64}$","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["directory-editor"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["directory-editor"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$id":"urn:breg:action:register-contact:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"register-contact","x-registry-requiredConditionKeys":[]}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["directory-editor"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"submission_version","required":true,"schema":{"maximum":4294967295,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"application":{"anyOf":[{"additionalProperties":false,"dependentRequired":{"appliedAt":["appliedBy"],"appliedBy":["appliedAt"]},"properties":{"applicationId":{"format":"uuid","type":"string"},"appliedAt":{"description":"Application time, present with appliedBy only when the selected profile holds get-application-actor.","format":"date-time","type":"string"},"appliedBy":{"description":"Keyed actor pseudonym, present with appliedAt only when the selected profile holds get-application-actor.","pattern":"^hmac-sha256:[0-9a-f]{64}$","type":"string"},"state":{"const":"applied"}},"required":["state","applicationId"],"type":"object"},{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},{"type":"null"}]},"current":{"type":"boolean"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"review":{"anyOf":[{"additionalProperties":false,"properties":{"availableUntil":{"format":"date-time","type":"string"},"completedAt":{"format":"date-time","type":"string"},"resultId":{"format":"uuid","type":"string"},"state":{"enum":["pending","approved","rejected","changes-requested","answered","cancelled","superseded","expired"]}},"required":["state"],"type":"object"},{"type":"null"}]},"submissionVersion":{"maximum":4294967295,"minimum":1,"type":"integer"}},"required":["id","actionId","submissionVersion","current","effectDigest","review","application"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"410":{"description":"The submission's review result and application receipt are no longer retained"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["directory-editor"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed, or a Record revision guard failed (`precondition.failed`); a failed field commit guard answers `action.guard_failed` when the selected profile can read it"}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/records/contacts":{"get":{"operationId":"records.contact.list","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Strict Registry read filter expression over compiled filterable API properties.","explode":false,"in":"query","name":"$filter","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"One compiled sortable property, ascending only.","explode":false,"in":"query","name":"$orderby","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Bounded page size.","explode":false,"in":"query","name":"$top","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Request count when the selected compiled query profile allows it.","explode":false,"in":"query","name":"$count","required":false,"schema":{"type":"boolean"}},{"description":"Opaque continuation cursor for the next page.","explode":false,"in":"query","name":"$skiptoken","required":false,"schema":{"maxLength":10978,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta","@context"],"type":"object"}}},"description":"Records returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"query.cursor_invalid":{"value":{"code":"query.cursor_invalid","detail":"The query cursor is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/cursor_invalid"}},"query.invalid":{"value":{"code":"query.invalid","detail":"The query request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/invalid"}},"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"directory-editor":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"directory-editor","selectableProperties":["email","jurisdiction","name"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"contact","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"contact","x-registry-responseShape":"RegistryRecordCollectionV1"},"post":{"operationId":"records.contact.create","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to method, route, caller, target record, package revision, request body, and response field set.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/contact-create-input"}},"required":["data"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/contact"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/contact"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record created","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Location":{"description":"Relative URL of the created record.","schema":{"type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"403":{"content":{"application/problem+json":{"examples":{"write.outside-boundary":{"value":{"code":"write.outside-boundary","detail":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"create","x-registry-recordType":"contact","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"contact","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/contacts/{record_id}":{"get":{"operationId":"records.contact.get","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"get","x-registry-recordType":"contact","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"contact","x-registry-responseShape":"RegistryRecordSingleV1"},"patch":{"operationId":"records.contact.patch","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to method, route, caller, target record, package revision, request body, and response field set.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}},{"description":"Strong Registry ETag for the currently visible record representation.","in":"header","name":"If-Match","required":true,"schema":{"maxLength":256,"minLength":6,"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"requestBody":{"content":{"application/json-patch+json":{"schema":{"items":{"additionalProperties":false,"else":{"required":["value"]},"if":{"properties":{"op":{"const":"remove"}}},"properties":{"op":{"enum":["add","replace","remove","test"],"type":"string"},"path":{"type":"string"},"value":true},"required":["op","path"],"then":{"not":{"required":["value"]}},"type":"object"},"maxItems":128,"minItems":1,"type":"array"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/contact"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/contact"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record patched","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"403":{"content":{"application/problem+json":{"examples":{"write.outside-boundary":{"value":{"code":"write.outside-boundary","detail":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"428":{"content":{"application/problem+json":{"examples":{"precondition.required":{"value":{"code":"precondition.required","detail":"The mutation precondition is required.","status":428,"title":"Precondition Required","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"patch","x-registry-recordType":"contact","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"contact","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/review-completions":{"post":{"description":"Available when a review authority configures a completion token and recipient binding.","operationId":"receiveReviewCompletion","parameters":[{"in":"header","name":"Registry-Recipient-Binding","required":true,"schema":{"maxLength":256,"minLength":1,"type":"string"}},{"description":"Must equal eventId.","in":"header","name":"Idempotency-Key","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewCompletion"}}},"required":true},"responses":{"204":{"description":"Completion accepted or already recorded."},"400":{"description":"The completion or idempotency binding is invalid."},"401":{"description":"The completion authority could not be authenticated."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"bearerAuth":[]}],"summary":"Receive a Casework review completion"}}}} \ No newline at end of file +{"components":{"schemas":{"ImmediateActionPrecondition":{"additionalProperties":false,"properties":{"ifMatch":{"maxLength":256,"minLength":3,"pattern":"^\\\"[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"required":["ifMatch"],"type":"object"},"ImmediateActionResultReference":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"format":"int64","minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"Problem":{"additionalProperties":false,"allOf":[{"if":{"properties":{"code":{"const":"write.outside-boundary"}}},"then":{"properties":{"code":{"const":"write.outside-boundary"},"detail":{"const":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition."},"status":{"const":403},"title":{"const":"Forbidden"},"type":{"const":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}},"propertyNames":{"enum":["type","title","status","detail","code","traceId"]}}},{"if":{"properties":{"code":{"not":{"const":"action.guard_failed"}}}},"then":{"not":{"required":["guardReason"]}}},{"if":{"properties":{"code":{"const":"action.refused"}}},"then":{"properties":{"status":{"const":422}},"required":["refusalCode"]}},{"if":{"properties":{"code":{"const":"statistical_dataset.release_refused"}}},"then":{"properties":{"refusalCode":{"enum":["period-not-ended","before-first-period","provisional-after-final","already-withdrawn","negative-value"]},"status":{"const":422}},"required":["refusalCode"]}},{"if":{"properties":{"code":{"not":{"enum":["action.refused","statistical_dataset.release_refused"]}}}},"then":{"not":{"required":["refusalCode"]}}},{"if":{"properties":{"code":{"const":"statistical_dataset.version_withdrawn"}}},"then":{"properties":{"status":{"const":410}},"required":["reasonCode"]}},{"if":{"properties":{"code":{"not":{"const":"statistical_dataset.version_withdrawn"}}}},"then":{"not":{"required":["reasonCode"]}}},{"if":{"properties":{"code":{"const":"action.evidence_failed"}}},"then":{"properties":{"detail":{"const":"The declared Evidence dependency could not be accepted."},"fieldPath":{"pattern":"^/evidence/[a-z][a-z0-9_-]{0,63}$","type":"string"},"status":{"const":503}}}},{"if":{"properties":{"code":{"const":"action.handler_failed"}}},"then":{"properties":{"status":{"const":500}}}},{"if":{"anyOf":[{"required":["atField"]},{"required":["notAfterField"]}]},"then":{"properties":{"code":{"const":"request.invalid"},"status":{"const":400}},"required":["atField","notAfterField"]}},{"if":{"anyOf":[{"required":["recordType"]},{"required":["fieldId"]},{"required":["constraintId"]},{"required":["constraintKind"]},{"required":["left"]},{"required":["right"]},{"required":["field"]}]},"then":{"oneOf":[{"not":{"anyOf":[{"required":["constraintId"]},{"required":["constraintKind"]},{"required":["left"]},{"required":["right"]},{"required":["field"]}]},"required":["fieldId"]},{"not":{"required":["fieldId"]},"oneOf":[{"not":{"required":["field"]},"properties":{"constraintKind":{"const":"compare"}},"required":["left","right"]},{"not":{"anyOf":[{"required":["left"]},{"required":["right"]}]},"properties":{"constraintKind":{"enum":["int-range","vocabulary"]}},"required":["field"]}],"required":["constraintId","constraintKind"]}],"properties":{"code":{"const":"mutation.conflict"},"status":{"const":409}},"required":["recordType"]}}],"properties":{"atField":{"maxLength":128,"minLength":1,"type":"string"},"code":{"enum":["action.evidence_failed","action.guard_failed","action.handler_failed","action.refused","attachment.content-type","attachment.digest-mismatch","attachment.slot-write-once","attachment.too-large","authentication.refused","idempotency.expired","idempotency.key-reused","ingestion.chunk_mismatch","ingestion.profile_mismatch","ingestion.receipt_erased","ingestion.run_blocked","ingestion.run_not_open","lookup.unresolved","mutation.conflict","precondition.failed","precondition.required","proposal.rejected","proposal.review_result_mismatch","proposal.submission_expired","query.cursor_invalid","query.filter_required","query.invalid","request.access_reason_required","request.invalid","request.timeout","resource.not_found","runtime.field_encryption.unavailable","service.unavailable","source.unavailable","statistical_dataset.domain_violation","statistical_dataset.release_refused","statistical_dataset.version_conflict","statistical_dataset.version_withdrawn","unsupported.media_type","write.outside-boundary"],"type":"string"},"constraintId":{"maxLength":128,"minLength":1,"type":"string"},"constraintKind":{"enum":["compare","int-range","vocabulary"],"type":"string"},"detail":{"maxLength":256,"type":"string"},"field":{"maxLength":128,"minLength":1,"type":"string"},"fieldId":{"maxLength":128,"minLength":1,"type":"string"},"fieldPath":{"maxLength":256,"type":"string"},"guardReason":{"pattern":"^[a-z][a-z0-9_-]{0,63}$","type":"string"},"left":{"maxLength":128,"minLength":1,"type":"string"},"notAfterField":{"maxLength":128,"minLength":1,"type":"string"},"reasonCode":{"enum":["computation-error","source-data-error","disclosure-risk"],"type":"string"},"recordType":{"maxLength":128,"minLength":1,"type":"string"},"refusalCode":{"maxLength":128,"minLength":1,"type":"string"},"requiredFilters":{"items":{"items":{"maxLength":64,"minLength":1,"type":"string"},"maxItems":32,"minItems":1,"type":"array","uniqueItems":true},"maxItems":8,"minItems":1,"type":"array"},"right":{"maxLength":128,"minLength":1,"type":"string"},"status":{"maximum":599,"minimum":400,"type":"integer"},"title":{"maxLength":128,"type":"string"},"traceId":{"maxLength":32,"minLength":32,"pattern":"^[0-9a-f]{32}$","type":"string"},"type":{"format":"uri","maxLength":256,"type":"string"}},"required":["type","title","status","detail","code","traceId"],"type":"object"},"ReviewCompletion":{"additionalProperties":false,"properties":{"completedAt":{"format":"date-time","type":"string"},"eventId":{"format":"uuid","type":"string"},"requestId":{"format":"uuid","type":"string"},"resultId":{"format":"uuid","type":"string"},"type":{"const":"review.completed"}},"required":["type","eventId","requestId","resultId","completedAt"],"type":"object"},"action-register-contact-invoke-input":{"$id":"urn:breg:action:register-contact:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"register-contact","x-registry-requiredConditionKeys":[]},"action-register-contact-invoke-response":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"},"action-update-contact-email-availability-input":{"$id":"urn:breg:action:update-contact-email:availability-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"oneOf":[{"properties":{"input":{"properties":{"contactId":{"format":"uuid","type":"string"}},"required":["contactId"]},"targetInput":{"const":"contactId"}}}],"properties":{"input":{"additionalProperties":false,"properties":{"contactId":{"format":"uuid","type":"string"},"email":{"maxLength":254,"minLength":1,"type":"string"}},"required":[],"type":"object"},"targetInput":{"enum":["contactId"],"type":"string"}},"required":["targetInput","input"],"type":"object","x-registry-action":"update-contact-email"},"action-update-contact-email-availability-response":{"$id":"urn:breg:action:update-contact-email:availability-response","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"availability":{"oneOf":[{"additionalProperties":false,"properties":{"available":{"const":true},"observedRevision":{"format":"int64","minimum":1,"type":"integer"}},"required":["available","observedRevision"],"type":"object"},{"additionalProperties":false,"properties":{"available":{"const":false},"guardReason":{"pattern":"^[a-z][a-z0-9_-]{0,63}$","type":"string"},"observedRevision":{"format":"int64","minimum":1,"type":"integer"},"reason":{"const":"guard-not-satisfied"},"recovery":{"const":"none"}},"required":["available","observedRevision","reason","recovery"],"type":"object"},{"additionalProperties":false,"properties":{"available":{"type":"null"},"missingInputs":{"items":{"enum":["contactId","email"],"type":"string"},"minItems":1,"type":"array","uniqueItems":true},"observedRevision":{"format":"int64","minimum":1,"type":"integer"},"reason":{"const":"input-required"},"recovery":{"const":"correct-input"}},"required":["available","observedRevision","reason","recovery","missingInputs"],"type":"object"},{"additionalProperties":false,"properties":{"available":{"type":"null"},"observedRevision":{"type":"null"},"reason":{"const":"not-disclosed"},"recovery":{"const":"none"}},"required":["available","observedRevision","reason","recovery"],"type":"object"}]}},"required":["availability"],"type":"object","x-registry-action":"update-contact-email"},"action-update-contact-email-invoke-input":{"$id":"urn:breg:action:update-contact-email:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"contactId":{"format":"uuid","type":"string"},"email":{"maxLength":254,"minLength":1,"type":"string"}},"required":["contactId","email"],"type":"object"},"preconditions":{"additionalProperties":false,"properties":{"contactId":{"additionalProperties":false,"properties":{"ifMatch":{"maxLength":256,"minLength":3,"pattern":"^\\\"[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"required":["ifMatch"],"type":"object"}},"required":["contactId"],"type":"object"}},"required":["input","preconditions"],"type":"object","x-registry-action":"update-contact-email","x-registry-requiredConditionKeys":["contactId"]},"action-update-contact-email-invoke-response":{"$id":"urn:breg:action:update-contact-email:invoke-response","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"action":{"const":"update-contact-email"},"applicationId":{"format":"uuid","type":"string"},"results":{"additionalProperties":false,"properties":{"contact-email":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"const":"contact"},"revision":{"format":"int64","minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"}},"required":["contact-email"],"type":"object"}},"required":["action","applicationId","results"],"type":"object"},"action-update-contact-email-target-conditions-input":{"$id":"urn:breg:action:update-contact-email:target-conditions-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"contactId":{"format":"uuid","type":"string"}},"required":["contactId"],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"update-contact-email","x-registry-requiredConditionKeys":["contactId"]},"action-update-contact-email-target-conditions-response":{"$id":"urn:breg:action:update-contact-email:target-conditions-response","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"preconditions":{"additionalProperties":false,"properties":{"contactId":{"additionalProperties":false,"properties":{"ifMatch":{"maxLength":256,"minLength":3,"pattern":"^\\\"[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"required":["ifMatch"],"type":"object"}},"required":["contactId"],"type":"object"}},"required":["preconditions"],"type":"object","x-registry-action":"update-contact-email"},"contact":{"$id":"urn:breg:record-type:contact","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"required":["name","email","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"},"contact-create-input":{"$id":"urn:breg:record-type:contact:input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"required":["name","email","jurisdiction"],"type":"object","x-registry-mutationMode":"mutable"}},"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}}},"info":{"title":"local-directory","version":"0.1.0"},"openapi":"3.1.0","paths":{"/v1/actions/register-contact/proposals":{"post":{"operationId":"actions.register-contact.start","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to the action route, selected profile, package revision, normalized action input, preconditions, and granted result contract.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-register-contact-invoke-input"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-register-contact-invoke-response"}}},"description":"Proposal created","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag for the created Proposal.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Location":{"description":"Relative URL of the created Proposal.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-action":{"access":{"accessProfiles":["directory-editor"]},"apiName":"registerContact","attachments":[],"bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"display":{"description":"Create one contact through a Proposal that applies on submit without external review.","label":"Register contact"},"execution":{"application":"automatic","mode":"proposal","review":"none"},"id":"register-contact","inputMode":"fixed","inputs":[{"apiName":"name","classification":"internal","fieldType":{"maximumLength":160,"minimumLength":1,"type":"string"},"id":"name","label":"name","nullable":false,"required":true,"schema":{"maxLength":160,"minLength":1,"type":"string"}},{"apiName":"email","classification":"internal","fieldType":{"maximumLength":254,"minimumLength":1,"type":"string"},"id":"email","label":"email","nullable":false,"required":true,"schema":{"maxLength":254,"minLength":1,"type":"string"}},{"apiName":"jurisdiction","classification":"internal","fieldType":{"maximumLength":40,"minimumLength":1,"type":"string"},"id":"jurisdiction","label":"jurisdiction","nullable":false,"required":true,"schema":{"maxLength":40,"minLength":1,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[],"requiredConditionKeys":[],"resultEffects":[{"effect":"contact","operation":"create","recordType":"contact"}],"revision":"sha256:2a81cd7c0637d4bfd3043ca4643134bde20a92d9e14ba15cd966a8e00d3e40da","route":"/v1/actions/register-contact/proposals","routes":{"availability":null,"start":{"inputSchema":"action-register-contact-invoke-input","method":"POST","operationId":"actions.register-contact.start","path":"/v1/actions/register-contact/proposals","requiresIdempotencyKey":true,"responseSchema":"action-register-contact-invoke-response"}}},"x-registry-defaultAccessProfile":"directory-editor","x-registry-operation":"start","x-registry-routeKind":"invoke"}},"/v1/actions/update-contact-email":{"post":{"operationId":"actions.update-contact-email.invoke","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to the action route, selected profile, package revision, normalized action input, preconditions, and granted result contract.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-update-contact-email-invoke-input"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-update-contact-email-invoke-response"}}},"description":"Immediate action committed","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"action.guard_failed":{"value":{"code":"action.guard_failed","detail":"The action guard was not satisfied.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/action/guard_failed"}},"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"runtime.field_encryption.unavailable":{"value":{"code":"runtime.field_encryption.unavailable","detail":"The Registry field-encryption service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/runtime/field_encryption/unavailable"}},"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-action":{"access":{"accessProfiles":["directory-editor"]},"apiName":"updateContactEmail","bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"conditionRoute":"/v1/actions/update-contact-email/target-conditions","display":{"description":"Replace one contact's email address as soon as the Action is invoked.","label":"Update contact email"},"execution":{"mode":"immediate"},"id":"update-contact-email","inputMode":"fixed","inputs":[{"apiName":"contactId","classification":"internal","fieldType":{"onDelete":"restrict","target":"contact","type":"reference"},"id":"contact","label":"contactId","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"email","classification":"internal","fieldType":{"maximumLength":254,"minimumLength":1,"type":"string"},"id":"email","label":"email","nullable":false,"required":true,"schema":{"maxLength":254,"minLength":1,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"contactId","input":"contact","targetRecordType":"contact"}],"requiredConditionKeys":["contactId"],"resultEffects":[{"effect":"contact-email","operation":"patch","recordType":"contact"}],"revision":"sha256:ca1bd47281413d63288eb89a49143a8e56fcee9320d904db1219ee1ec89f1066","route":"/v1/actions/update-contact-email","routes":{"availability":{"inputSchema":"action-update-contact-email-availability-input","method":"POST","operationId":"actions.update-contact-email.availability","path":"/v1/actions/update-contact-email/availability","requiresIdempotencyKey":false,"responseSchema":"action-update-contact-email-availability-response"},"invoke":{"inputSchema":"action-update-contact-email-invoke-input","method":"POST","operationId":"actions.update-contact-email.invoke","path":"/v1/actions/update-contact-email","requiresIdempotencyKey":true,"responseSchema":"action-update-contact-email-invoke-response"},"targetConditions":{"inputSchema":"action-update-contact-email-target-conditions-input","method":"POST","operationId":"actions.update-contact-email.target-conditions","path":"/v1/actions/update-contact-email/target-conditions","requiresIdempotencyKey":false,"responseSchema":"action-update-contact-email-target-conditions-response"}}},"x-registry-defaultAccessProfile":"directory-editor","x-registry-operation":"invoke","x-registry-routeKind":"invoke"}},"/v1/actions/update-contact-email/availability":{"post":{"operationId":"actions.update-contact-email.availability","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-update-contact-email-availability-input"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-update-contact-email-availability-response"}}},"description":"Action availability returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"runtime.field_encryption.unavailable":{"value":{"code":"runtime.field_encryption.unavailable","detail":"The Registry field-encryption service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/runtime/field_encryption/unavailable"}},"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-action":{"access":{"accessProfiles":["directory-editor"]},"apiName":"updateContactEmail","bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"conditionRoute":"/v1/actions/update-contact-email/target-conditions","display":{"description":"Replace one contact's email address as soon as the Action is invoked.","label":"Update contact email"},"execution":{"mode":"immediate"},"id":"update-contact-email","inputMode":"fixed","inputs":[{"apiName":"contactId","classification":"internal","fieldType":{"onDelete":"restrict","target":"contact","type":"reference"},"id":"contact","label":"contactId","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"email","classification":"internal","fieldType":{"maximumLength":254,"minimumLength":1,"type":"string"},"id":"email","label":"email","nullable":false,"required":true,"schema":{"maxLength":254,"minLength":1,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"contactId","input":"contact","targetRecordType":"contact"}],"requiredConditionKeys":["contactId"],"resultEffects":[{"effect":"contact-email","operation":"patch","recordType":"contact"}],"revision":"sha256:ca1bd47281413d63288eb89a49143a8e56fcee9320d904db1219ee1ec89f1066","route":"/v1/actions/update-contact-email","routes":{"availability":{"inputSchema":"action-update-contact-email-availability-input","method":"POST","operationId":"actions.update-contact-email.availability","path":"/v1/actions/update-contact-email/availability","requiresIdempotencyKey":false,"responseSchema":"action-update-contact-email-availability-response"},"invoke":{"inputSchema":"action-update-contact-email-invoke-input","method":"POST","operationId":"actions.update-contact-email.invoke","path":"/v1/actions/update-contact-email","requiresIdempotencyKey":true,"responseSchema":"action-update-contact-email-invoke-response"},"targetConditions":{"inputSchema":"action-update-contact-email-target-conditions-input","method":"POST","operationId":"actions.update-contact-email.target-conditions","path":"/v1/actions/update-contact-email/target-conditions","requiresIdempotencyKey":false,"responseSchema":"action-update-contact-email-target-conditions-response"}}},"x-registry-defaultAccessProfile":"directory-editor","x-registry-operation":"invoke","x-registry-routeKind":"availability"}},"/v1/actions/update-contact-email/target-conditions":{"post":{"operationId":"actions.update-contact-email.target-conditions","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-update-contact-email-target-conditions-input"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/action-update-contact-email-target-conditions-response"}}},"description":"Action target conditions returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-action":{"access":{"accessProfiles":["directory-editor"]},"apiName":"updateContactEmail","bounds":{"maximumFieldMutations":128,"maximumSnapshotBytes":2097152,"maximumTargets":16},"conditionRoute":"/v1/actions/update-contact-email/target-conditions","display":{"description":"Replace one contact's email address as soon as the Action is invoked.","label":"Update contact email"},"execution":{"mode":"immediate"},"id":"update-contact-email","inputMode":"fixed","inputs":[{"apiName":"contactId","classification":"internal","fieldType":{"onDelete":"restrict","target":"contact","type":"reference"},"id":"contact","label":"contactId","nullable":false,"required":true,"schema":{"format":"uuid","type":"string"}},{"apiName":"email","classification":"internal","fieldType":{"maximumLength":254,"minimumLength":1,"type":"string"},"id":"email","label":"email","nullable":false,"required":true,"schema":{"maxLength":254,"minLength":1,"type":"string"}}],"maximumInputStringBytes":null,"referenceInputs":[{"apiName":"contactId","input":"contact","targetRecordType":"contact"}],"requiredConditionKeys":["contactId"],"resultEffects":[{"effect":"contact-email","operation":"patch","recordType":"contact"}],"revision":"sha256:ca1bd47281413d63288eb89a49143a8e56fcee9320d904db1219ee1ec89f1066","route":"/v1/actions/update-contact-email","routes":{"availability":{"inputSchema":"action-update-contact-email-availability-input","method":"POST","operationId":"actions.update-contact-email.availability","path":"/v1/actions/update-contact-email/availability","requiresIdempotencyKey":false,"responseSchema":"action-update-contact-email-availability-response"},"invoke":{"inputSchema":"action-update-contact-email-invoke-input","method":"POST","operationId":"actions.update-contact-email.invoke","path":"/v1/actions/update-contact-email","requiresIdempotencyKey":true,"responseSchema":"action-update-contact-email-invoke-response"},"targetConditions":{"inputSchema":"action-update-contact-email-target-conditions-input","method":"POST","operationId":"actions.update-contact-email.target-conditions","path":"/v1/actions/update-contact-email/target-conditions","requiresIdempotencyKey":false,"responseSchema":"action-update-contact-email-target-conditions-response"}}},"x-registry-defaultAccessProfile":"directory-editor","x-registry-operation":"invoke","x-registry-routeKind":"target-conditions"}},"/v1/proposals":{"get":{"operationId":"proposals.list","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["directory-editor"],"type":"string"}},{"in":"query","name":"action","schema":{"type":"string"}},{"in":"query","name":"owner","schema":{"const":"caller"}},{"in":"query","name":"target","schema":{"format":"uuid","type":"string"}},{"in":"query","name":"state","schema":{"enum":["draft","submitted","applied","cancelled","rejected"]}},{"in":"query","name":"turn","schema":{"enum":["party","official","nobody"]}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"description":"The most items a page holds. A page may hold fewer than `limit` items, so keep paging while `nextCursor` is present.","in":"query","name":"limit","schema":{"default":50,"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"pendingManualApplication","schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"items":{"items":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"},"maxItems":100,"type":"array"},"nextCursor":{"type":"string"}},"required":["items"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}":{"get":{"operationId":"proposals.get","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["directory-editor"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"dependentRequired":{"appliedAt":["appliedBy"],"appliedBy":["appliedAt"]},"properties":{"applicationId":{"format":"uuid","type":"string"},"appliedAt":{"description":"Application time, present with appliedBy only when the selected profile holds get-application-actor.","format":"date-time","type":"string"},"appliedBy":{"description":"Keyed actor pseudonym, present with appliedAt only when the selected profile holds get-application-actor.","pattern":"^hmac-sha256:[0-9a-f]{64}$","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/cancel":{"post":{"operationId":"proposals.cancel","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["directory-editor"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/edit":{"post":{"operationId":"proposals.edit","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["directory-editor"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$id":"urn:breg:action:register-contact:invoke-input","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"input":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object","x-registry-action":"register-contact","x-registry-requiredConditionKeys":[]}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/submissions/{submission_version}":{"get":{"operationId":"proposals.get-submission","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["directory-editor"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"submission_version","required":true,"schema":{"maximum":4294967295,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"application":{"anyOf":[{"additionalProperties":false,"dependentRequired":{"appliedAt":["appliedBy"],"appliedBy":["appliedAt"]},"properties":{"applicationId":{"format":"uuid","type":"string"},"appliedAt":{"description":"Application time, present with appliedBy only when the selected profile holds get-application-actor.","format":"date-time","type":"string"},"appliedBy":{"description":"Keyed actor pseudonym, present with appliedAt only when the selected profile holds get-application-actor.","pattern":"^hmac-sha256:[0-9a-f]{64}$","type":"string"},"state":{"const":"applied"}},"required":["state","applicationId"],"type":"object"},{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},{"type":"null"}]},"current":{"type":"boolean"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"review":{"anyOf":[{"additionalProperties":false,"properties":{"availableUntil":{"format":"date-time","type":"string"},"completedAt":{"format":"date-time","type":"string"},"resultId":{"format":"uuid","type":"string"},"state":{"enum":["pending","approved","rejected","changes-requested","answered","cancelled","superseded","expired"]}},"required":["state"],"type":"object"},{"type":"null"}]},"submissionVersion":{"maximum":4294967295,"minimum":1,"type":"integer"}},"required":["id","actionId","submissionVersion","current","effectDigest","review","application"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"410":{"description":"The submission's review result and application receipt are no longer retained"},"412":{"description":"Observed authority or lifecycle condition changed"}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/proposals/{proposal_id}/submit":{"post":{"operationId":"proposals.submit","parameters":[{"in":"query","name":"accessProfile","required":true,"schema":{"enum":["directory-editor"],"type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"If-Match","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"actionId":{"type":"string"},"actionRevision":{"type":"string"},"application":{"additionalProperties":false,"properties":{"applicationId":{"format":"uuid","type":"string"},"effectDigest":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"resultLinks":{"items":{"additionalProperties":false,"properties":{"recordId":{"format":"uuid","type":"string"},"recordType":{"type":"string"},"revision":{"minimum":1,"type":"integer"}},"required":["recordType","recordId","revision"],"type":"object"},"maxItems":16,"type":"array"},"submissionVersion":{"minimum":1,"type":"integer"}},"required":["applicationId","submissionVersion","effectDigest","resultLinks"],"type":"object"},"applicationStatus":{"additionalProperties":false,"properties":{"automaticRetry":{"additionalProperties":false,"properties":{"attempts":{"maximum":1000,"minimum":0,"type":"integer"},"maximumAttempts":{"maximum":1000,"minimum":1,"type":"integer"},"scheduled":{"type":"boolean"}},"required":["scheduled","attempts","maximumAttempts"],"type":"object"},"mode":{"enum":["automatic","manual"]},"reason":{"enum":["package-changed","dependency-outage","lease-expired","application-refused","attempts-exhausted"]},"recovery":{"enum":["retry","rebase","correct-input"]},"state":{"enum":["awaiting-review","pending","applying","blocked","applied","cancelled","rejected"]}},"required":["state","mode"],"type":"object"},"attachments":{"additionalProperties":{"additionalProperties":false,"properties":{"classification":{"enum":["public","internal","restricted"]},"contentTypes":{"items":{"type":"string"},"maxItems":16,"minItems":1,"type":"array","uniqueItems":true},"id":{"type":"string"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","PATCH","DELETE"]},"operation":{"enum":["download","upload","remove"]},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"maximumBytes":{"maximum":16777216,"minimum":1,"type":"integer"},"required":{"type":"boolean"},"value":{"additionalProperties":false,"properties":{"byteSize":{"minimum":1,"type":"integer"},"contentType":{"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"submissionVersion":{"minimum":0,"type":"integer"},"uploadedAt":{"type":"string"},"verificationStatus":{"enum":["notRequired","pending","approved","rejected"]}},"required":["submissionVersion","sha256","contentType","byteSize","verificationStatus"],"type":"object"}},"required":["id","required","maximumBytes","contentTypes","classification","links"],"type":"object"},"maxProperties":8,"type":"object"},"blockedReason":{"enum":["package-changed"]},"createdAt":{"format":"date-time","type":"string"},"decision":{"additionalProperties":false,"properties":{"decidedAt":{"format":"date-time","type":"string"},"publicReason":{"minLength":1,"pattern":"^[^\\u0000-\\u001F\\u007F-\\u009F]*[^\\u0000-\\u0020\\u007F-\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000][^\\u0000-\\u001F\\u007F-\\u009F]*$","type":"string","x-maximum-utf8-bytes":2000},"status":{"enum":["approved","rejected","changes-requested","answered"]}},"required":["status","decidedAt"],"type":"object"},"effectDigest":{"type":"string"},"handoffRefusal":{"additionalProperties":false,"properties":{"code":{"enum":["review.initiator-required","review.initiator-excluded","review.policy-mismatch","review.refused"]}},"required":["code"],"type":"object"},"id":{"format":"uuid","type":"string"},"input":{"type":"object"},"links":{"additionalProperties":{"additionalProperties":false,"properties":{"accessProfile":{"type":"string"},"availability":{"additionalProperties":false,"if":{"properties":{"available":{"const":false}}},"properties":{"available":{"type":"boolean"},"observedRevision":{"minimum":1,"type":"integer"},"reason":{"enum":["pending-review","review-rejected","review-changes-requested","review-ended","stale-revision","package-changed","dependency-outage","invalid-input","already-applied"]},"recovery":{"enum":["refresh","revise","retry","rebase","correct-input","receipt-only"]}},"required":["available","observedRevision"],"then":{"required":["reason","recovery"]},"type":"object"},"ifMatch":{"type":"string"},"method":{"enum":["GET","POST"]},"operation":{"type":"string"},"path":{"type":"string"}},"required":["method","path","accessProfile","operation"],"type":"object"},"type":"object"},"revision":{"minimum":1,"type":"integer"},"state":{"enum":["draft","submitted","applied","cancelled","rejected"]},"submissionVersion":{"minimum":0,"type":"integer"},"title":{"maxLength":1024,"type":"string"},"turn":{"enum":["party","official","nobody"]}},"required":["id","actionId","actionRevision","submissionVersion","revision","state","turn","links"],"type":"object"}}},"description":"Authorized Proposal operation"},"404":{"description":"Resource unavailable to this caller"},"409":{"description":"The Proposal was rejected, or the idempotency key was reused with a different request"},"412":{"description":"Observed authority or lifecycle condition changed, or a Record revision guard failed (`precondition.failed`); a failed field commit guard answers `action.guard_failed` when the selected profile can read it"}},"x-registry-accessProfiles":["directory-editor"]}},"/v1/records/contacts":{"get":{"operationId":"records.contact.list","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Strict Registry read filter expression over compiled filterable API properties.","explode":false,"in":"query","name":"$filter","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"One compiled sortable property, ascending only.","explode":false,"in":"query","name":"$orderby","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Bounded page size.","explode":false,"in":"query","name":"$top","required":false,"schema":{"maximum":100,"minimum":1,"type":"integer"}},{"description":"Request count when the selected compiled query profile allows it.","explode":false,"in":"query","name":"$count","required":false,"schema":{"type":"boolean"}},{"description":"Opaque continuation cursor for the next page.","explode":false,"in":"query","name":"$skiptoken","required":false,"schema":{"maxLength":10978,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"count":{"format":"int64","minimum":0,"type":"integer"},"items":{"items":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"type":"array"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"},"pageInfo":{"additionalProperties":false,"properties":{"nextCursor":{"maxLength":10978,"type":["string","null"]}},"required":["nextCursor"],"type":"object"}},"required":["items","pageInfo","meta","@context"],"type":"object"}}},"description":"Records returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"query.cursor_invalid":{"value":{"code":"query.cursor_invalid","detail":"The query cursor is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/cursor_invalid"}},"query.invalid":{"value":{"code":"query.invalid","detail":"The query request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/query/invalid"}},"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"list","x-registry-queryKind":"list","x-registry-queryProfiles":{"directory-editor":{"allowCount":false,"filterableProperties":[],"kind":"list","maximumPageSize":100,"profile":"directory-editor","selectableProperties":["email","jurisdiction","name"],"selectorProperties":[],"sortableProperties":[],"temporal":null}},"x-registry-recordType":"contact","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"contact","x-registry-responseShape":"RegistryRecordCollectionV1"},"post":{"operationId":"records.contact.create","parameters":[{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to method, route, caller, target record, package revision, request body, and response field set.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/contact-create-input"}},"required":["data"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/contact"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/contact"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record created","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Location":{"description":"Relative URL of the created record.","schema":{"type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"403":{"content":{"application/problem+json":{"examples":{"write.outside-boundary":{"value":{"code":"write.outside-boundary","detail":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"create","x-registry-recordType":"contact","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"contact","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/records/contacts/{record_id}":{"get":{"operationId":"records.contact.get","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Comma-separated subset of readable API property names.","explode":false,"in":"query","name":"$select","required":false,"schema":{"maxLength":16384,"type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"minLength":1,"type":"string"},"jurisdiction":{"maxLength":40,"minLength":1,"type":"string"},"name":{"maxLength":160,"minLength":1,"type":"string"}},"type":"object"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record returned","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"source.unavailable":{"value":{"code":"source.unavailable","detail":"The Registry data service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/source/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"get","x-registry-recordType":"contact","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"contact","x-registry-responseShape":"RegistryRecordSingleV1"},"patch":{"operationId":"records.contact.patch","parameters":[{"description":"Canonical record UUID.","in":"path","name":"record_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Optional W3C trace context. Responses carry Registry trace context for the request.","in":"header","name":"traceparent","required":false,"schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}},{"description":"Select one compiled access profile. Required when the route has no default; otherwise omission uses its default.","explode":false,"in":"query","name":"accessProfile","required":false,"schema":{"maxLength":128,"type":"string"}},{"description":"Idempotency key bound to method, route, caller, target record, package revision, request body, and response field set.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":256,"minLength":1,"pattern":"^[\\x21-\\x2B\\x2D-\\x3A\\x3C-\\x7E]+$","type":"string"}},{"description":"Strong Registry ETag for the currently visible record representation.","in":"header","name":"If-Match","required":true,"schema":{"maxLength":256,"minLength":6,"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},{"description":"Choose the ordinary JSON or JSON-LD Registry Record representation.","in":"header","name":"Accept","required":false,"schema":{"enum":["application/json","application/ld+json"],"type":"string"}}],"requestBody":{"content":{"application/json-patch+json":{"schema":{"items":{"additionalProperties":false,"else":{"required":["value"]},"if":{"properties":{"op":{"const":"remove"}}},"properties":{"op":{"enum":["add","replace","remove","test"],"type":"string"},"path":{"type":"string"},"value":true},"required":["op","path"],"then":{"not":{"required":["value"]}},"type":"object"},"maxItems":128,"minItems":1,"type":"array"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/contact"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta"],"type":"object"}},"application/ld+json":{"schema":{"additionalProperties":false,"properties":{"@context":{"const":"https://id.registrystack.org/contexts/registry-record/v1"},"data":{"additionalProperties":false,"properties":{"domainData":{"$ref":"#/components/schemas/contact"},"recordIdentifier":{"format":"uuid","type":"string"},"revisionIdentifier":{"pattern":"^[1-9][0-9]*$","type":"string"}},"required":["recordIdentifier","revisionIdentifier","domainData"],"type":"object"},"meta":{"additionalProperties":false,"properties":{"datasetIdentifier":{"const":"directory"},"recordTypeIdentifier":{"const":"contact"},"registryIdentifier":{"const":"local-directory"}},"required":["registryIdentifier","datasetIdentifier","recordTypeIdentifier"],"type":"object"}},"required":["data","meta","@context"],"type":"object"}}},"description":"Record patched","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"ETag":{"description":"Strong Registry ETag bound to the record, package revision, caller profile, and response field set.","schema":{"pattern":"^\\\"breg-[\\x21\\x23-\\x7E]+\\\"$","type":"string"}},"Link":{"description":"Emitted only for application/json and application/ld+json Registry Record responses and omitted for application/geo+json. Carries the Registry Record profile and caller-visible record type schema. The describedby target includes the configured deployment prefix and is never derived from Host or forwarded headers.","schema":{"example":"; rel=\"profile\", ; rel=\"describedby\"","type":"string"}},"Vary":{"description":"Responses vary by authorization and negotiated representation.","schema":{"type":"string"}},"traceparent":{"description":"Trace context for this response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"400":{"content":{"application/problem+json":{"examples":{"request.invalid":{"value":{"code":"request.invalid","detail":"The request is invalid.","status":400,"title":"Bad Request","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/invalid"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"401":{"content":{"application/problem+json":{"examples":{"authentication.refused":{"value":{"code":"authentication.refused","detail":"The bearer credential is missing or refused.","status":401,"title":"Unauthorized","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/authentication/refused"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"403":{"content":{"application/problem+json":{"examples":{"write.outside-boundary":{"value":{"code":"write.outside-boundary","detail":"The write falls outside what the selected access profile may write: its row boundary or a disclosure condition.","status":403,"title":"Forbidden","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/write/outside-boundary"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"404":{"content":{"application/problem+json":{"examples":{"resource.not_found":{"value":{"code":"resource.not_found","detail":"The requested resource was not found.","status":404,"title":"Not Found","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/resource/not_found"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"409":{"content":{"application/problem+json":{"examples":{"idempotency.key-reused":{"value":{"code":"idempotency.key-reused","detail":"The idempotency key is bound to another request.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/key-reused"}},"mutation.conflict":{"value":{"code":"mutation.conflict","detail":"The mutation conflicts with current state.","status":409,"title":"Conflict","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/mutation/conflict"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"410":{"content":{"application/problem+json":{"examples":{"idempotency.expired":{"value":{"code":"idempotency.expired","detail":"The held response of the idempotency key expired; the key stays spent.","status":410,"title":"Gone","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/idempotency/expired"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"412":{"content":{"application/problem+json":{"examples":{"precondition.failed":{"value":{"code":"precondition.failed","detail":"The mutation precondition failed.","status":412,"title":"Precondition Failed","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/failed"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"415":{"content":{"application/problem+json":{"examples":{"unsupported.media_type":{"value":{"code":"unsupported.media_type","detail":"The request media type is not supported.","status":415,"title":"Unsupported Media Type","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/unsupported/media_type"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"428":{"content":{"application/problem+json":{"examples":{"precondition.required":{"value":{"code":"precondition.required","detail":"The mutation precondition is required.","status":428,"title":"Precondition Required","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/precondition/required"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"503":{"content":{"application/problem+json":{"examples":{"service.unavailable":{"value":{"code":"service.unavailable","detail":"The Registry mutation service is unavailable.","status":503,"title":"Service Unavailable","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/service/unavailable"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}},"504":{"content":{"application/problem+json":{"examples":{"request.timeout":{"value":{"code":"request.timeout","detail":"The request timed out.","status":504,"title":"Gateway Timeout","traceId":"11111111111111111111111111111111","type":"https://id.registrystack.org/problems/registry-breg/request/timeout"}}},"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Problem response","headers":{"Cache-Control":{"description":"Caller-dependent responses must not be stored.","schema":{"const":"no-store"}},"traceparent":{"description":"Trace context for this problem response.","example":"00-11111111111111111111111111111111-2222222222222222-01","schema":{"maxLength":55,"minLength":55,"pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","type":"string"}}}}},"security":[{"bearerAuth":[]}],"x-registry-accessProfiles":["directory-editor"],"x-registry-operation":"patch","x-registry-recordType":"contact","x-registry-responseProfile":"https://id.registrystack.org/profiles/registry-record/v1","x-registry-responseRecordType":"contact","x-registry-responseShape":"RegistryRecordSingleV1"}},"/v1/review-completions":{"post":{"description":"Available when a review authority configures a completion token and recipient binding.","operationId":"receiveReviewCompletion","parameters":[{"in":"header","name":"Registry-Recipient-Binding","required":true,"schema":{"maxLength":256,"minLength":1,"type":"string"}},{"description":"Must equal eventId.","in":"header","name":"Idempotency-Key","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewCompletion"}}},"required":true},"responses":{"204":{"description":"Completion accepted or already recorded."},"400":{"description":"The completion or idempotency binding is invalid."},"401":{"description":"The completion authority could not be authenticated."},"415":{"description":"The request is not application/json."},"503":{"description":"The completion could not be durably recorded."}},"security":[{"bearerAuth":[]}],"summary":"Receive a Casework review completion"}}}} \ No newline at end of file diff --git a/products/breg/generated/tools/migration-descriptor.v1alpha1.schema.json b/products/breg/generated/tools/migration-descriptor.v1alpha1.schema.json index a600886120..e37592fe3f 100644 --- a/products/breg/generated/tools/migration-descriptor.v1alpha1.schema.json +++ b/products/breg/generated/tools/migration-descriptor.v1alpha1.schema.json @@ -45,6 +45,9 @@ "entity-access-log-changed", "entity-geo-json-changed", "entity-temporal-changed", + "record-attachment-slot-added", + "record-attachment-slot-removed", + "record-attachment-slot-changed", "field-added-optional", "field-added-required", "field-removed", @@ -123,6 +126,7 @@ "enum": [ "registry", "record-type", + "record-attachment-slot", "field", "derived-relation", "constraint", diff --git a/products/breg/scripts/test-postgres.sh b/products/breg/scripts/test-postgres.sh index a46e618270..d9f72566e9 100755 --- a/products/breg/scripts/test-postgres.sh +++ b/products/breg/scripts/test-postgres.sh @@ -122,6 +122,7 @@ postgres_targets=( postgres_proposal_guard_failure postgres_proposal_security postgres_proposal_s3 + postgres_record_attachments postgres_facility_proposal postgres_action_task_grants postgres_generated_console diff --git a/products/breg/scripts/test_validate_product.py b/products/breg/scripts/test_validate_product.py index ef7d67ff69..26a1e3eece 100644 --- a/products/breg/scripts/test_validate_product.py +++ b/products/breg/scripts/test_validate_product.py @@ -74,7 +74,7 @@ def test_security_range_is_closed_through_derived_sql_invariants(self) -> None: ) extension_rows = matrix["invariants"][24:] self.assertEqual( - [f"BREG-NEG-{index:02d}" for index in range(25, 217) if index not in {61, 62}], + [f"BREG-NEG-{index:02d}" for index in range(25, 224) if index not in {61, 62}], [invariant["negativeId"] for invariant in extension_rows], ) for invariant in extension_rows: @@ -252,7 +252,7 @@ def test_record_timer_targets_and_operator_binary_are_owned_by_gate(self) -> Non def test_native_proposal_targets_replace_retired_request_targets(self) -> None: commands = list(VALIDATOR.POSTGRES_TEST_COMMANDS) - for target in ("postgres_refactor", "postgres_proposal", "postgres_proposal_security", "postgres_proposal_s3", "postgres_native_retention", "postgres_facility_proposal", "postgres_action_task_grants", "postgres_generated_console"): + for target in ("postgres_refactor", "postgres_proposal", "postgres_proposal_security", "postgres_proposal_s3", "postgres_record_attachments", "postgres_native_retention", "postgres_facility_proposal", "postgres_action_task_grants", "postgres_generated_console"): self.assertIn("cargo test --locked -p registry-breg --features postgres-test,tooling,schema --test " + target, commands) self.assertFalse(any("--test postgres_request_" in command or "--test postgres_change_requests" in command or "--test postgres_rhai_planner" in command for command in commands)) diff --git a/products/breg/scripts/validate_product.py b/products/breg/scripts/validate_product.py index bf4138ddae..ec0e79dec5 100644 --- a/products/breg/scripts/validate_product.py +++ b/products/breg/scripts/validate_product.py @@ -31,7 +31,7 @@ CONTRACT_STATES = {"enforced", "partial", "planned"} V1_REQUIREMENT_IDS = tuple(f"BREG-V1-{index:02d}" for index in range(1, 45)) ACCEPTANCE_JOURNEY_IDS = tuple(f"BREG-J{index:02d}" for index in range(1, 25)) -SECURITY_INVARIANT_IDS = tuple(f"BREG-SEC-{index:02d}" for index in range(1, 217) if index not in {61, 62}) +SECURITY_INVARIANT_IDS = tuple(f"BREG-SEC-{index:02d}" for index in range(1, 224) if index not in {61, 62}) ACCEPTANCE_FIXTURES = { "BREG-J01": ("asset-site-placement", "acceptance/asset-site-placement"), "BREG-J02": ("asset-site-placement", "acceptance/asset-site-placement"), @@ -161,6 +161,7 @@ "cargo test --locked -p registry-breg --features postgres-test,tooling,schema --test postgres_proposal_guard_failure", "cargo test --locked -p registry-breg --features postgres-test,tooling,schema --test postgres_proposal_security", "cargo test --locked -p registry-breg --features postgres-test,tooling,schema --test postgres_proposal_s3", + "cargo test --locked -p registry-breg --features postgres-test,tooling,schema --test postgres_record_attachments", "cargo test --locked -p registry-breg --features postgres-test,tooling,schema --test postgres_facility_proposal", "cargo test --locked -p registry-breg --features postgres-test,tooling,schema --test postgres_action_task_grants", "cargo test --locked -p registry-breg --features postgres-test,tooling,schema --test postgres_generated_console", diff --git a/products/identifiers/generated/catalog.v1.json b/products/identifiers/generated/catalog.v1.json index c65f446be8..327343cef3 100644 --- a/products/identifiers/generated/catalog.v1.json +++ b/products/identifiers/generated/catalog.v1.json @@ -61,7 +61,7 @@ "description": "The declared Evidence dependency could not be accepted.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "action.evidence_failed", @@ -80,7 +80,7 @@ "description": "The action guard was not satisfied.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "action.guard_failed", @@ -99,7 +99,7 @@ "description": "The action handler could not produce an accepted result.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "action.handler_failed", @@ -118,7 +118,7 @@ "description": "The action was refused by a declared business rule.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "action.refused", @@ -127,6 +127,82 @@ ] } }, + { + "uri": "https://id.registrystack.org/problems/registry-breg/attachment/content-type", + "kind": "problem", + "status": "active", + "compatibilityLine": "v1alpha1", + "owner": "breg", + "title": "Unsupported Media Type", + "description": "The file media type is not one the attachment slot accepts.", + "source": { + "path": "crates/registry-breg/src/problem.rs", + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" + }, + "problem": { + "code": "attachment.content-type", + "httpStatuses": [ + 415 + ] + } + }, + { + "uri": "https://id.registrystack.org/problems/registry-breg/attachment/digest-mismatch", + "kind": "problem", + "status": "active", + "compatibilityLine": "v1alpha1", + "owner": "breg", + "title": "Unprocessable Entity", + "description": "The file content does not match its declared SHA-256 digest.", + "source": { + "path": "crates/registry-breg/src/problem.rs", + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" + }, + "problem": { + "code": "attachment.digest-mismatch", + "httpStatuses": [ + 422 + ] + } + }, + { + "uri": "https://id.registrystack.org/problems/registry-breg/attachment/slot-write-once", + "kind": "problem", + "status": "active", + "compatibilityLine": "v1alpha1", + "owner": "breg", + "title": "Conflict", + "description": "The record attachment slot already holds a file and is write-once.", + "source": { + "path": "crates/registry-breg/src/problem.rs", + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" + }, + "problem": { + "code": "attachment.slot-write-once", + "httpStatuses": [ + 409 + ] + } + }, + { + "uri": "https://id.registrystack.org/problems/registry-breg/attachment/too-large", + "kind": "problem", + "status": "active", + "compatibilityLine": "v1alpha1", + "owner": "breg", + "title": "Content Too Large", + "description": "The file is larger than the attachment slot accepts.", + "source": { + "path": "crates/registry-breg/src/problem.rs", + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" + }, + "problem": { + "code": "attachment.too-large", + "httpStatuses": [ + 413 + ] + } + }, { "uri": "https://id.registrystack.org/problems/registry-breg/authentication/refused", "kind": "problem", @@ -137,7 +213,7 @@ "description": "The bearer credential is missing or refused.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "authentication.refused", @@ -156,7 +232,7 @@ "description": "The external view's indexed coverage is incomplete for this request.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "external_view.incomplete", @@ -175,7 +251,7 @@ "description": "The held response of the idempotency key expired; the key stays spent.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "idempotency.expired", @@ -194,7 +270,7 @@ "description": "The idempotency key is bound to another request.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "idempotency.key-reused", @@ -213,7 +289,7 @@ "description": "The chunk does not match the expected next chunk.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "ingestion.chunk_mismatch", @@ -232,7 +308,7 @@ "description": "The selected access profile does not match the run's bound profile.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "ingestion.profile_mismatch", @@ -251,7 +327,7 @@ "description": "The stored receipt of the chunk was erased.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "ingestion.receipt_erased", @@ -270,7 +346,7 @@ "description": "The ingestion run is blocked and refuses further chunks.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "ingestion.run_blocked", @@ -289,7 +365,7 @@ "description": "The ingestion run is not open for this transition.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "ingestion.run_not_open", @@ -308,7 +384,7 @@ "description": "The lookup did not resolve exactly one record.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "lookup.unresolved", @@ -327,7 +403,7 @@ "description": "The mutation conflicts with current state.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "mutation.conflict", @@ -346,7 +422,7 @@ "description": "The mutation precondition failed.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "precondition.failed", @@ -365,7 +441,7 @@ "description": "The mutation precondition is required.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "precondition.required", @@ -384,7 +460,7 @@ "description": "The review rejected this Proposal, and a rejection is final. A review result of changes-requested is what lets a Proposal be revised for another attempt.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "proposal.rejected", @@ -403,7 +479,7 @@ "description": "The current review result does not match the retained approval.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "proposal.review_result_mismatch", @@ -422,7 +498,7 @@ "description": "The review result and application receipt of the submission are no longer retained.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "proposal.submission_expired", @@ -441,7 +517,7 @@ "description": "The query cursor is invalid.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "query.cursor_invalid", @@ -460,7 +536,7 @@ "description": "The list did not carry the search criteria its access profile requires.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "query.filter_required", @@ -479,7 +555,7 @@ "description": "The query request is invalid.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "query.invalid", @@ -498,7 +574,7 @@ "description": "The access profile requires a valid Registry-Access-Reason header.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "request.access_reason_required", @@ -517,7 +593,7 @@ "description": "The request is invalid.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "request.invalid", @@ -536,7 +612,7 @@ "description": "The request timed out.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "request.timeout", @@ -555,7 +631,7 @@ "description": "The requested resource was not found.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "resource.not_found", @@ -574,7 +650,7 @@ "description": "The Registry field-encryption service is unavailable.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "runtime.field_encryption.unavailable", @@ -593,7 +669,7 @@ "description": "Registry runtime is not ready.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "runtime.not_ready", @@ -612,7 +688,7 @@ "description": "The Registry mutation service is unavailable.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "service.unavailable", @@ -631,7 +707,7 @@ "description": "The Registry data service is unavailable.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "source.unavailable", @@ -650,7 +726,7 @@ "description": "A statistical dataset contains a code outside its declared domain.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "statistical_dataset.domain_violation", @@ -669,7 +745,7 @@ "description": "The statistical dataset release operation is not eligible.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "statistical_dataset.release_refused", @@ -688,7 +764,7 @@ "description": "The statistical dataset computation was superseded or its package changed.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "statistical_dataset.version_conflict", @@ -707,7 +783,7 @@ "description": "The statistical dataset version was withdrawn.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "statistical_dataset.version_withdrawn", @@ -726,7 +802,7 @@ "description": "The request media type is not supported.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "unsupported.media_type", @@ -745,7 +821,7 @@ "description": "The write falls outside what the selected access profile may write: its row boundary or a disclosure condition.", "source": { "path": "crates/registry-breg/src/problem.rs", - "sha256": "c18ba2208005e7c196085ed0351546fd21d21c327da4bd18d9dda431a5534d1b" + "sha256": "482ef61e4e5d481af574e583774fb17c1e0ebf557106ae9d4da8bee93c3e90ea" }, "problem": { "code": "write.outside-boundary", @@ -4797,7 +4873,7 @@ "description": "Base Registry Engine portable Action contract export schema, reproduced from the canonical compiled project.", "source": { "path": "crates/registry-breg/src/artifacts.rs", - "sha256": "4eafda1e96537072f79750d43737221c315a4efd39c0cf5b0c1d83ca78bcb0f3" + "sha256": "1205595c67c8ae57e9744b2a52b98cbff6546416f1271491a42d29387ddbaa70" }, "artifact": { "path": "products/breg/generated/facility/generated/action-contracts.schema.json", @@ -4981,7 +5057,7 @@ }, "artifact": { "path": "products/breg/generated/tools/migration-descriptor.v1alpha1.schema.json", - "sha256": "1f9fb0ab8696b817e755116bcd629c06018729ecf64c538ab60ed04c54a9726c", + "sha256": "b7268d94873cd2879900201b8febbb93f51839e0f2b82cbc745c12f2003199d8", "mediaType": "application/schema+json" } }, @@ -5035,7 +5111,7 @@ }, "artifact": { "path": "products/breg/generated/authoring/registry-module.schema.json", - "sha256": "296e314b1b1e0c9f92d8d7c7feb7c22ed1b1969b2f66de84a65f4bf1fecb7ed2", + "sha256": "0689f2010a51d1bc5b12c20377b208a5b579c525828a2246d03da5f6f64ac408", "mediaType": "application/schema+json" } }, @@ -5053,7 +5129,7 @@ }, "artifact": { "path": "products/breg/generated/authoring/registry-project.schema.json", - "sha256": "e578f773c5161eadd82dadb0c3ec45a69d8f15bdc4095af8299a612d5eeeaf6d", + "sha256": "206317fcd5bc1ca10bbf77c534305c26094c7879143319214bfb1fbd627a2738", "mediaType": "application/schema+json" } },